Author Topic: How to specify separate debug file to gdb from C::B?  (Read 3701 times)

Offline Greatwolf

  • Multiple posting newcomer
  • *
  • Posts: 48
How to specify separate debug file to gdb from C::B?
« on: December 23, 2009, 05:13:08 am »
I separated the debug symbols from my executable using:

Code
strip --keep-only-debug -o myproj.gdb myproj.exe
strip -s myproj.exe

How do I get C::B to pass the file with debug symbols to gdb before it actually starts debugging my executable? I can do this fine if I was using gdb from the commandline though:

Code
gdb -s myproj.gdb -e myproj.exe

Thanks

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How to specify separate debug file to gdb from C::B?
« Reply #1 on: December 23, 2009, 09:47:35 pm »
Hm, have you tried to place the .gdb file along the .exe file? I think it should be loaded automatically.
Another thing you could do is to find if there is a gdb command you could execute to load the file.

If you have recent C::B there is a entry box for gdb commands in the debug log.
The older versions (8.02) has Debug -> Send Command menu which does the same.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Greatwolf

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: How to specify separate debug file to gdb from C::B?
« Reply #2 on: December 23, 2009, 11:41:34 pm »
The debug file and executable to be debug both reside in the same directory. The loading is automatically only if I made an explicit link within the executable to the debug file -- a step which I skipped. I suppose I could try that but I was hoping there was a way to specify it to gdb from within C::B.

There is a command to tell gdb to load symbols from another file from it's cli: symbol-file filename. The only problem is I can't find a way to get C::B to relay to gdb. The Debug->Send Command is initially greyed out. If I was debugging a console app, for example, starting a debugging session would just run through the executable with no chance to stop for inputting that command for the symbol file.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How to specify separate debug file to gdb from C::B?
« Reply #3 on: December 24, 2009, 12:46:34 am »
It should work if you also run
Code
objcopy --add-gnu-debuglink myproj.gdb myproj.exe

In this case gdb should be able to find the symbols-file automatically.

Only tested on linux, but objcopy also exists in MinGW.