Can't debug COM library with regsvr32.exe as host application
Original Reporter info from Mantis: PascalDragon @PascalDragon
-
Reporter name: Sven Barth
Original Reporter info from Mantis: PascalDragon @PascalDragon
- Reporter name: Sven Barth
Description:
I recently had the need to debug the registration of a COM object and thus set the host application in the start parameters of my library project to C:\Windows\system32\regsvr32.exe which I'd also use outside of the IDE to register my COM library. However starting the application leads to a crash of the debugger (debugger is set to "GNU debugger (GDB)") with the following error message:
The GDB command:
"info address main"
returned the error:
",msg="No symbol "main" in current context.""
I don't know if it makes a difference, but regsvr32.exe loads the library dynamically at runtime instead of at load time.
Steps to reproduce:
- create a new library project
- optional: adjust the main source to this:
=== code begin ===
library comtest;
{$mode objfpc}{$H+}
uses
comserv
{ you can add units after this };
exports
DllRegisterServer,
DllUnregisterServer,
DllCanUnloadNow,
DllGetClassObject;
begin
end.
=== code end ===
- go to Run -> Run Parameters
- set Host Application to C:\Windows\system32\regsvr32.exe
- optional: set the run parameters to the path of the created library
- run the project
-> debugger crashes
Mantis conversion info:
- Mantis ID: 36644
- OS: Windows NT
- OS Build: 10
- Platform: X86_64
- Version: 2.1 (SVN)