Author Topic: Anyone success debug dll by cdb.exe ???  (Read 4504 times)

Offline wenxibo

  • Single posting newcomer
  • *
  • Posts: 5
Anyone success debug dll by cdb.exe ???
« on: December 08, 2008, 09:26:48 am »
My dll file is rendered by MS cl.exe and link.exe, and had set the correct path fo cdb.exe.
But when I debug it , the third-party host program is loaded , but can't stop at the breakpoint in my source file for dll.

And the symbol path and source path is correct.(-srcpath and -i)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Anyone success debug dll by cdb.exe ???
« Reply #1 on: December 08, 2008, 03:38:04 pm »
I have the same problem with gdb.

Placing "asm("int3"); /*trap*/" (for gcc++) statements in the code solved my problem. You'll have to use the correct flavor of "int3" for your compiler.

gdb also has a DLL "dll-symbols" load command. Maybe your debugger has something likewise. Using it at the first "int3" allows further breaks with mouse-set breakpoints.

"5. Debugging DLL with gdb"
http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/
« Last Edit: December 08, 2008, 03:41:05 pm by Pecan »

Offline wenxibo

  • Single posting newcomer
  • *
  • Posts: 5
Re: Anyone success debug dll by cdb.exe ???
« Reply #2 on: December 08, 2008, 05:05:26 pm »
I have the same problem with gdb.

Placing "asm("int3"); /*trap*/" (for gcc++) statements in the code solved my problem. You'll have to use the correct flavor of "int3" for your compiler.

gdb also has a DLL "dll-symbols" load command. Maybe your debugger has something likewise. Using it at the first "int3" allows further breaks with mouse-set breakpoints.

"5. Debugging DLL with gdb"
http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/


thank you for suggestion.

I tested the asm{int3} but no effect with cdb.exe .
My dll built with MS cl.exe and link.exe, did it can be debug with gdb.exe ?

I can debug my dll file with windbg.exe successfully , so I think my symbol file is correct.

Offline wenxibo

  • Single posting newcomer
  • *
  • Posts: 5
Re: Anyone success debug dll by cdb.exe ???
« Reply #3 on: December 08, 2008, 05:14:49 pm »
And I don't know how to input the console command for cdb (and for gdb.exe)
codeblocks wrap the command for debugger, is there anyway for input command directly?