views:

966

answers:

3

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.

A: 

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...

KiwiBastard
It's not my own DCUs that give me trouble. They work just fine. It's only the system ones--the RTL and the VCL components--that cause trouble for me, and I can only suppose that poking deleting those would cause even more problems.
Mason Wheeler
+2  A: 

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.

François
All right. Do these debug packages exist? Where do I find them?
Mason Wheeler
You can't find them. Theoreticly you could build them yourself while you have all (or almost all?) source code.
Lars Truijens
+6  A: 

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.

Nick Hodges
It is a shame though. Because sometime applications depend on using runtime packages (plugin structures).
Lars Truijens
I tried removing "VCL" "VCLX" and "RTL" from the "build with packages" list. It didn't work. Neither does turning off "build with packages" entirely.
Mason Wheeler
Turning off "build with packages" should work. Make sure you do a full rebuild and turn on Use Debug DCUs. This of course does not work if you still use runtime packages some other way (loading packeges dynamicly).
Lars Truijens