Subject: bug#19973: closed (Re: bug#19973: Grafts break debug outputs)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 24 Aug 2018 16:09:02 +0000

Your bug report

#19973: Grafts break debug outputs

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
19973: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19973
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#19973: Grafts break debug outputs
From: [email-masked] (Ludovic Courtès)
To: Mark H Weaver <[email-masked]>
Cc: Timothy Sample <[email-masked]>, [email-masked]
Date: Fri, 24 Aug 2018 18:08:38 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

[email-masked] (Ludovic Courtès) skribis:

> 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 went ahead and pushed these two patches as
93c333895a4e2dc9baabec8ade60d9d2ac0a91e2 and
e4297aa8b95cefa32e2595ce58886fc03b0561f7.

I modified tests/debug-link.scm compared to what I posted such that it
would skip tests that require %bootstrap-gcc when networking is lacking.

Thanks for your feedback,
Ludo’.

Subject: Grafts break debug outputs
From: Mark H Weaver <[email-masked]>
To: [email-masked]
Date: Sun, 01 Mar 2015 00:06:11 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Grafts break debug outputs, or at least that's my guess.
Here's what I see:

mhw@jojen:~$ guix build guile
guix build: warning: ambiguous package specification `guile'
guix build: warning: choosing guile-2.0.11 from gnu/packages/guile.scm:110:2
/gnu/store/3lhr8q28q6f59774di9av7ncy09jd55d-guile-2.0.11
/gnu/store/rgv3fvy6xqp6966rfh8v6fv7m48abcbh-guile-2.0.11-debug
mhw@jojen:~$ guix package -I guile
guile	2.0.11	out	/gnu/store/3lhr8q28q6f59774di9av7ncy09jd55d-guile-2.0.11
guile	2.0.11	debug	/gnu/store/rgv3fvy6xqp6966rfh8v6fv7m48abcbh-guile-2.0.11-debug
mhw@jojen:~$ ls -l .guix-profile/lib/debug/gnu/store/
total 8
lrwxrwxrwx 12 root guixbuild 128 Dec 31  1969 122jv790mv2mlnylbrbzav65vghbw93n-guile-2.0.11 -> /gnu/store/rgv3fvy6xqp6966rfh8v6fv7m48abcbh-guile-2.0.11-debug/lib/debug/gnu/store/122jv790mv2mlnylbrbzav65vghbw93n-guile-2.0.11
lrwxrwxrwx 15 root guixbuild 127 Dec 31  1969 3g20rdmnavpblsmgppyl8jhg67nidhjk-glibc-2.20 -> /gnu/store/hrny2whqg9c3m0klyfpbmmcyiir9yf8m-gcc-toolchain-4.9.2/lib/debug/gnu/store/3g20rdmnavpblsmgppyl8jhg67nidhjk-glibc-2.20

I guess GDB can't find the debugging information because
122jv790mv2mlnylbrbzav65vghbw93n-guile-2.0.11 is the name of the guile
directory *before* grafting.

To work around this, I created my own ~/mydebug directory:

mhw@jojen:~/mydebug/gnu/store$ ln -s /gnu/store/rgv3fvy6xqp6966rfh8v6fv7m48abcbh-guile-2.0.11-debug/lib/debug/gnu/store/122jv790mv2mlnylbrbzav65vghbw93n-guile-2.0.11 3lhr8q28q6f59774di9av7ncy09jd55d-guile-2.0.11

and then pointed GDB at ~/mydebug and then debugging works again.

      Mark