We have built an application that uses packages and components. When we debug the application, the "Event Log" in the IDE often shows the our BPLs are being loaded without debug information ("No Debug Info"). This doesn't make sense because all our packages and EXEs are built with debug.
_(each project) | Options | Compiling_
[ x ] Assertions
[ x ] Debug information
[ x ] Local symbols
Symbol reference info = "Reference info"
[ ] Use debug .dcus
[ x ] Use imported data references
_(each project) | Options | Linking_
[ x ] Debug information
Map file = Detailed
We have 4 projects, all built with runtime pacakges:
Problems Observed
1) Many times when we debug, the Components.bpl is loaded with debug info, but all values in the "Local Variables" window are blank. If you hover your mouse over a variable in the code, there is no popup, and Evaluate window also shows nothing (the "Result" pane is always blank).
2) Sometimes the Event Log shows "No Debug Info" for various BPLs. For instance, if we activate the Plugin.bpl project and set it's Run | Parameter's Host Application to be the MainApp.exe, and then press F9, all modules seems to load with "Has Debug Info" except for the Plugin.bpl module. When it loads, the Event Log shows "No Debug Info". However, if we close the app and immediately press F9, it will run it again without recompiling anything and this time Plugin.bpl is loaded with debug ("Has Debug Info").
Questions
1) What would cause the "Local Variables" window to not display the values?
2) Why are BPLs sometimes loaded without debug info when the BPL was complied with debug and all the debug files (dcu, map, etc.) are available?
I would describe my issue with it.
I dynamically load package using LoadPackage
function.
I can see in SysInternals.com Process Monitor
that packagename.DCP got open and read succesfuly after LoadPackage
processed - no file I/O failed, no attempt to find it in wrong places, nothing suspicious. So perhaps there is some construct in DCP that makes IDE debugger go nuts. I long for times when Turbo Debugger
was available for Delphi.
BTW, same is for packagename.RSM if developer creates such.
Then (while paused at breakpoint or Step Trace) i open View / Debug Windows / Modules and see last module is mine - and it has empty "symbol information" cell. I right-click it, choose "Re-load symbols" action - and here it is, from now on i can debug.
PS. Dunno if that would help me to debug initialization sections though - hopefully "break on load
" menu item would work even with dynamical LoadPackage
calls...
PPS. It does work indeed, even across IDE restarts. So now i am alerted at BPL loading with CPU View
, i strike CTRL+ALT+M
, scroll to bottom to find my BPL, r-click to Reload Symbols
, press Enter, then close Modules
and CPU
Views and strike F9 (Run)
. After initialization
sections completes i am again alerted by CPU View
- just few JMP
s before exit out of LoadPackage
- so i close CPU View
and stike F9
yet again. Quite tedious, yet still better than IDE restart.
We have encountered a similar issue in our project. Unfortunately we have dozens of bpl so we cannot merge them in one. This issue appeared after we migrated to XE2 and changed the folder structure of our compile target. While it is difficult to say if newer versions of Delphi introduced the issue or not, we could fix the issue by adding the folder where the bpls are compiled in the path environment variable. Using the path override function of the IDE. This type of configuration was not necessary in Delphi 2010...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With