For now FEATURE=splitdebug creating old style split bin, sbin, usr/bin, usr/sbin in /usr/lib/debug/ tree -d -n /usr/lib/debug/ /usr/lib/debug/ ├── lib64 ├── sbin └── usr ├── bin ├── lib64 └── sbin This confuses tools like gdb/valgrind, etc. For example gdb /usr/[s]bin/squid can't find symbols. I have to copy /usr/lib/debug/usr/sbin/squid.debug into /usr/lib/debug/usr/bin/ Then gdb /usr/[s]bin/squid load debug symbols. Reproducible: Always
This came up on the gdb side at https://sourceware.org/bugzilla/show_bug.cgi?id=24143 too...
Could you consider filing a bug for Valgrind upstream if there isn't one already, and possibly elfutils if it also suffers from the same problem? Thank you.
What if you create the same symlinks beneath /usr/lib/debug as exist within the top level? Then the package manager will install the split debug files in /usr/lib/debug/usr/bin regardless of whether they were split from binaries intending to be installed in /bin, /sbin, /usr/bin, or /usr/sbin, and debug tools should then find them regardless of whether they're implementing the original or patched lookup behavior.
That sounds like a good idea. Could I tempt one of you to have a go at implementing it? I'm swamped at the moment.
Seems to work... $ /sbin/fdisk --version fdisk from util-linux 2.39.2 $ readlink -e /sbin/fdisk /usr/bin/fdisk $ readlink -e /usr/lib/debug/sbin/fdisk.debug /usr/lib/debug/sbin/fdisk.debug $ gdb /sbin/fdisk </dev/null | tail -n3 | head -n2 Reading symbols from /sbin/fdisk... (No debugging symbols found in /sbin/fdisk) $ gdb /usr/bin/fdisk </dev/null | tail -n3 | head -n2 Reading symbols from /usr/bin/fdisk... (No debugging symbols found in /usr/bin/fdisk) # cd /usr/lib/debug # mv --no-clobber {{,s}bin,usr/sbin}/* usr/bin/ # rmdir {,s}bin usr/sbin # for each in {,s}bin usr/sbin ; do ln -rsfnv usr/bin "${each}" ; done 'bin' -> 'usr/bin' 'sbin' -> 'usr/bin' 'usr/sbin' -> 'bin' $ readlink -e /usr/lib/debug/sbin/fdisk.debug /usr/lib/debug/usr/bin/fdisk.debug $ gdb /sbin/fdisk </dev/null | tail -n3 | head -n2 Reading symbols from /sbin/fdisk... Reading symbols from /usr/lib/debug//usr/bin/fdisk.debug... $ gdb /usr/bin/fdisk </dev/null | tail -n3 | head -n2 Reading symbols from /usr/bin/fdisk... Reading symbols from /usr/lib/debug//usr/bin/fdisk.debug...
Created attachment 887847 [details, diff] gdb: Don't use realpath on objfile names This gdb patch still applies cleanly, mentioned in https://sourceware.org/bugzilla/show_bug.cgi?id=24143#c5 and downloaded from https://sourceware.org/pipermail/gdb-patches/2022-April/187545.html.
(In reply to Zac Medico from comment #6) > Created attachment 887847 [details, diff] [details, diff] > gdb: Don't use realpath on objfile names > > This gdb patch still applies cleanly, mentioned in > https://sourceware.org/bugzilla/show_bug.cgi?id=24143#c5 and downloaded from > https://sourceware.org/pipermail/gdb-patches/2022-April/187545.html. I applied this patch to dev-debug/gdb-14.1-r1 and it appears to correctly resolve /usr/lib/debug/sbin/fdisk.debug regardless of how I refer to fdisk: > $ gdb /sbin/fdisk </dev/null | tail -n4 | head -n2 > Reading symbols from /sbin/fdisk... > Reading symbols from /usr/lib/debug/sbin/fdisk.debug... > $ gdb /bin/fdisk </dev/null | tail -n4 | head -n2 > Reading symbols from /bin/fdisk... > Reading symbols from /usr/lib/debug/sbin/fdisk.debug... > $ gdb /usr/bin/fdisk </dev/null | tail -n4 | head -n2 > Reading symbols from /usr/bin/fdisk... > Reading symbols from /usr/lib/debug/sbin/fdisk.debug... > $ gdb /usr/sbin/fdisk </dev/null | tail -n4 | head -n2 > Reading symbols from /usr/sbin/fdisk... > Reading symbols from /usr/lib/debug/sbin/fdisk.debug...
Comment on attachment 887847 [details, diff] gdb: Don't use realpath on objfile names Actually dev-debug/gdb-14.1-r1 without this patch also resolves /usr/lib/debug/sbin/fdisk.debug for me correctly for all the same cases shown in comment #7.
I think I last tried w/ gdb-14.1 (14.2 has very few changes on top) but even that patch didn't seem to help me.. interesting!