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


On Wed, Jan 14, 2009 at 11:53:23PM +0200, Eli Zaretskii wrote:
> 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.

I understand now.  There's an alternative to keeping it in the same
tree:

  --prefix=/my/working/directory --with-system-gdbinit=/etc/gdbinit

In this version /etc is not relative to $prefix, so it wasn't
redundant.  This example may seem a little weird, but it makes more
sense for --with-debug-file-directory; your native system's libraries
are always in /usr/lib/debug, no matter where GDB goes.

This relocation scheme is a bit complicated.  I bear some blame for
that, though I didn't invent it; I just propogated the logic from its
original home in GCC.

-- 
Daniel Jacobowitz
CodeSourcery


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