This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: patch to use target specific .gdbinit file


Kris,

In the past there was a proposal (patch?) to add a configuration time option that would specify a system init file. There was a patch. I believe that the actual idea was accepted as sound but the patch was lost in the paper trail :-( Can I suggest extending your patch so that the mechanism and file are specified at configure time (please don't ask me which of --with or --use or --... is the correct option :-).

Some things to think about:
- a command to display the .gdbinit load order (with doco). If people get wierd behavour, being able to dsiplay this will be useful.
- doco (hmm, is there any config doco?) on the config option

Per earlier e-mail, I don't personally thing that .gdbinit-$TARGET is a good idea.

You'll want to double check this with both Fernando (CLI) and Elena (top.c).

Andrew

----- Original Message -----
From: "Felix Lee" <felix.1@canids.net>
To: <gdb@sources.redhat.com>
Sent: Friday, January 10, 2003 5:42 PM
Subject: Re: patch to use target specific .gdbinit file



"Kris Warkentin" <kewarken@qnx.com>:

> The following code will allow backend writers to define
> EXTRA_GDBINIT_FILENAME to be an alternate filename for sourcing on
startup.

> For example, since we have gdb versions for 5 different CPU targets, we
> allow users to create a $HOME/.ntoCPU-gdbinit.

1, I'd rather it be a generalized name, like maybe
.gdbinit-$TARGET.  making the name something chosen by the
backend writer feels like it adds unnecessary irregularity.

I don't care about the name that much - the reason we did this was to give
the option to backend writers as to whether they wanted it or not.  We could
do something like define GDBINIT_TARGET_SUFFIX which would just create
.gdbinit-GDBINIT_TARGET_SUFFIX if that's better.


2, this is going to make it more awkward to create a single
gdb that will debug multiple targets.

Is there any sort of TARGET variable that is set at runtime that I could
use?  Then we could just do something like #ifdef ENABLE_EXTRA_GDBINIT and
then it would just construct .gdbinit-$TARGET like you suggested.

I like your suggestion better, the only problem being how we generalize the
filename in a consistent and simple way.  It would suck if you wound up with
.gdbinit-nto-i386-some-stupid-target-stuff as your filename. ;-)  Can you
offer any suggestions?

cheers,

Kris




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]