unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw@netris.org>
Cc: 19973@debbugs.gnu.org
Subject: bug#19973: Grafts break debug outputs
Date: Tue, 21 Aug 2018 22:53:57 +0200	[thread overview]
Message-ID: <87pnybmoey.fsf@gnu.org> (raw)
In-Reply-To: <87a88wrbvk.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 07 Mar 2017 22:54:39 +0100")

Hello!

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

> However, one very likely problem is that .debug files include a CRC of
> the binary they correspond to (info "(gdb) Separate Debug Files"), and
> that CRC is not updated when we graft things.
>
> We could change our grafting code to specifically address this problem
> (using (guix elf) & co.).

The patches below address this by adding code to update the CRC in the
‘.gnu_debuglink’ section upon grafting.  It uses a simple hook
mechanism, a simplified version of what Timothy proposed.

The ‘.gnu_debuglink’ hook does nothing for packages that lack a “debug”
output.  For packages that have a “debug” output, only ELF files from
bin/, lib/, etc. are considered.  Overall the run-time cost should be
low.

I tested it with guile-ssh on current master (commit
bab4dc58f7278e481c7eb8c6f954d6f1751deb23).  When running:

  guix build guile-ssh

you see messages like this:

  updating '.gnu_debuglink' CRC in '/gnu/store/523lgdnmr4x0q7cnn8wr7f2zzcnlvrpp-guile-ssh-0.11.3/lib/guile/2.2/site-ccache/ssh/tunnel.go'
  updating '.gnu_debuglink' CRC in '/gnu/store/523lgdnmr4x0q7cnn8wr7f2zzcnlvrpp-guile-ssh-0.11.3/lib/guile/2.2/site-ccache/ssh/version.go'
  updating '.gnu_debuglink' CRC in '/gnu/store/523lgdnmr4x0q7cnn8wr7f2zzcnlvrpp-guile-ssh-0.11.3/lib/libguile-ssh.so.11.0.0'

The thing about .go files isn’t very useful (the ‘strip’ phase should
ignore them in the first place probably).  However I’ve confirmed that
gdb is happy with the grafted libguile-ssh.so: if you add breakpoints
with “rb guile_ssh” and then call one of the guile-ssh procedures from
the REPL, you see that you get proper debugging info and all (don’t
forget to “set debug-file-directory” upfront.)

That’s it!  It’s a relief to fix a 3-year old bug.  :-)

Next we can fix build IDs similarly (see <https://bugs.gnu.org/25752>),
and maybe the Racket CRC issue that Timothy and Chris looked at
recently, and maybe the Java manifest issue as well (is it still
relevant?).

Thanks,
Ludo’.

  parent reply	other threads:[~2018-08-21 20:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-01  5:06 bug#19973: Grafts break debug outputs Mark H Weaver
2015-03-01  5:24 ` Mark H Weaver
2017-03-07 21:54 ` Ludovic Courtès
2017-03-10 13:14   ` Ludovic Courtès
2018-08-21 20:53   ` Ludovic Courtès [this message]
2018-08-21 20:56     ` bug#19973: [PATCH 1/2] grafts: Add high-level 'graft' procedure on the build side Ludovic Courtès
2018-08-21 20:56       ` bug#19973: [PATCH 2/2] grafts: Add (guix build debug-link) and use it Ludovic Courtès
2018-08-22 14:04     ` bug#19973: Grafts break debug outputs Timothy Sample
2018-08-23 15:47       ` Ludovic Courtès
2018-08-24 16:08     ` Ludovic Courtès

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87pnybmoey.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=19973@debbugs.gnu.org \
    --cc=mhw@netris.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).