GNU bug report logs - #61486
[PATCH] system: Update skeleton gdbinit.

Previous Next

Package: guix-patches;

Reported by: Efraim Flashner <efraim <at> flashner.co.il>

Date: Mon, 13 Feb 2023 19:01:03 UTC

Severity: normal

Tags: patch

Done: Efraim Flashner <efraim <at> flashner.co.il>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61486 in the body.
You can then email your comments to 61486 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#61486; Package guix-patches. (Mon, 13 Feb 2023 19:01:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Efraim Flashner <efraim <at> flashner.co.il>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 13 Feb 2023 19:01:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: guix-patches <at> gnu.org
Cc: Efraim Flashner <efraim <at> flashner.co.il>
Subject: [PATCH] system: Update skeleton gdbinit.
Date: Mon, 13 Feb 2023 21:00:22 +0200
* gnu/system/shadow.scm (default-skeleton): Update gdbinit to also
search for debug packages in guix-home.
(skeleton-directory): Move .gdbinit to .config/gdb/gdbinit.
---
 gnu/system/shadow.scm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index 445a72e2f5..5802c9dfc0 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2013-2020, 2022 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2016 Alex Griffin <a <at> ajgrf.com>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
-;;; Copyright © 2020 Efraim Flashner <efraim <at> flashner.co.il>
+;;; Copyright © 2020, 2023 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -169,7 +169,8 @@ (define (default-skeletons)
 (use-modules (gdb))
 (execute (string-append \"set debug-file-directory \"
                         (or (getenv \"GDB_DEBUG_FILE_DIRECTORY\")
-                            \"~/.guix-profile/lib/debug\")))
+                            \"~/.guix-profile/lib/debug\"
+                            \"~/.guix-home/profile/lib/debug\")))
 end
 
 # Authorize extensions found in the store, such as the
@@ -228,6 +229,9 @@ (define (skeleton-directory skeletons)
                        (when (file-exists? ".nanorc")
                          (mkdir-p ".config/nano")
                          (rename-file ".nanorc" ".config/nano/nanorc"))
+                       (when (file-exists? ".gdbinit")
+                         (mkdir-p ".config/gdb")
+                         (rename-file ".gdbinit" ".config/gdb/gdbinit"))
                        #t))))
 
 (define (find-duplicates list)

base-commit: dd724cfad45d76b9dcc5b073876c995715c92a07
-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





Information forwarded to guix-patches <at> gnu.org:
bug#61486; Package guix-patches. (Mon, 27 Feb 2023 22:35:01 GMT) Full text and rfc822 format available.

Message #8 received at 61486 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: 61486 <at> debbugs.gnu.org
Subject: Re: bug#61486: [PATCH] system: Update skeleton gdbinit.
Date: Mon, 27 Feb 2023 23:34:39 +0100
Hi Efraim,

Efraim Flashner <efraim <at> flashner.co.il> skribis:

> * gnu/system/shadow.scm (default-skeleton): Update gdbinit to also
> search for debug packages in guix-home.
> (skeleton-directory): Move .gdbinit to .config/gdb/gdbinit.

[...]

>  (use-modules (gdb))
>  (execute (string-append \"set debug-file-directory \"
>                          (or (getenv \"GDB_DEBUG_FILE_DIRECTORY\")
> -                            \"~/.guix-profile/lib/debug\")))
> +                            \"~/.guix-profile/lib/debug\"
> +                            \"~/.guix-home/profile/lib/debug\")))

This won’t have the desired effect:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (or #f "a" "b")
$10 = "a"
--8<---------------cut here---------------end--------------->8---

Perhaps we should check with ‘file-exists?’ which one to pick, probably
giving higher precedence to ~/.guix-home/profile since Guix Home users
might have both (I do).

> +                       (when (file-exists? ".gdbinit")
> +                         (mkdir-p ".config/gdb")
> +                         (rename-file ".gdbinit" ".config/gdb/gdbinit"))

I couldn’t believe it so I had to check the manual and yes, GDB does
look for ~/.config/gdb/gdbinit!  Incredible.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#61486; Package guix-patches. (Tue, 28 Feb 2023 07:55:01 GMT) Full text and rfc822 format available.

Message #11 received at 61486 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 61486 <at> debbugs.gnu.org
Subject: Re: bug#61486: [PATCH] system: Update skeleton gdbinit.
Date: Tue, 28 Feb 2023 09:53:57 +0200
[Message part 1 (text/plain, inline)]
On Mon, Feb 27, 2023 at 11:34:39PM +0100, Ludovic Courtès wrote:
> Hi Efraim,
> 
> Efraim Flashner <efraim <at> flashner.co.il> skribis:
> 
> > * gnu/system/shadow.scm (default-skeleton): Update gdbinit to also
> > search for debug packages in guix-home.
> > (skeleton-directory): Move .gdbinit to .config/gdb/gdbinit.
> 
> [...]
> 
> >  (use-modules (gdb))
> >  (execute (string-append \"set debug-file-directory \"
> >                          (or (getenv \"GDB_DEBUG_FILE_DIRECTORY\")
> > -                            \"~/.guix-profile/lib/debug\")))
> > +                            \"~/.guix-profile/lib/debug\"
> > +                            \"~/.guix-home/profile/lib/debug\")))
> 
> This won’t have the desired effect:
> 
> --8<---------------cut here---------------start------------->8---
> scheme@(guile-user)> (or #f "a" "b")
> $10 = "a"
> --8<---------------cut here---------------end--------------->8---

Not the first time I've gotten that wrong :)

> Perhaps we should check with ‘file-exists?’ which one to pick, probably
> giving higher precedence to ~/.guix-home/profile since Guix Home users
> might have both (I do).

So then how about something like this?

  (or (getenv \"GDB_DEBUG_FILE_DIRECTORY\")
      (if (file-exists? \"~/.guix-home/profile/lib/debug\")
        \"~/.guix-home/profile/lib/debug\"
        \"~/.guix-profile/lib/debug\"))))

Actually, I just checked the GDB manual¹ and it looks like we can add
multiple paths. I'll work on it a bit and see about adding a couple more
paths.

> > +                       (when (file-exists? ".gdbinit")
> > +                         (mkdir-p ".config/gdb")
> > +                         (rename-file ".gdbinit" ".config/gdb/gdbinit"))
> 
> I couldn’t believe it so I had to check the manual and yes, GDB does
> look for ~/.config/gdb/gdbinit!  Incredible.
> 
> Thanks,
> Ludo’.

¹ https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#61486; Package guix-patches. (Wed, 01 Mar 2023 06:44:02 GMT) Full text and rfc822 format available.

Message #14 received at 61486 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 61486 <at> debbugs.gnu.org
Subject: Re: bug#61486: [PATCH] system: Update skeleton gdbinit.
Date: Wed, 1 Mar 2023 08:43:09 +0200
[Message part 1 (text/plain, inline)]
On Mon, Feb 27, 2023 at 11:34:39PM +0100, Ludovic Courtès wrote:
> Hi Efraim,
> 
> Efraim Flashner <efraim <at> flashner.co.il> skribis:
> 
> > * gnu/system/shadow.scm (default-skeleton): Update gdbinit to also
> > search for debug packages in guix-home.
> > (skeleton-directory): Move .gdbinit to .config/gdb/gdbinit.
> 
> [...]
> 
> >  (use-modules (gdb))
> >  (execute (string-append \"set debug-file-directory \"
> >                          (or (getenv \"GDB_DEBUG_FILE_DIRECTORY\")
> > -                            \"~/.guix-profile/lib/debug\")))
> > +                            \"~/.guix-profile/lib/debug\"
> > +                            \"~/.guix-home/profile/lib/debug\")))
> 
> This won’t have the desired effect:
> 
> --8<---------------cut here---------------start------------->8---
> scheme@(guile-user)> (or #f "a" "b")
> $10 = "a"
> --8<---------------cut here---------------end--------------->8---
> 
> Perhaps we should check with ‘file-exists?’ which one to pick, probably
> giving higher precedence to ~/.guix-home/profile since Guix Home users
> might have both (I do).
> 
> > +                       (when (file-exists? ".gdbinit")
> > +                         (mkdir-p ".config/gdb")
> > +                         (rename-file ".gdbinit" ".config/gdb/gdbinit"))
> 
> I couldn’t believe it so I had to check the manual and yes, GDB does
> look for ~/.config/gdb/gdbinit!  Incredible.

Now with a new and improved version 2!

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[v2-0001-system-Update-skeleton-gdbinit.patch (text/plain, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#61486; Package guix-patches. (Fri, 03 Mar 2023 10:47:01 GMT) Full text and rfc822 format available.

Message #17 received at 61486 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: 61486 <at> debbugs.gnu.org
Subject: Re: bug#61486: [PATCH] system: Update skeleton gdbinit.
Date: Fri, 03 Mar 2023 11:46:06 +0100
Hello!

Efraim Flashner <efraim <at> flashner.co.il> skribis:

> So then how about something like this?
>
>   (or (getenv \"GDB_DEBUG_FILE_DIRECTORY\")
>       (if (file-exists? \"~/.guix-home/profile/lib/debug\")
>         \"~/.guix-home/profile/lib/debug\"
>         \"~/.guix-profile/lib/debug\"))))
>
> Actually, I just checked the GDB manual¹ and it looks like we can add
> multiple paths. I'll work on it a bit and see about adding a couple more
> paths.

Oh right, we could have those two directories, colon-separated.

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#61486; Package guix-patches. (Fri, 03 Mar 2023 10:47:02 GMT) Full text and rfc822 format available.

Message #20 received at 61486 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: 61486 <at> debbugs.gnu.org
Subject: Re: bug#61486: [PATCH] system: Update skeleton gdbinit.
Date: Fri, 03 Mar 2023 11:46:41 +0100
Efraim Flashner <efraim <at> flashner.co.il> skribis:

> From 721637d9afd62e70f0a4350fb38c2569fe23e80b Mon Sep 17 00:00:00 2001
> Message-Id: <721637d9afd62e70f0a4350fb38c2569fe23e80b.1677652927.git.efraim <at> flashner.co.il>
> From: Efraim Flashner <efraim <at> flashner.co.il>
> Date: Mon, 13 Feb 2023 20:56:54 +0200
> Subject: [PATCH v2] system: Update skeleton gdbinit.
>
> * gnu/system/shadow.scm (default-skeleton): Update gdbinit to search for
> more debug packages in guix-home and the system profile.
> (skeleton-directory): Move .gdbinit to .config/gdb/gdbinit.

LGTM, thanks!




Reply sent to Efraim Flashner <efraim <at> flashner.co.il>:
You have taken responsibility. (Tue, 07 Mar 2023 14:37:02 GMT) Full text and rfc822 format available.

Notification sent to Efraim Flashner <efraim <at> flashner.co.il>:
bug acknowledged by developer. (Tue, 07 Mar 2023 14:37:02 GMT) Full text and rfc822 format available.

Message #25 received at 61486-done <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 61486-done <at> debbugs.gnu.org
Subject: Re: bug#61486: [PATCH] system: Update skeleton gdbinit.
Date: Tue, 7 Mar 2023 16:35:59 +0200
[Message part 1 (text/plain, inline)]
On Fri, Mar 03, 2023 at 11:46:41AM +0100, Ludovic Courtès wrote:
> Efraim Flashner <efraim <at> flashner.co.il> skribis:
> 
> > From 721637d9afd62e70f0a4350fb38c2569fe23e80b Mon Sep 17 00:00:00 2001
> > Message-Id: <721637d9afd62e70f0a4350fb38c2569fe23e80b.1677652927.git.efraim <at> flashner.co.il>
> > From: Efraim Flashner <efraim <at> flashner.co.il>
> > Date: Mon, 13 Feb 2023 20:56:54 +0200
> > Subject: [PATCH v2] system: Update skeleton gdbinit.
> >
> > * gnu/system/shadow.scm (default-skeleton): Update gdbinit to search for
> > more debug packages in guix-home and the system profile.
> > (skeleton-directory): Move .gdbinit to .config/gdb/gdbinit.
> 
> LGTM, thanks!

Thanks. Patch pushed!

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 05 Apr 2023 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 358 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.