From: Jerome Guitton <guitton@adacore.com>
To: gdb@sourceware.org
Subject: global, target-specific, init files
Date: Sun, 14 Dec 2008 12:46:00 -0000 [thread overview]
Message-ID: <20081214124549.GA25544@adacore.com> (raw)
Hello everyone,
I'd like to have your opinion about the utility of a couple of
features that we are considering to implement in AdaCore. This mostly
has to do with improvement to the init file. Here are the two features
that we are missing:
1) target-specific settings: .gdbinit does not make it easy to have
some settings/commands that should be executed for a particular
system/target. Let me give an example to clarify this claim: suppose
that, on a linux host, you build and debug both native applications
and cross applications. Let's say that the cross target is some
real-time flavour of linux. When you run the cross gdb, you would have
to do a couple of "set solib-search-path"/"set solib-absolute-path"
commands after starting the debugger, in order to debug with the
appropriate libc/threads... You would like to have it done
automatically, by .gdbinit; I may be wrong, but I do not know any way
to execute a set of commands only when the cross debugger is
executed. Or maybe there is a way to test the configure target?
2) global, "user-independant", init file: At startup, gdb will load
the user-specific gdbinit (in $HOME) and the local gdbinit (in current
dir); before these two files, it would be useful to load an init file
that is valid for several users. Take the example I gave before, and
suppose now that a sysadmin has to install the cross gdb I was
describing and would like to make sure that the programmers will have
the "set solib" commands executed before they actually use the debugger. He
can of course document the issue, ask these programmers to modify
their own user-specific gdbinit to include these commands... but I am
pretty sure that it would prefer to have it done in some general config
file (say <prefix>/etc/gdbinit).
To deal with these two problems, here is what I would suggest:
1) Have target-specific gdb init files, named after the configure target
name (e.g. .powerpc-elf-gdbinit). .gdbinit would be the target-independant
gdb init file;
2) Have "global" init files located in <prefix>/etc (if the gdb executable
is installed in <prefix>/bin; <prefix> would be re-computed by gdb at run
time, just like gcc does for GCC_PREFIX).
In other words, here is what GDB would do at startup:
1. Sets up the command interpreter as specified by the command line.
2. Reads the global target-independant init file (if any) in
<prefix>/etc (e.g. <prefix>/etc/gdinit) and executes all the
commands in that file.
3. Reads the global target-specific init file (if any) in
<prefix>/etc (e.g. <prefix>/etc/powerpc-elf-gdinit) and executes
all the commands in that file.
4. Reads and executes the target-independant and target-specific
init files (if any) in your home directory.
3. Processes command line options and operands.
4. Reads and executes the commands from init files (if any) in the
current working directory.
5. Reads command files specified by the `-x' option.
6. Reads the command history recorded in the history file.
I would take care of proposing a patch if/when we reach an agreement.
Opinions/thoughts?
Thanks,
Jerome
next reply other threads:[~2008-12-14 12:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-14 12:46 Jerome Guitton [this message]
2008-12-14 18:36 ` Daniel Jacobowitz
2008-12-15 11:59 ` Jerome Guitton
2008-12-15 15:43 ` Daniel Jacobowitz
2008-12-15 16:46 ` Jerome Guitton
2008-12-18 19:50 ` Michael Snyder
2009-01-14 13:37 ` Jerome Guitton
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=20081214124549.GA25544@adacore.com \
--to=guitton@adacore.com \
--cc=gdb@sourceware.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox