
Automatically download symbols and sources in GDB - schultetwin1
https://sourceware.org/elfutils/Debuginfod.html
======
chakerb
The Nix ecosystem have dwarffs[0]. If you generate debug symbols during the
build ( not enabled by default ) and save it to the "nix cache", you can use
dwarffs to download it.

[0]
[https://github.com/edolstra/dwarffs/blob/master/README.md](https://github.com/edolstra/dwarffs/blob/master/README.md)

------
the_mitsuhiko
I strongly encourage developments like that. It’s a shame that Linux and macOS
didn’t adopt something like Microsoft’s symbol server. This project could
become something like this.

If you have an installation like this you can also plug it into Sentry as
symbol server and it picks it up.

~~~
bmn__
"Good enough" solutions were already in place for many years, that's why a
symbol server was not a matter of urgency. Did you know about the following?

• A package manager can be configured to install the corresponding
debuginfo/debugsource packages, this is literally one menu toggle. It's off by
default to save disk space, as most users don't need them.

• A desktop environment crash handler (e.g. drkonqi) offers to install the
missing debuginfo/debugsource packages and then produces a complete
stacktrace.

• gdb shows the command for installing the missing debuginfo/debugsource
packages it needs.

~~~
schultetwin1
I'm not aware of those solutions. Very cool! Are they specific to one distro
(for example, Fedora)? How do I get gdb to show me the command to installing
missing packages?

One downside to those solutions, they only support debugging on the same
machine running the executable. If I want to debug a crash dump from a machine
different from my own I might not be able to install the packages.

~~~
bmn__
> Are they specific to one distro

no

> How do I get gdb to show me the command

With the "run" command. You get a message "Missing separate debuginfos, use:"
and then debuginfo-install, zypper etc. depending on the distro.

------
saagarjha
Any chance that Linux package managers will integrate this for their -dbg
packages? I’d rather not fiddle with downloading those along with -src,
untarring it, telling GDB where to find the code…

~~~
schultetwin1
This was originally built by RedHat and they are adding support for Fedora's
package manager, which should make debugging in future versions of Fedora an
amazing experience. The ability to debug any application on your machine with
no effort.

Debuginfod does support debian packages as well (integrating with -dbg
pacages), but it does not support src packages. The documentation mentions
that this is tricky.

