Adding debug symbols to package from nixpkgs

Unless you want to run a debug build of the library, you probably just want debug information, which can be enabled using separateDebugInfo, which is described in the manual:

https://nixos.org/manual/nixpkgs/stable/#ssec-fixup-phase

Unfortunately, this is only enabled for a small number of derivations in nixpkgs (e.g. glibc), so for all other packages this means that you have to rebuild them. IIRC the main concern for enabling separate debug info for all packages was the amount of storage required in the binary cache.

There is also a nice FUSE filesystem dwarffs, which will automatically download debug info for the packages for which it is available when using gdb:

2 Likes