Hi,
I haven't been able to successfully use the GDB integration. The main issue seems to be that CodeBlocks is sending a relative path for a source file, which GDB doesn't accept.
I have a workspace with multiple projects in separate directories. If I hit F8 and click in some source to add a breakpoint, cb_gdb sends a command which GDB doesn't like:
>>>>>>cb_gdb:
> break "../Atlas/Exception.cpp:61"
No source file named ../Atlas/Exception.cpp.
Breakpoint 1 ("../Atlas/Exception.cpp:61) pending.
>>>>>>cb_gdb:
GDB does seem to like just a base filename (which it finds in the source directory serarch paths), or an absolute path to a file. It only chokes on the relative paths.
By the way, I also tried setting breakpoints by hand, and although GDB stops on them, CB_GDB immediately issues a "cont" command so I can't inspect anything :(
I'm running on Ubuntu Edgy, and I've tried the last three or four nightly builds with Edgy packages. I've also tried both the stock GDB unbuntu package (6.4.90-ubuntu) and compiling GDB from the 6.6 source.
TIA for your help, and thanks much for creating a great IDE!
- AC
This is a known issue and is currently being investigated. For a quick (better) solution (and in case you compile C::B yourself) you may want to comment the following lines in debuggerstate.cpp:
else
{
// for foreign files, we still should use a relative path
wxFileName f(filename);
f.MakeRelativeTo(prj->GetBasePath());
fname = f.GetFullPath();
}
This isn't complete - there are still cases where this doesn't work properly yet...
Yiannis: Do you remember my PM of the other day (back in the old year 2006)...?! ;-)
With regards, Morten.