Troubles setting breakpoints in Windows DLL [message #88740] |
Sat, 06 December 2003 16:51 |
Eclipse User |
|
|
|
I am using Eclipse 2.1.1, CDT 1.2, gcc (GCC) 3.3.1 (cygming special) and
GNU gdb 2003-09-20-cvs (cygwin-special) to try and debug a Windows DLL. I
am having several difficulties in setting breakpoints in the DLL.
Problem 1 - DLL symbols aren't loaded when .exe is loaded
---------------------------------------------------------
I can't seem to cause the DLL symbols to be loaded when the .exe is loaded
using any combination of Debug options. The "Stop on shared library
events" option doesn't seem to have any effect either.
Note that my .exe is not linked with the import libraries for the .DLLs,
nor can it be since it doesn't know at compile/link time what DLLs it
might have to load. I do know at the time of launching the .exe what DLLs
it will load, however, if this is of any use.
Problem 2 - Can't suspend EXE to set breakpoints
------------------------------------------------
Since I can't load the DLL symbols in advance, I try to suspend the .exe
and set breakpoints then. I have seen this work once or twice, but most
of the time does not work (I wonder if this is because the .exe is usually
waiting for a socket connection at this point). What DOES work is if I
CTRL+C in the console window the .exe is running in. The debugger reports
the process as suspended and I am able to set breakpoints.
This is obviously not an ideal way to do things. Also, even with the
CTRL+C method, I still have to wait until I know the DLL has been loaded.
My situation is slightly further complicated by the fact that my source
file is not a .cpp file. My tool chain looks like:
source.sc -> my tool -> generated.cpp -> gcc -> .dll
Thus, I'm unable to simply open source.sc (and I'd prefer not to open
generated.cpp since it is an intermediate file that is deleted) and set
breakpoints before running my .exe, even if this could work. In fact, the
way I'm setting breakpoints now is using the gdb console.
Any suggestions on the following would be appreciated:
1) How to load DLL symbols at startup
2) How to reliably suspend a process (if I can't do #1)
3) Is there any documentation on how the CDT sets breakpoints? I'd
ultimately like to be able to have CDT "understand" my .sc files and have
the ability to set breakpoints in them.
Thanks in advance for your help.
Cameron Stevens
|
|
|
Powered by
FUDForum. Page generated in 0.04557 seconds