12

I have a Delphi app that we're migrating to C++. One thing I often do while debugging my Delphi code is step into the VCL itself to understand exactly what's going on, to track some bugs. Is this possible in C++Builder?

Suppose I am in C++Builder and I call "ShowMessage". Can I step into that call in my debugging session and switch to Pascal on the fly?

stukelly
  • 4,257
  • 3
  • 37
  • 44
C. Smith
  • 149
  • 5

1 Answers1

18

It is possible, but you must change two settings. You must turn off the Dynamic RTL in the linker settings. You must disable linking with runtime packages in the package settings.

David Dean
  • 2,682
  • 23
  • 34
  • Does the runtime package rule still exist in XE, with debug DCPs provided? – Mason Wheeler Oct 08 '10 at 16:51
  • @Mason, No. C++ requires the tds files as well as the DCPs. It is on my radar, so I will be pushing for it. – David Dean Oct 08 '10 at 17:56
  • @Mason: In all versions of C++, you have to enable the Debug .DCUs and disable the Dynamic RTL and Runtime Packages. The debugger cannot step into the VCL source if it is contained in external libraries, it has to be compiled directly into the application being debugged. – Remy Lebeau Oct 08 '10 at 17:57
  • Thank you so much! This makes a BIG difference. I assume this will also allow us to step into our own Pascal code from our C++ program? – C. Smith Oct 08 '10 at 20:19
  • @David, could you clarify, please? You said *no* to Mason's follow-up question, to say that the runtime-package rule does not still exist, but then the rest of your comment seems to indicate that the rule *does* still exist because merely having debug DCPs isn't sufficient for C++ Builder. – Rob Kennedy Oct 08 '10 at 20:46
  • 1
    @Rob Thanks for pointing out the fact that this is unclear. The "rule" is (and has always been) that you need both debug DCPs and TDS files for C++ to debug into BPLs. (dynamic runtime packages) With XE, you now get DCP files you need for many of the packages supplied by Embarcadero. We failed to deliver TDS files for the same packages. I intend to see that this is corrected. So that means, It is possible to debug into bpls you build yourself, but not the ones shipped with XE. (or earlier) – David Dean Oct 09 '10 at 00:32
  • 2
    The bounty is still open on this, but enabling Debug DCUs and disabling Dynamic RTL and Runtime Packages is the correct answer. It works fine, I do it all the time. – Remy Lebeau Jul 12 '12 at 22:51
  • All of this set nevertheless without result. – truthseeker Jul 18 '12 at 16:12
  • I found this article related to the question: https://www.arbinada.com/en/node/1555 – pi314159 Oct 03 '20 at 05:11
  • If you need to step into external delphi library (F7 key), this option is the key - "Include TD32 debug info". Build delphi library with this option checked. – pi314159 Oct 03 '20 at 06:18