Hi all,
we have been struggling with an issue like this and we found a workaround that works in our environment.
In our case the problem appears not only with dynamically loaded packages, but also with runtime packages. For example:
App.exe uses a class contained in Pkg.bpl
App.exe loads Pkg.bpl as a runtime package
Run App.exe using parameter host application in Pkg.bpl
Breakpoints inside Pkg.bpl were completely ignored by the debugger
We have found that the project you want to debug must not be the last one compiled. If the last compiled project contains at least a requires reference to the package you want to debug, the debugger is properly activated.
Suppose we have:
App.exe is the one we want to debug with runtime packages
AppDebug.exe is an additional fake project in the same group
Steps:
Build App.exe in debug configuration
Build the fake project AppDebug.exe
Run App.exe and see the breakpoint in Pkg.bpl
If you make changes in App.exe, recompile it, then recompile the fake project AppDebug.exe, and only then start debugging again. After restarting Delphi 12, you need to recompile both projects, ensuring the project you want to debug is not the last one compiled.
HTH