I am probably missing something obvious here, but how do you debug a dll using pdb from within Lazarus?
I turned on all the debug options in the Compiler options (no optimization, -g, -gl, -gw, -Xg), but sill no luck.
I have a COM library that can be hosted by an external app.
The simplest test would be to run the dll under regsvr32.exe. The working directory is set to where the dll resides.
I tried copying the exe to the same directory, still no luck.
Does the debugger only look for the debug symbolx for the host process (regsvr32.exe), but not for the hosted dll to be debugged?
Looks like the debugger just does nto see the the DBG file or does nto know that which one needs to be loaded.:
<-break-insert uSession.pas:6680>
&"No source file named uSession.pas in loaded symbols.\n"
^error,msg="No source file named uSession.pas in loaded symbols." DBG file
Full debugger output is below.
Thanks!
<-file-exec-and-symbols "C:/ProgrammingProjects/Redemption/fpc/compiled/regsvr32.exe">
~"(no debugging symbols found)\n"
^done
(gdb)
<-environment-cd .>
^done
(gdb)
<-environment-cd "C:/ProgrammingProjects/Redemption/fpc/compiled/">
^done
(gdb)
<-data-evaluate-expression FPC_THREADVAR_RELOCATE_PROC>
&"No symbol table is loaded. Use the \"file\" command.\n"
^error,msg="No symbol table is loaded. Use the \"file\" command."
(gdb)
<info functions FPC_CPUINIT>
&"info functions FPC_CPUINIT\n"
~"All functions matching regular expression \"FPC_CPUINIT\":\n"
^done
(gdb)
<info functions $$_RUNERROR$>
&"info functions $$_RUNERROR$\n"
~"All functions matching regular expression \"$$_RUNERROR$\":\n"
^done
(gdb)
<-exec-arguments c:\ProgrammingProjects\Redemption\fpc\compiled\Redemption.dll>
^done
(gdb)
<-gdb-set language pascal>
^done
(gdb)
<info address main>
&"info address main\n"
&"No symbol \"main\" in current context.\n"
^error,msg="No symbol \"main\" in current context."
(gdb)
<-break-insert -t main>
&"Function \"main\" not defined in loaded symbols.\n"
^error,msg="Function \"main\" not defined in loaded symbols."
(gdb)
<-break-insert FPC_RAISEEXCEPTION>
&"Function \"FPC_RAISEEXCEPTION\" not defined in loaded symbols.\n"
^error,msg="Function \"FPC_RAISEEXCEPTION\" not defined in loaded symbols."
(gdb)
<-break-insert FPC_BREAK_ERROR>
&"Function \"FPC_BREAK_ERROR\" not defined in loaded symbols.\n"
^error,msg="Function \"FPC_BREAK_ERROR\" not defined in loaded symbols."
(gdb)
<-break-insert FPC_RUNERROR>
&"Function \"FPC_RUNERROR\" not defined in loaded symbols.\n"
^error,msg="Function \"FPC_RUNERROR\" not defined in loaded symbols."
(gdb)
<info file>
&"info file\n"
~"Symbols from \"C:/ProgrammingProjects/Redemption/fpc/compiled/regsvr32.exe\".\n"
~"Local exec file:\n"
~"\t`C:/ProgrammingProjects/Redemption/fpc/compiled/regsvr32.exe', \n"
~" file type pei-i386.\n"
~"\tEntry point: 0x1002327\t0x01001000 - 0x01002ad8 is .text\n"
~"\t0x01003000 - 0x01003200 is .data\n"
~"\t0x01004000 - 0x01004ad8 is .rsrc\n"
^done
(gdb)
<-break-insert -t *16786215>
^done,bkpt={number="5",type="breakpoint",disp="del",enabled="y",addr="0x01002327",at="",times="0"}
(gdb)
<-exec-run>
^running
(gdb)
~"[New thread 10100.0x11e0]\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
~"(no debugging symbols found)\n"
*stopped,thread-id="1",frame={addr="0x01002327",func="??",args=[]}
(gdb)
<info program>
&"info program\n"
~"\tUsing the running image of child thread 10100.0x11e0.\n"
~"Program stopped at 0x1002327.\n"
~"It stopped at a breakpoint that has since been deleted.\n"
~"Type \"info stack\" or \"info registers\" for more information.\n"
^done
(gdb)
<-break-insert uSession.pas:6680>
&"No source file named uSession.pas in loaded symbols.\n"
^error,msg="No source file named uSession.pas in loaded symbols."
(gdb)
<-break-insert uSession.pas:41554>
&"No source file named uSession.pas in loaded symbols.\n"
^error,msg="No source file named uSession.pas in loaded symbols."
(gdb)
<-exec-continue>
^running
(gdb)
~"[New thread 10100.0x1f90]\n"
~"[Switching to thread 10100.0x1f90]\n"
*stopped,reason="signal-received",signal-name="SIGTRAP",signal-meaning="Trace/breakpoint trap",thread-id="2",frame={addr="0x7c90120f",func="ntdll!DbgUiConnectToDbg",args=[],from="C:\\WINDOWS\\system32\\ntdll.dll"}
(gdb)
<info program>
&"info program\n"
~"\tUsing the running image of child thread 10100.0x1f90.\n"
~"Program stopped at 0x7c90120f.\n"
~"It stopped with signal SIGTRAP, Trace/breakpoint trap.\n"
~"Type \"info stack\" or \"info registers\" for more information.\n"
^done
(gdb)
<-symbol-list-lines C:\ProgrammingProjects\Redemption\Redemption.lpr>
&"mi_cmd_symbol_list_lines: Unknown source file name.\n"
^error,msg="mi_cmd_symbol_list_lines: Unknown source file name."
(gdb)
<-symbol-list-lines Redemption.lpr>
&"mi_cmd_symbol_list_lines: Unknown source file name.\n"
^error,msg="mi_cmd_symbol_list_lines: Unknown source file name."
(gdb)
<-exec-continue>
^running
(gdb)
~"(no debugging symbols found)\n"
~"[New thread 10100.0x270c]\n"
&"warning: Lowest section in C:\\WINDOWS\\system32\\xpsp2res.dll is .rsrc at 00011000\n"
~"[New thread 10100.0x2004]\n"
~"[New thread 10100.0xbc8]\n"
*stopped,reason="exited-normally"
(gdb)
<-break-delete 0>
&"warning: bad breakpoint number at or near '0'\n"
^done
(gdb)
<-break-delete 0>
&"warning: bad breakpoint number at or near '0'\n"
^done
(gdb)
<-break-delete 0>
&"warning: bad breakpoint number at or near '0'\n"
^done
(gdb)
<-file-exec-and-symbols >
^done
(gdb)