Home > Back-end >  Debugging of BCB
Debugging of BCB

Time:10-02

I'm writing a collapse of the BCB deliberately code
 void __fastcall TForm1: : btn1Click (TObject * Sender) 
{
Char * p=new char [20];
The delete [] p;
Strcpy (p1, "aaaaaaaaaaaaaaafsssssssssssewweeeeeeeeeeeeeeeeeeeeeeee");
P1=new char [20].//this collapse
}

The last sentence would collapse, but I why can't locate this debug window, open the call stack window, no btn1click to locate the function, if it is a single step debugging to collapse this line of code is the call stack is btn1click the function name, after debugging assembly into the new [] function call sometime after leaves the call stack window information,

I want to ask is there any way to make the call stack shows btn1Click the function, this program is run after the collapse and then enter the state testing can know this function is wrong,

CodePudding user response:

Open the codeguard, this kind of error will be prompted

CodePudding user response:

This is because an exception occurs, the program has entered the Windows exception handling process, so the call stack in rtl60. BPL here, you beat a breakpoint at the front, in btnclick stack

CodePudding user response:

refer to the second floor songhtao response:
this is because an exception occurs, the program has entered the Windows exception handling process, so the call stack in rtl60. BPL here, you beat a breakpoint at the front, the stack in btnclick

This I also mentioned in the problem, single step debugging can be, but it cannot run directly to there, you can try

CodePudding user response:

Strcpy (p1, "aaaaaaaaaaaaaaafsssssssssssewweeeeeeeeeeeeeeeeeeeeeeee");
Is this sentence leading to collapse, not behind the words, why do you want to the front the delete?
So do not collapse

CodePudding user response:

If you don't believe, you can first will melt the words of the commented out look will crash again
  • Related