Issue 171130.2: Allow $ORIGIN in DW_AT_comp_dir

Author: Thomas Anderson
Champion: Caroline Tice
Date submitted: 2017-11-30
Date revised:
Date closed: 2021-06-14
Type: Enhancement
Status: Rejected
DWARF Version: 6

Section .debug_abbrev, pg 64

Similar to how $ORIGIN can be used in RPATH to indicate the directory containing the executable, DWARF should allow $ORIGIN in DW_AT_comp_dir.


When compiling with -gsplit-dwarf, DW_AT_comp_dir is an absolute path by default. This means if you move or rename your build directory, DW_AT_comp_dir will be invalid.

This issue can be partially avoided using a relative path, but moving the build directory is still problematic, and this would also cause gdb to fail to find debugging information when it is launched from outside your build directory.

This enhancement is motivated by a Chromium bug, in which developers were getting gdb errors of the form "Could not find DWO CU".

06/14/21 -- Rejected. This appears to be a debugger implementation issue, where the debugger can be told by the user where to find the build directory.