views:

353

answers:

2

I've been using Code::Blocks with MinGW on a WinXP box for a while now. But since I started using Boost.Build as "custom build tool" I'm having trouble setting break points from Code::Blocks. When I start a debugging session Code::Blocks tries to send all break points to GDB but GDB doesn't seem to recognise the sources' filenames:

Debugger name and version: GNU gdb 6.6
No source file named C:/xxx/CB-Workspace/altomo/src/main.cpp.
Breakpoint 1 ("C:/xxx/CB-Workspace/altomo/src/main.cpp:185) pending.

(The xxx is only an abreviation)

To see what's going on I started GDB manually and tried to set a breakpoint:

(gdb) break main.cpp:181
Breakpoint 1 at 0x40231e: file src/main.cpp, line 181.
(gdb) break src/main.cpp:182
Breakpoint 2 at 0x402331: file src/main.cpp, line 182.
(gdb) break "C:/xxx/CB-Workspace/altomo/src/main.cpp:185"
Breakpoint 3 at 0x402513: file src/main.cpp, line 185.

All seems okay. I also veryfied that in all the *.o files the full path was present.

The weird thing is that debugging used to work before I switched to Boost.Build. So, I don't really know where to look. Who's to blame? Me, Boost.Build, Code::Blocks, or GDB? Did I miss some obvious compiler options or CB project settings w.r.t. search paths or something?

I would like to keep using Boost.Build as build tool and Code::Blocks for editing and as GDB front-end. Any help to solve this problem is appreciated.

A: 

Try this:

(gdb) break main.cpp:185

If GDB doesn't know main.cpp either, then Boost.Build is not building a debug version.
Chances are Boost.Build is not using absolute pathnames when it compiles the source.

Employed Russian
A manual `break main.cpp:185` works just as well as `break main.cpp:181` which is what I tried already (see above).
sellibitze
+1  A: 

I enabled Code::Block's Debugging log to see what commands are passed to GDB and it seems the problem is with Code::Blocks. It sends a

directory C:/XXX~1/CB-WOR~1/altomo

command to GDB which is the "DOS-mangled" directory name. GDB doesn't like that. So, it looks like a bug in Code::Blocks to me.

sellibitze