Delphi 12 — How to debug runtime packages when breakpoints are ignored
A workaround to make the debugger work again until an official fix is released
Introduction
Starting from Delphi 12, some developers have noticed an unexpected issue: the debugger completely ignores breakpoints when working with runtime packages. For example, when an application loads a package at runtime, it is often impossible to step into the code inside the package, making debugging very difficult.
In my specific case, I do not have access to the source code of the application, but I need to develop and debug a plugin that the application loads. This limitation makes the debugging issue even more critical.
This problem has already been widely discussed in the Delphi community in this thread Regression — Delphi 12 — Unable to debug dynamically loaded packages, and Embarcadero confirmed that an official fix will be released, although no ETA has been provided so far.
We faced the same issue, and, after several tests, we found a simple method that allows us to debug runtime packages again in Delphi 12 (update 2). It is not a definitive solution, but it works fine in our projects and may help others facing the same situation.
The problem in detail
To better explain the issue, let’s consider a simple example. You have a main application named App.exe (without source code available) and a runtime package named Pkg.bpl developed as a plugin for App.exe that contains a class method used by App.exe.
App.exe is configured to load Pkg.bpl at runtime. When running the application inside the Delphi IDE, everything runs correctly except for these aspects:
- Breakpoints placed in the source code of Pkg.bpl are completely ignored by the debugger
- Even when specifying App.exe as the host application for debugging the package, the IDE does not stop at any breakpoint inside the package
This behavior makes it impossible to step into the code of the runtime package, which is often required when troubleshooting complex applications.
The workaround
After testing several scenarios, we discovered a simple workaround that allows breakpoints to be hit inside runtime packages. The key idea is that the project you want to debug must not be the last one compiled. If the last compiled project contains at least a reference to the package you want to debug, the debugger works correctly. With this in mind, we created a fake project (in the same project group) named AppDebug.exe that will be compiled before starting the debug on the main (real) project named App.exe in our example.
Get Sergio Govoni’s stories in your inbox
Join Medium for free to get updates from this writer.
These steps make Delphi 12 debugging work:
- Build Pkg.bpl in debug configuration
- Build AppDebug.exe in debug configuration
- Run App.exe and breakpoints inside Pkg.bpl will now be hit
If you make changes in Pkg.bpl, follow this sequence again:
- Build Pkg.bpl in debug configuration
- Build AppDebug.exe in debug configuration
- Start debugging
Pay attention, after restarting Delphi 12, you must recompile both projects Pkg.bpl and next AppDebug.exe ensuring that the project you want to debug is not the last one compiled. Although the exact internal reason is not publicly documented, the workaround seems to “activate” the debugger. This approach is not a permanent fix, but it is reliable and allows normal debugging until Embarcadero provides an official solution.
Conclusion
Debugging runtime packages in Delphi 12 can be challenging due to an unexpected issue that prevents the IDE from hitting breakpoints inside runtime packages. While Embarcadero has confirmed that a fix will be released, no ETA is currently available.
The workaround we described allows developers to continue debugging runtime packages effectively by ensuring that the project you want to debug is not the last one compiled.
My sincere thanks to my colleagues who helped discover and test this workaround.
A collection of example projects demonstrating this workaround can be found here:








