Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi 10 Seattle and 10.1 Berlin not able to debug COM DLL

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:

  1. Change to DEBUG (and check for those debug options ticked. e.g. Debug Information)

  2. regsvr32 the project DLL under output directory

  3. write a vbscript that simply creates the COM object and invoke its method

  4. 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

  5. set the command-line parameter to run the vbscript.

  6. set a breakpoint at the invoked method.

  7. 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?

like image 245
justyy Avatar asked Jun 14 '16 10:06

justyy


1 Answers

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.

like image 129
justyy Avatar answered Sep 21 '22 15:09

justyy