Debug Symbols: Difference between revisions
imported>Symphorien →Unstripped packages: mention the difference between dontStrip and enableDebugging |
m Add category nixpkgs |
||
| (4 intermediate revisions by 3 users not shown) | |||
| Line 126: | Line 126: | ||
==== NixOS ==== | ==== NixOS ==== | ||
By toggling <code>environment.enableDebugInfo</code> to 'true' in <code>/etc/nixos/configuration.nix</code>, all | By toggling <code>environment.enableDebugInfo</code> to 'true' in <code>/etc/nixos/configuration.nix</code>, all separate debug info derivations in your <code>systemPackages</code> will have their debug output linked in <code>/run/current-system/sw/lib/debug/</code> and will be automatically available to gdb. Though note that this will not pick up debug symbols of dependencies – you will need to add the dependencies you want to debug to <code>environment.systemPackages</code> explicitly. If a derivation you are interested in does not have separate debug info enabled, you still have to override it with an overlay for example. | ||
separate debug info derivations in your <code>systemPackages</code> will have their debug output linked in <code>/run/current-system/sw/lib/debug/</code> and | |||
will be automatically available to gdb. If a derivation you are interested in does not have separate debug info enabled, you | ==== dwarffs ==== | ||
still have to override it with an overlay for example. | To avoid the need to explicitly list every dependency in <code>environment.systemPackages</code> to have its debug output available, you can use [https://github.com/edolstra/dwarffs dwarffs]. It will create a virtual file system where gdb will be able to look for separate debug symbols for packages on-demand. The downside is that it might increase gdb start up time significantly. | ||
==== nixseparatedebuginfo ==== | |||
[https://github.com/symphorien/nixseparatedebuginfod nixseparatedebuginfod] is a debuginfod server that can download the relevant debug outputs and source files as needed by debuginfod-capable tools. Compared to dwarffs, it does not require root access, and handles debug outputs of derivations not built by hydra (eg locally or on a custom binary cache) and source files. Gdb is built with support for debuginfod, and valgrind has support if you additionally install the bin output of elfutils. | |||
[[Category:Nixpkgs]] | |||