Local Build ID Directory Lookup (DEBUGINFOD_LOCAL_PATH)
Frank Ch. Eigler
fche@redhat.com
Wed May 31 22:35:55 GMT 2023
Hi -
> [...]
> It would be really nice if there were, a DEBUGINFOD_LOCAL_PATH environment
> variable that provided a colon-separated list of directories in the GDB
> `.build-id/<xx>/<xxxxxx>` [...]
Please note that $DEBUGINFOD_URLS can already include file:// URLs
that identify local filesystems whose directory structure mirrors the
webapi. The old-school /usr/lib/debug/.build-id/xx/xxxxxxxx.debug
file hierarchy doesn't match that, and of course lacks source code
entirely.
OTOH a shell script that creates debuginfod-style tree of symlinks
into the old-school hierarchy - for debuginfo/executables only - could
work, and work with current day unmodified debuginfod clients &
servers. i.e.,:
find /usr/lib/debug/.build-id -name '*.debug' | while read g; do
buildid=`echo $g | cut -f6,7 -d/ | tr -d / | cut -f1 -d.`
mkdir -p buildid/$buildid
ln -s $g buildid/$buildid/debuginfo
done
and similar for .../executable
Then the resulting tree is suitable for use as DEBUGINFOD_URLS=file://`pwd`
to a debuginfod server or a client.
- FChE
More information about the Elfutils-devel
mailing list