Delphi: Why does “use debug DCUs” become ineffective if I'm using packages in my project?

StackOverflow https://stackoverflow.com/questions/257711

  •  06-07-2019
  •  | 
  •  

Question

I'm building a project that uses the JVCL plugin system, which relies on Delphi packages, and ever since I added it to my project, debugging has become a nightmare because I'm no longer able to step-trace into the source of any VCL or RTL units. They're all marked as gray dots in the debugger, (when the relevant functions appear at all in the call stack; sometimes I get very strange results,) and it's driving me crazy. Does anyone know how to get my debug DCU functionality back? (Aside from the obvious: rip out all the plugin-related code. That would work, but it wouldn't really help.)

Edit: Just to be clear, I can trace anything else in my project. JVCL code. Other 3rd party libraries. My own code. All of it shows up just fine in the debugger. Just not the Delphi RTL and VCL code--the stuff that the compiler option "use debug DCUs" is supposed to grant you access to.

Was it helpful?

Solution

This is working as designed.

When you are building with packages, you are executing the package code, and not using any DCU's. Therefore, the DCU's are compiled in, and you don't get access to the Debug DCU's.

You can either turn off packages altogether, or don't compile with the specific packages you want to debug. You can choose what packages should be used or not used, and the ones that aren't used will be "debuggable" with the Debug DCU's.

OTHER TIPS

Packages are just DLLs. You have to include the debug info into those to be able to debug them, which is what you want to do. So you would need to have DEBUG packages for the VCL and RTL, not debug dcus. The debug dcus are not even needed anymore when you use prebuilt packages.

It could be the DCU's you have are out of date, so the debugger doesn't step into the code.

Usually deleting all the DCU's then doing a Build All will fix this.

You may need to delete DCU's in the search path too, just to be sure. Make a backup first of course...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top