Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

delphi debugging exclude system.pas

when debugging through VCL (use debug dcus must be on !) you have very often (in some situations most of the time) to step through assembly code, especially such routines like "_IntfClear".

(removing System.pas could not help, because then a popup appears frequently asking where system.pas resides)

Is there any chance to exclude the unit "system" from debugging ?

like image 914
user2807653 Avatar asked Jan 13 '23 07:01

user2807653


1 Answers

Delphi's included DCU files are in the Lib folder. The debug versions are in the Lib/Debug folder. All the "Use debug DCUs" option does is control which of those two folders appears in your project's library path, so when your program is linked, one or the other set of DCU files is included.

Now that we've uncovered the magic of the "Use debug DCUs" option, we can take advantage of it. To exclude a certain DCU from debugging, enable "Use debug DCUs," and then simply find the debug version of the unit in question and replace it with the non-debug version. For example, delete Lib/Debug/System.dcu and replace it with Lib/System.dcu.

Alternatively, if there's one VCL unit that you want to trace through, but are otherwise uninterested in debugging code you didn't write, then disable "Use debug DCUs," and then find the debug version of that DCU and put it in among the non-debug files.

If you accidentally find yourself tracing through a function you're not interested in, you can press Shift+F8 to "step out" of the current function. Eventually, you will learn to recognize the places that typically lead to calls you don't want to trace, and then you'll press F8 to "step over" that code instead of F7 to "step into" it.

like image 160
Rob Kennedy Avatar answered Jan 18 '23 10:01

Rob Kennedy