Author Topic: Microblaze GDB Path Issue  (Read 5841 times)

Offline pooh

  • Single posting newcomer
  • *
  • Posts: 6
Microblaze GDB Path Issue
« 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!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12698
    • Travis build status
Re: Microblaze GDB Path Issue
« Reply #1 on: August 17, 2011, 10:53:53 pm »
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.
(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 pooh

  • Single posting newcomer
  • *
  • Posts: 6
Re: Microblaze GDB Path Issue
« Reply #2 on: August 17, 2011, 11:31:49 pm »
Many thanks for the fast response.
This solves the problem (- somehow)

I changed the compiler command from
      $compiler $options $includes -c $file -o $object
      $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?


Offline pooh

  • Single posting newcomer
  • *
  • Posts: 6
Re: Microblaze GDB Path Issue
« Reply #3 on: August 17, 2011, 11:45:25 pm »
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