all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: bug-guix@gnu.org
Subject: Re: Debugging information
Date: Tue, 09 Jul 2013 00:28:07 +0200	[thread overview]
Message-ID: <87txk48z60.fsf@gnu.org> (raw)
In-Reply-To: <87mwq3477x.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 04 Jul 2013 00:19:30 +0200")

ludo@gnu.org (Ludovic Courtès) skribis:

> Commit be58d01 in ‘core-updates’ changes ‘gnu-build-system’ such that,
> if a package has a derivation output called “debug”, the ‘strip’ phase
> saves debugging info in separate files there, instead of just losing it
> (info "(gdb) Separate Debug Files").

Commit 91ef73d adds documentation for this, copied below.
While at it, I also documented multiple-output packages.

Comments welcome!

Ludo’.


6.2 Installing Debugging Files
==============================

Program binaries, as produced by the GCC compilers for instance, are
typically written in the ELF format, with a section containing
"debugging information".  Debugging information is what allows the
debugger, GDB, to map binary code to source code; it is required to
debug a compiled program in good conditions.

   The problem with debugging information is that is takes up a fair
amount of disk space.  For example, debugging information for the GNU C
Library weighs in at more than 60 MiB. Thus, as a user, keeping all the
debugging info of all the installed programs is usually not an option.
Yet, space savings should not come at the cost of an impediment to
debugging—especially in the GNU system, which should make it easier for
users to exert their computing freedom (*note GNU Distribution::).

   Thankfully, the GNU Binary Utilities (Binutils) and GDB provide a
mechanism that allows users to get the best of both worlds: debugging
information can be stripped from the binaries and stored in separate
files.  GDB is then able to load debugging information from those files,
when they are available (*note (gdb)Separate Debug Files::).

   The GNU distribution takes advantage of this by storing debugging
information in the ‘lib/debug’ sub-directory of a separate package
output unimaginatively called ‘debug’ (*note Packages with Multiple
Outputs::).  Users can choose to install the ‘debug’ output of a package
when they need it.  For instance, the following command installs the
debugging information for the GNU C Library and for GNU Guile:

     guix package -i glibc:debug -i guile:debug

   GDB must then be told to look for debug files in the user’s profile,
by setting the ‘debug-file-directory’ variable (consider setting it from
the ‘~/.gdbinit’ file, *note (gdb)Startup::):

     (gdb) set debug-file-directory ~/.guix-profile/lib/debug

   From there on, GDB will pick up debugging information from the
‘.debug’ files under ‘~/.guix-profile/lib/debug’.

   The ‘debug’ output mechanism in Guix is implemented by the
‘gnu-build-system’ (*note Defining Packages::).  Currently, it is
opt-in—debugging information is available only for those packages whose
definition explicitly declares a ‘debug’ output.  This may be changed to
opt-out in the future, if our build farm servers can handle the load.
To check whether a package has a ‘debug’ output, use ‘guix package
--list-available’ (*note Invoking guix package::).

      reply	other threads:[~2013-07-08 22:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-03 22:19 Debugging information Ludovic Courtès
2013-07-08 22:28 ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87txk48z60.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=bug-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.