From: Efraim Flashner <efraim@flashner.co.il>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 61486@debbugs.gnu.org
Subject: [bug#61486] [PATCH] system: Update skeleton gdbinit.
Date: Tue, 28 Feb 2023 09:53:57 +0200 [thread overview]
Message-ID: <Y/2zFSQ810ziXDMg@3900XT> (raw)
In-Reply-To: <87o7peg2kg.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2201 bytes --]
On Mon, Feb 27, 2023 at 11:34:39PM +0100, Ludovic Courtès wrote:
> Hi Efraim,
>
> Efraim Flashner <efraim@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@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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-02-28 7:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-13 19:00 [bug#61486] [PATCH] system: Update skeleton gdbinit Efraim Flashner
2023-02-27 22:34 ` Ludovic Courtès
2023-02-28 7:53 ` Efraim Flashner [this message]
2023-03-03 10:46 ` Ludovic Courtès
2023-03-01 6:43 ` Efraim Flashner
2023-03-03 10:46 ` Ludovic Courtès
2023-03-07 14:35 ` bug#61486: " Efraim Flashner
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=Y/2zFSQ810ziXDMg@3900XT \
--to=efraim@flashner.co.il \
--cc=61486@debbugs.gnu.org \
--cc=ludo@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 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).