* Set debug-file-directory from environment variable?
@ 2024-09-05 16:17 Brennan Vincent
2024-09-06 10:25 ` Jan Vrany via Gdb
0 siblings, 1 reply; 2+ messages in thread
From: Brennan Vincent @ 2024-09-05 16:17 UTC (permalink / raw)
To: gdb
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Set debug-file-directory from environment variable?
2024-09-05 16:17 Set debug-file-directory from environment variable? Brennan Vincent
@ 2024-09-06 10:25 ` Jan Vrany via Gdb
0 siblings, 0 replies; 2+ messages in thread
From: Jan Vrany via Gdb @ 2024-09-06 10:25 UTC (permalink / raw)
To: Brennan Vincent, gdb
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-09-06 10:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-05 16:17 Set debug-file-directory from environment variable? Brennan Vincent
2024-09-06 10:25 ` Jan Vrany via Gdb
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox