Code::Blocks Forums
User forums => Embedded development => Topic started by: pooh on August 17, 2011, 09:34:07 pm
-
I would like to run the microblaze toolchain from Xilinx under C::B. (10.05)
Setting up the compiler is easy: Define a new compiler, make the executables known to C::B. Done.
In order to test programs I have created a simulator which connects to the debugger via a remote stub.
Apparently there seems to be a problem regarding absolute and relative pathes used by the toolchain.
Here is what i get when setting a breakpoint in C::B (i.e. in the editor):
> break "E:/hello-mb/main.c:4"
No source file named E:/hello-mb/main.c.
Breakpoint 1 ("E:/hello-mb/main.c:4) pending.
When setting a breakpoint by hand via Debug->Send user command...
> break "main.c:5"
Breakpoint 2 at 0x1f0: file main.c, line 5.
Right, I have used a relative path in the 2nd case - which works fine...
But why doesn't it work with C::B??
I have tried different compilers (MinGW GCC as well as AVR GCC).
They seem to do similar things: The Compiler Command looks similar (i.e. no absolute path used), while the debugger gets fed with an absolute path. And it works. :shock:
My assumption is that gcc puts a relative path into the executable while gdb works with an absolute path.
(No idea why this works for the other compilers)
Is there any chance to configure gcc (i.e. the C::B call to gcc) to use an absolute path or gdb to use a relative one?
Or am I on the wrong track??
Any hints, help, suggestions are welcome!
THX
-
The normal GCC uses absolute paths, and breaks when something (wxwidgets for example) is compiled with relative.
The problem could be solved fully only in GDB, but it isn't :(
I think there is an option in the advanced compiler options to make it use relative or absolute paths.
-
Many thanks for the fast response.
This solves the problem (- somehow)
I changed the compiler command from
$compiler $options $includes -c $file -o $object
into
$compiler $options $includes -c e:/my_projects/hello/$file -o $object
This works!
Unfortunately this is not very elegant as I need to change the setting for each new project I would like to compile.
Isn't there a macro like "$projectpath" that contains the path to the project??
I haven't seen such a macro neither in the macro list (under advanced settings) nor in the C::B docu. :(
Are there other options to use an absolute path for the compiler?
THX
-
Finally, I have found the "hidden" check box:
Settings->Compiler and Debugger->Other settings->Advanced Options->Others->Use Full Paths for source files (GDB workaround) :D