I am trying to configure Code::Blocks for one of our projects. We use a xscale processor running a linux operating system and the application is compiled on a Windows client with a cross-compiler for that target (with MinGW). The application is to be debugged with a connection to gdbserver running on target. Compilation all goes well and debugging it manually via gdb/gdbserver works perfectly. Unfortunately, the Code::Blocks environment messes up the paths which make setting breakpoints fail.
What I understand so far is that Code::Blocks passes the absolute path of a source file to the compiler. In my case this means that the file D:\CB_TEST\HelloCPP\main.cpp is send to the compiler. This is also put in the debug information.
If in gdb the information about the source files is requested then it will return the following:
> info sources
Source files for which symbols have been read in:
Source files for which symbols will be read in on demand:
/root/new-build-final/src/gcc-4.2.1/gcc/config/arm/ieee754-df.S, /root/new-build-final/src/gcc-4.2.1/gcc/config/arm/lib1funcs.asm, D:/armeb-linux-uclibc/lib/gcc/armeb-linux-uclibc/4.2.1/../../../../armeb-linux-uclibc/include/c++/4.2.1/iostream, D:/armeb-linux-uclibc/lib/gcc/armeb-linux-uclibc/4.2.1/../../../../armeb-linux-uclibc/include/c++/4.2.1/bits/locale_facets.tcc, D:/armeb-linux-uclibc/lib/gcc/armeb-linux-uclibc/4.2.1/../../../../armeb-linux-uclibc/include/c++/4.2.1/bits/stl_algobase.h, D:\CB_TEST\HelloCPP\main.cpp
Adding a breakpoint will therefore have to be done with:
> break D:\CB_TEST\HelloCPP\main.cpp:7
Breakpoint 1 at 0x839c: file D:\CB_TEST\HelloCPP\main.cpp, line 7.
However, the absolute path that is used by the Code::Blocks debugger uses the "linux notation", which makes the operation fail:
> break D:/CB_TEST/HelloCPP/main.cpp:7
No source file named D:/CB_TEST/HelloCPP/main.cpp.
I can't figure out a way to fix this myself, so I would like to advise that the debugger is changed and uses either:
1) the exact same absolute path that is send to the compiler,
2) the absolute paths obtained with 'info sources'.
Or can someone tell me what I did wrong?