From Gentoo Wiki
Jump to:navigation Jump to:search

It is possible to use debuginfod to provide debug information to your binary package downstreams, and, consequently, to remove debug information from the binary package, saving disk space and bandwidth.

Server setup

It is sufficient to set the following:

FILE /etc/portage/make.conf

Following that, you can run:

root #debuginfod -F /usr/src/debug /usr/lib/debug

... with your preferred service manager.

This will expose debuginfod on localhost:8002, which you can then expose via a reverse proxy, or any other means.

Note that the server reacts to the DEBUGINFOD_URLS environment variable, and will fall back to the servers listed in it to continue a search for debuginfo. You can use this property to have your server cache results from the federated instance, which lets you also fetch debug info for other distributions. Take care to also clear this variable if you have it set globally outside the debuginfod server.

Client setup

To use the new debuginfod instance, presuming that you exposed it on http://foo.mynet.local/debuginfo, you can create a file akin to the following:

FILE /etc/env.d/99debuginfod

As demonstrated, this variable holds a list of debug info servers. The latter server in that example federates with many other debuginfod servers.

Following an env-update, new sessions should immediately have access to debug information. You will also likely want to adjust your .gdbinit file as such, to avoid gdb nagging about whether to enable debuginfod support.

FILE $XDG_CONFIG_HOME/gdb/.gdbinit
set debuginfod enabled on

TODO (Help is welcome! Reach out on IRC if interested)

  • Teach portage to generate tarballs that contain the /usr/lib/debug and /usr/src/debug hierarchies, and only those hierarchies, and to install them into some location as unowned files. This will allow debuginfod to look for past builds for debug info rather than just the latest ones. This should also allow the user to {,PKG_}INSTALL_MASK the source and debug info files. bug #728818, bug #639376
  • Uncrustify this article