2

I'm compiling u-boot using gcc, it generate dwarf info :

...

<74cb> DW_AT_name : (indirect string, offset: 0x1a6a): board.c

<74cf> DW_AT_comp_dir : (indirect string, offset: 0x2689): /root/file/u-boot/u-boot-am33x/arch/arm/lib

...

what option should be add to change DW_AT_name from "board.c" to "/root/file/u-boot/u-boot-am33x/arch/arm/lib/board.c" ? which means DW_AT_name contains full path of the source file?

1 Answers1

0

Not sure why you want to do this. Why would it matter?

Anyway you could try passing an absolute file name to the compiler. That might work.

Tom Tromey
  • 21,507
  • 2
  • 45
  • 63
  • Might be useful to build with absolute path (to get full path for compilation errors), but still have relative path for gdb (when moving the tree, sharing output directory etc.) Is there any way to do it (in a similar way to how "-fdebug-prefix-map" sets DW_AT_comp_dir) ? – Yinon Ehrlich Dec 22 '16 at 14:35