Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jan Vrany via Gdb <gdb@sourceware.org>
To: Brennan Vincent <brennan@umanwizard.com>, gdb@gnu.org
Subject: Re: Set debug-file-directory from environment variable?
Date: Fri, 06 Sep 2024 10:25:06 +0000	[thread overview]
Message-ID: <03314c57ad5784b09e7658a0ff4928f1adf9100a.camel@vrany.io> (raw)
In-Reply-To: <87plpif51o.fsf@taipei.mail-host-address-is-not-set>

Hi, 
On Thu, 2024-09-05 at 12:17 -0400, Brennan Vincent wrote:
> Hello,
> 
> Would folks be okay with a patch to take debug file directories from
> an
> environment variable, e.g. GDB_DEBUG_FILE_PATH ?
> 
> An example of when this is could be useful is for Guix users: the
> variable could be automatically set up when spawning a Guix shell
> that
> contains debug packages.
> 
> But I'm guessing it would be useful in other situations too.
> 
If I understand you correctly, I think you can use Python to 
do it (if your GDB has Python support).

Something like putting following your .gdbinit (or to system-wide
init script):

---8<----
python
import os

path_from_env = os.environ.get('GDB_DEBUG_FILE_PATH')
if path_from_env is not None:
    old = gdb.parameter('debug-file-directory')
    new = old + ":" + path_from_env
    gdb.set_parameter('debug-file-directory', new)

end
---8<----

Jan


      reply	other threads:[~2024-09-06 10:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-05 16:17 Brennan Vincent
2024-09-06 10:25 ` Jan Vrany via Gdb [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=03314c57ad5784b09e7658a0ff4928f1adf9100a.camel@vrany.io \
    --to=gdb@sourceware.org \
    --cc=brennan@umanwizard.com \
    --cc=gdb@gnu.org \
    --cc=jan@vrany.io \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox