Comment 22 for bug 1818918

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

@tdaitx asked me to take a look at this problem, and here is what I found.

1) As he said above, the problem is that Debian/Ubuntu generate .gnu_debugaltlink sections containing full pathnames to the DWZ alt debug files. IMO, we should be using dwz's "--relative" option when invoking it via dh_dwz. I will send a merge request on Salsa and propose that we adopt this flag as a distro.

2) While we could use the workaround described in the last comment, I think it is better if GDB is adjusted to cope with this scenario (i.e., having a full pathname on .gnu_debugaltlink, but having the actual DWZ file in another directory that is also provided as the debug-file-directory to GDB). I went ahead and submitted a patch to GDB to do just that:

  https://sourceware.org/pipermail/gdb-patches/2020-November/173276.html

I think searching for the DWZ files using the debug-file-directory provided by the user is a sensible approach, and is also something that other projects (namely elfutils) seem to do.

All in all, as I said in (1), I think the best long-term solution is to adjust dh_dwz to put relative pathnames in the .gnu_debugaltlink. Arguably, we could also create a symlink in /usr/lib/debug/.build-id/ and make it point to the corresponding file inside /usr/lib/debug/.dwz/, but that is an orthogonal issue and would not help with this specific bug.