[Nix-dev] Re: Support for debugging symbols

Ludovic Courtès ludo at gnu.org
Wed Apr 22 16:45:48 CEST 2009


ludo at gnu.org (Ludovic Courtès) writes:

>   1. Build the derivation and install it unstripped.
>
>   2. Create a `-dbg' derivation containing the output of
>      `--only-keep-debug' for that package.
>
>   3. Create a stripped derivation of (1) with a "debuglink" to (2).
>
> However, this approach is pointless since (3) would hold a reference to
> both (1) and (2), thereby occupying as much space as a simple unstripped
> install.

Actually, according to the GDB manual (info "(gdb)Separate Debug
Files"), the debug link doesn't have to be an absolute path name, so we
can avoid the link from (3) to (2):

   * For the "debug link" method, GDB looks up the named file in the
     directory of the executable file, then in a subdirectory of that
     directory named `.debug', and finally under the global debug
     directory, in a subdirectory whose name is identical to the leading
     directories of the executable's absolute file name.

Nevertheless, the "global debug directory" approach doesn't sound good
to me, as we could end up loading debugging symbols that don't
correspond to the binary.

Hmm, needs more thought.

Ludo'.




More information about the nix-dev mailing list