summaryrefslogtreecommitdiff
path: root/gold/dwp.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2022-04-27 12:47:35 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2022-07-29 20:54:49 -0400
commitee26d001cdf44cff897f994c89ad333bfa66d59e (patch)
treec0825dfef4b22115497f213c4c311c3d560a3f4c /gold/dwp.h
parentf71ad5556cf5ad3bb938d6ba1b5eca1e79d8d740 (diff)
gdb: remove code to prepend comp dir in buildsym_compunit::start_subfile
The bit of code removed by this patch was introduced to fix the same kind of problem that the previous patch fixes. That is, to try to match existing subfiles when different name forms are used to refer to a same file. The thread for the patch that introduced this code is: https://pi.simark.ca/gdb-patches/45F8CBDF.9090501@hq.tensilica.com/ The important bits are that the compiler produced a compilation unit with: DW_AT_name : test.c DW_AT_comp_dir : /home/maxim/W/BadgerPass/PR_14999 and DWARF v2 line table with: The Directory Table: /home/maxim/W/BadgerPass/PR_14999 The File Name Table: Entry Dir Time Size Name 1 1 1173897037 152 test.c Because the main symtab was created with only DW_AT_name, it was named "test.c". And because the path built from the line header contained the "directory" part, it was "/home/maxim/W/BadgerPass/PR_14999/test.c". Because of this mismatch, thing didn't work, so they added this code to prepend the compilation directory to the existing subfile names, so that this specific case would work. With the changes done earlier in this series, where subfiles are identified using the "most complete path possible", this case would be handled. The main subfile's would be "/home/maxim/W/BadgerPass/PR_14999/test.c" from the start (DW_AT_comp_dir + DW_AT_name). It's not so different from some DWARF 5 cases actually, which make the compilation directory explicit in the line table header. I therefore think that this code is no longer needed. It does feel like a quick hack to make one specific case work, and we have a more general solution now. Also, this code was introduced to work around a problem in the DWARF debug info or the DWARF debug info reader. In general, I think it's preferable for these hacks to be located in the specific debug info reader code, rather than in the common code. Even though this code was added to work around a DWARF reader problem, it's possible that some other debug info reader has started taking advantage of this code in the mean time. It's very difficult to know or verify, but I think the likelyhood is quite small, so I'm proposing to get rid of it to simplify things a little bit. Change-Id: I710b8ec0d449d1b110d67ddf9fcbdb2b37108306
Diffstat (limited to 'gold/dwp.h')
0 files changed, 0 insertions, 0 deletions