Sometimes when debugging, specifically when catching an exception and following through destructors called, Delphi steps through a lot of assembly code. Hit Shift+F8 appears to cause mayhem.
Can I tell the debugger to skip assembly code automatically?
You start debugging by clicking Start Debugging on the Debug menu. On the Start Debugging dialog box, check Enable Assembler debugging, then click OK. If you debug the module again during the same session, you can start it by clicking Start Debugging, Run or Debug.
You can also click on the line you want to skip to and hit Ctrl+F10 (Run to Cursor). It will jump directly to that line.
Debugging delphi source files You need to go to "project->options->compiler" on this tab you need to check the "use debug DCUs". After that you need to build your project again and you can run your application. From now on breakpoints also stop in Delphi source files.
In my experience, the vast majority of such assembly code is in VCL or RTL units.
If you compile with "Debug .dcu's" disabled then the debugger will not step through this code. However, it will also not step through any other VCL/RTL code either - assembler or Pascal. It will still step through any code that is not part of the VCL/RTL, assuming you have the Debug information option enabled for the project.
Whether turning off VCL/RTL debug units makes debugging any particular issue you may have easier or harder will of course depend on your particular circumstances, but usually what is going on inside the VCL/RTL code is of little consequence unless and until you have eliminated the possibility of some error in your own code and then need to investigate a potential bug in the VCL/RTL itself.
For myself, I have "Debug .dcus" turned OFF unless I need them ON.
Your mileage may vary.
If you see assembler code, you probably are in the Alt-F2 CPU view. Just close the CPU view (escape key on old Delphi, or close its tabs), and you'll continue stepping within pascal source code (e.g. press F7 or F8).
If you see assembler code in the middle of a .pas file (in an asm ... end
block), then you can try going to the end of it (at end
level) and press F4 (shift F8 is buggy). But be aware that it may quit not at the end
but in an internal ret
assembler op code. So my personal advice is, if you do not know about assembler, to display the Call Stack (this window displays the function calls that brought you to your current program location and the arguments passed to each function call) and double-click on the parent caller. This will be always safe.
For additional info about debugging, this e.g. this article.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With