So the issue is: if there is a .gnu_debugaltlink GDB will try to load
that file and throw an error if it can't. That path is absolute and GDB
does _not_ look for that path/file anywhere else, not even inside
'debug-file-directory'.

GDB seems to only look at section .gnu_debugaltlink in debug/.build-
id/nn/nnnnnn.debug, it does not seem to use that section from the binary
at all.

Due to that, another workaround is to modify that section to point to
the 'right' place:

1) use objcopy to dump .gnu_debugaltlink from debug/.build-id/nn/nnnnnn.debug 
into a file
2) use sed to modify the path in the dump file
3) use objcopy to update .gnu_debugaltlink section in 
debug/.build-id/nn/nnnnnn.debug

As in:
$ objcopy --dump-section .gnu_debugaltlink=altlink 
/tmp/dbgsym/usr/lib/debug/.build-id/76/e9f820204912084fd156c593b2c92f1a4b51f1.debug
$ sed -i 's:^:/tmp/dbgsym:' altlink
$ objcopy --update-section .gnu_debugaltlink=altlink 
/tmp/dbgsym/usr/lib/debug/.build-id/76/e9f820204912084fd156c593b2c92f1a4b51f1.debug

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1818918

Title:
  gdb doesn't search in debug-file-directory for .gnu_debugaltlink

To manage notifications about this bug go to:
https://bugs.launchpad.net/apport/+bug/1818918/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to