This page is about Debian's debuginfod server.
Contents
Introduction
From the debuginfod is a service that automatically distributes ELF/DWARF/source-code information to debuggers using HTTPS.
A debuginfod service eliminates the need for users to install AutomaticDebugPackages to debug programs: instead a supported debugger (such as gdb or systemtap) will download the debug symbols it needs on demand.
Using debuginfod
The elfutils package creates /etc/profile.d/debuginfod.sh that should make supported debuggers use debuginfod automatically. Supported debuggers include gdb and systemtap.
You can also set the DEBUGINFOD_URLS variable to a debuginfod server directly, but this should not be needed:
export DEBUGINFOD_URLS="https://debuginfod.debian.net"
With gdb
When you open gdb it should ask you if you want to download debug symbols:
$ gdb bash Reading symbols from bash... This GDB supports auto-downloading debuginfo from the following URLs: <https://debuginfod.debian.net> Enable debuginfod for this session? (y or [n]) y Debuginfod has been enabled. To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit. Downloading 1.74 M separate debug info for /usr/bin/bash
FAQs
What tools support debuginfod?
There is an official list in the upstream page. In Debian, GDB, elfutils and binutils all have support for debuginfod since DebianBookworm.
For buster, you might need to resort to Backports. This may work:
# echo 'deb http://deb.debian.org/debian buster-backports main' > /etc/apt/sources.list.d/backports.list # apt update # apt install -t buster-backports debuginfod elfutils
What distributions are supported?
Debian provides debug symbols for all versions (unstable, testing, stable, including both the main and contrib suites).
The service supports both dbgsym and the older -dbg packages.
The plan is to support debuginfo files from the snapshot service as well.
Where does libdebuginfod store the debuginfo that is downloaded?
According to DebianPts:debuginfod_begin's manpage:
DEBUGINFOD_CACHE_PATH
This environment variable governs the location of the
cache where downloaded files are kept. It is cleaned
periodically as this program is reexecuted. If
XDG_CACHE_HOME is set then $XDG_CACHE_HOME/debuginfod_client
is the default location, otherwise $HOME/.cache/debuginfod_client
is used. In other words: if DEBUGINFOD_CACHE_PATH is set, then the files are saved in the directory pointed by it. Otherwise, if XDG_CACHE_HOME is set, then files are saved into $XDG_CACHE_HOME/debuginfod_client. Otherwise, the files will be saved into $HOME/.cache/debuginfod_client.
Can I delete the cache directory?
Yes.
The service isn't working! I can't download the source code while debugging a package!
You've just discovered one of the limitations of Debian's debugging experience. To be clear, this is not related to debuginfod: this happens because Debian doesn't package the patched source tree in a consumable way for debugging tools to use. Even before debuginfod, if you tried to debug a package in Debian you would experience the exact same problems.
A good example of a distribution that gets this right is Fedora: if you look at how they package debug symbols, you will notice that they generate the equivalent of Debian's dbgsym, but also create a "debugsource" RPM package that contains the patched source code that was used to build the package.
Unfortunately, because of this limitation (which exists since we started generating debuginfo packages in Debian), our debuginfod instance isn't able to index and deliver source code over the network.
