[Bug debug/59105] New: -fdebug-prefix-map doesn't affect DW_AT_comp_dir.
pluto at agmk dot net
gcc-bugzilla@gcc.gnu.org
Wed Nov 13 08:12:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59105
Bug ID: 59105
Summary: -fdebug-prefix-map doesn't affect DW_AT_comp_dir.
Product: gcc
Version: 4.8.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: debug
Assignee: unassigned at gcc dot gnu.org
Reporter: pluto at agmk dot net
Created attachment 31203
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31203&action=edit
testcase
hi,
i'm trying to use -fdebug-prefix-map to reuse (ccache) compilation units
across multiple software branches. the first problem was reported as PR58767
and the second one is here.
the gcc hardcodes DW_AT_comp_dir when -fdebug-prefix-map is in use and prevents
ccache from computing identical checksum/manifest. imo -fdebug-prefix-map
should adjust DW_AT_comp_dir in the same way as source name (DW_AT_name).
$ ./bug.sh
+ rm -f '*.o'
+ CXXFLAGS='-Wall -gno-record-gcc-switches -g2 -gdwarf-4 -c'
+ cd repo/branch
+ readlink -m t.cpp
+ src=/home/users/pawels/bugs/gcc-bug/repo/branch/t.cpp
+ dirname /home/users/pawels/bugs/gcc-bug/repo/branch/t.cpp
+ g++ -Wall -gno-record-gcc-switches -g2 -gdwarf-4 -c
/home/users/pawels/bugs/gcc-bug/repo/branch/t.cpp
'-fdebug-prefix-map=/home/users/pawels/bugs/gcc-bug/repo/branch/='
+ objdump -g t.o
+ grep -E DW_AT_name.+cpp
<11> DW_AT_name : (indirect string, offset: 0x0): t.cpp
+ objdump -g t.o
+ grep -E DW_AT_comp_dir.+string
<15> DW_AT_comp_dir : (indirect string, offset: 0x14c):
/home/users/pawels/bugs/gcc-bug/repo/branch
+ cd ../..
More information about the Gcc-bugs
mailing list