https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77985
--- Comment #4 from infinity0 at pwned dot gg --- Thanks for the quick response! What is the reason for "absolute paths are supposed to omit it"? I'm reading the DWARF spec and I can't find a mention of this anywhere. Even if DW_AT_name is absolute, recording DW_AT_comp_dir is still useful because it could be a different path and this would affect the interpretation of -I flags and so on. The reason I found this bug was because I am writing a patch to make GCC produce debugging symbols that are reproducible regardless of the build path. (I will explain it in more detail via mail soon.) This bug does not directly affect that; however it does affect how easy it is to write tests to test my patch. Emitting DW_AT_comp_dir in some cases and not others, also makes it more complex for others to write logic to deal with this attribute. Piggybacking a slightly unrelated issue: I'm noticing that remap_debug_filename does not get applied to DW_AT_name in certain cases. Is this intentional? Hopefully not, since the easiest way I can write my patch is to apply it to DW_AT_name in all cases.