This is the mail archive of the gdb-patches@sourceware.org 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: Add support for --with-system-gdbinit


> Date: Wed, 14 Jan 2009 15:37:55 -0500
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sourceware.org, guitton@adacore.com
> 
> On Wed, Jan 14, 2009 at 10:21:34PM +0200, Eli Zaretskii wrote:
> > > If you configure GDB using --prefix=$prefix
> > > --with-system-gdbinit=$prefix/etc/gdbinit, then a GDB installed in
> > > $prefix/bin will load $prefix/etc/gdbinit at startup.  If the tree
> > > is copied to /other/prefix, then GDB will load
> > > /other/prefix/etc/gdbinit.
> > 
> > If GDB can detect the right prefix for the system-wide gdbinit file,
> > why does it need to be configured for a specific place ($prefix/etc)
> > to begin with?
> 
> I'm sorry, I don't understand your question - could you explain?

By specifying the --with-system-gdbinit=$prefix/etc/gdbinit switch to
configure, we tell GDB to find gdbinit in that specific absolute
location.  But you also tell that moving GDB into another location
does not prevent GDB from finding gdbinit in that other location.
That begs the question: if GDB can find gdbinit even after it is
moved, why do we need to specify $prefix in the --with-system-gdbinit
option in the first place?  Evidently, all GDB needs is to know that
gdbinit will be in the etc/ subdirectory of the top of its tree, so it
can look there without me telling it where that top will be by
default.

IOW, it sounds like --with-system-gdbinit=etc/gdbinit should be
enough; the $prefix part is redundant.

(This is unrelated to my comments about picking a name for this file
and showing its location in --help.  It's just for my understanding of
how this works, and figuring out what do we need to tell the users in
the manual.)


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