views:

537

answers:

1

hello.

i am just wondering if i can tell gcc to embed the absolute path to a source file in the debug information, even if i call gcc like

gcc -g ../src/somecode.c -o ../bin/somecode.o

as i see it atm, gcc just stores what you provide, so if you provide a relative path, at the end, gdb only knows the relative path as well.

is there a way to bypass that without using absolute paths while compiling? like: let gcc lookup the complete path?

thanks in advance rTi

A: 

What platform are you building for and what is the native debugging format for that platform? Not that this information will necessarily get you closer to solving your problem, but it may be worth looking at the specification for the debug format to see if what you want to do even makes sense from that perspective.

You are passing the '-g' option to the compiler right.

Rob Jones
thanks a lot for your answer. yes, i am passing -g to gcc :)i want to solve the problem on linux and mac os x. to be honest, i do not know which formats are the default ones. could you recommend one?
rTi