I tried the testcase from comment #12 in Focal and Hirsute and it worked
just fine:

$ gdb --ex 'set debug-file-directory /tmp/dbgsym/usr/lib/debug:/usr/lib/debug' 
--ex 'file /bin/cat' --ex 'core-file /tmp/cat.core'
Type "apropos word" to search for commands related to "word".
Reading symbols from /bin/cat...
Reading symbols from 
/tmp/dbgsym/usr/lib/debug/.build-id/b3/57ed53c8c9cb1a312f83b28982304effae0135.debug...
[New LWP 2094475]
Core was generated by `/bin/cat'.
Program terminated with signal SIGTSTP, Stopped (user).
#0  0x00007ffff7eb6142 in __GI___libc_read (fd=fd@entry=0, 
buf=buf@entry=0x7ffff7faa000, nbytes=nbytes@entry=131072) at 
../sysdeps/unix/sysv/linux/read.c:26

# hirsute
$ gdb --ex 'set debug-file-directory /tmp/dbgsym/usr/lib/debug:/usr/lib/debug' 
--ex 'file /bin/cat' --ex 'core-file /tmp/cat.core'
Reading symbols from /bin/cat...
Reading symbols from 
/tmp/dbgsym/usr/lib/debug/.build-id/fb/a7cee6aca864b8f79dfaa8a267855333b445c1.debug...
[New LWP 14651]
Core was generated by `/usr/bin/cat'.
Program terminated with signal SIGTSTP, Stopped (user).
#0  0x00007ffff7edccb2 in __GI___libc_read (fd=fd@entry=0, 
buf=buf@entry=0x7ffff791e000, nbytes=nbytes@entry=131072) at 
../sysdeps/unix/sysv/linux/read.c:26
26      ../sysdeps/unix/sysv/linux/read.c: No such file or directory.


If the dbgsym is installed and I use (with intentional typo):
set debug-file-directory /tmp/dbgsym/usr/lib/debugnot:/usr/lib/debug
it then loads symbols correctly from /usr/lib/debug


Note, this was tested under Focal (host) and Hirsute (lxd container).

-- 
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