I have a COM DLL project, and I am able to debug it (stop at breakpoints) in Delphi 2007 and XE8.
However, it seems to not be possible for the IDE to stop at breakpoints in Delphi 10 Seattle or 10.1 Berlin.
My steps of debugging:
Change to DEBUG (and check for those debug options ticked. e.g. Debug Information)
regsvr32 the project DLL under output directory
write a vbscript that simply creates the COM object and invoke its method
in the debugger, set a Run
command-line using c:\windows\syswow64\cscript.exe
for 32-bit or c:\windows\system32\cscript.exe
for 64-bit debugging
set the command-line parameter to run the vbscript.
set a breakpoint at the invoked method.
Hit F9
Expected: to stop at the breakpoint
In Delphi 2007 and XE8, all is OK, but I was not able to do it in Delphi Seattle or Berlin.
What could possible go wrong here? Are there any settings that I need to enable/disable in order to debug the COM DLL under Delphi's latest IDE versions?
It looks like it is a issue of the IDE. I have raised the issue in JIRA: https://quality.embarcadero.com/browse/RSP-14964
I finally find a work-around in my case.
I have to press F8 instead of F9. In this case, the CPU window will popup with mixed Pascal and Assembly instructions, and if you press F9 it will be most likely to stop at break points (however sometimes random behavior do occur). I can reproduce this as many times as I want. Press F9 directly does not stop at breakpoints, but the cscript.exe window does popup during debugging.
My project is a 300K COM DLL.
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