diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-09-17 15:24:32 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-09-17 15:56:33 +0200 |
commit | ec5b66eb4add9d494d8fb16f6899028750d317a2 (patch) | |
tree | 2e973c6d3e89612cfeba5eafac4810dc968bebf9 /doc | |
parent | edee7f172098921f13466bc1d82faee423035700 (diff) | |
download | nixpkgs-ec5b66eb4add9d494d8fb16f6899028750d317a2.tar nixpkgs-ec5b66eb4add9d494d8fb16f6899028750d317a2.tar.gz nixpkgs-ec5b66eb4add9d494d8fb16f6899028750d317a2.tar.bz2 nixpkgs-ec5b66eb4add9d494d8fb16f6899028750d317a2.tar.lz nixpkgs-ec5b66eb4add9d494d8fb16f6899028750d317a2.tar.xz nixpkgs-ec5b66eb4add9d494d8fb16f6899028750d317a2.tar.zst nixpkgs-ec5b66eb4add9d494d8fb16f6899028750d317a2.zip |
Enable separate debug info
You can now pass separateDebugInfo = true; to mkDerivation. This causes debug info to be separated from ELF binaries and stored in the "debug" output. The advantage is that it enables installing lean binaries, while still having the ability to make sense of core dumps, etc.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/stdenv.xml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/stdenv.xml b/doc/stdenv.xml index 1556ffd057f..7ba24db2e05 100644 --- a/doc/stdenv.xml +++ b/doc/stdenv.xml @@ -899,6 +899,34 @@ following: phase.</para></listitem> </varlistentry> + <varlistentry> + <term><varname>separateDebugInfo</varname></term> + <listitem><para>If set to <literal>true</literal>, the standard + environment will enable debug information in C/C++ builds. After + installation, the debug information will be separated from the + executables and stored in the output named + <literal>debug</literal>. (This output is enabled automatically; + you don’t need to set the <varname>outputs</varname> attribute + explicitly.) To be precise, the debug information is stored in + <filename><replaceable>debug</replaceable>/lib/debug/.build-id/<replaceable>XX</replaceable>/<replaceable>YYYY…</replaceable></filename>, + where <replaceable>XXYYYY…</replaceable> is the <replaceable>build + ID</replaceable> of the binary — a SHA-1 hash of the contents of + the binary. Debuggers like GDB use the build ID to look up the + separated debug information.</para> + + <para>For example, with GDB, you can add + +<programlisting> +set debug-file-directory ~/.nix-profile/lib/debug +</programlisting> + + to <filename>~/.gdbinit</filename>. GDB will then be able to find + debug information installed via <literal>nix-env + -i</literal>.</para> + + </listitem> + </varlistentry> + </variablelist> </section> |