views:

53

answers:

1

How do I debug JVCL code using C++Builder? I enabled building debug DCUs when I installed JVCL, I turned on "use debug DCUs" under my project's Delphi settings (there doesn't appear to be an analogous option under C++ settings), and I disabled building with packages. In spite of all of this, single step still skips over JVCL code, and if a JVCL function shows up in a stack trace, double-clicking on it only shows disassembly.

Debugging RTL and VCL code works fine; it's only JVCL code that I'm having problems with.

Any ideas?

Edit: I've also noticed that JVCL debug DCUs work fine for Delphi apps. I tried doing building my project while Process Monitor was running, and for a C++Builder app, it's not even trying to find the JVCL DCUs (so it's apparently not just a problem with my search path). However, it does look for and find DCUs for core VCL files. So apparently C++Builder is determining its dependencies differently than Delphi, and apparently JVCL dependencies are being treated differently than core VCL dependencies, but I don't know how or why.

+1  A: 

Setting the "use debug DCUs" option adds the contents of the debug path option onto the front of the search path option so that next time your code is linked, the linker will use the debug files instead of the normal files.

When you've checked that box, make sure that the directory that contains the debug versions of the JVCL DCUs is on your search path. If it's not, then add the JVCL path to your debug path (right after $(BDS)\Lib\Debug) and toggle the "use debug DCUs" option to reset the search path.

Rob Kennedy
And then make sure you do a BUILD instead of a COMPILE of your project, so that it gets relinked entirely and therefore includes the debug information in the executable.
Ken White
Is that still required, @Ken? I thought Delphi changed several versions ago so that changing compiler and linker settings would automatically trigger a build the next time.
Rob Kennedy
Thanks for the information. I tried doing this, but it didn't seem to help; see my edit.
Josh Kelley
@Rob - AFAIK, but I could have missed the change. I'll have to take a look at that to see.
Ken White