From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28034 invoked by alias); 23 Jan 2009 17:24:57 -0000 Received: (qmail 28023 invoked by uid 22791); 23 Jan 2009 17:24:56 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_37 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Jan 2009 17:24:50 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 9CED4290045; Fri, 23 Jan 2009 18:24:47 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TfEr+wSphtgr; Fri, 23 Jan 2009 18:24:46 +0100 (CET) Received: from province.act-europe.fr (province.act-europe.fr [10.10.0.214]) by mel.act-europe.fr (Postfix) with ESMTP id 58EEB29002C; Fri, 23 Jan 2009 18:24:46 +0100 (CET) Received: by province.act-europe.fr (Postfix, from userid 560) id 4DF3E165C92; Fri, 23 Jan 2009 18:24:46 +0100 (CET) Date: Fri, 23 Jan 2009 17:24:00 -0000 From: Jerome Guitton To: Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: Add support for --with-system-gdbinit Message-ID: <20090123172446.GJ58143@adacore.com> References: <20090114135619.GA24456@caradoc.them.org> <20090114194922.GA13339@caradoc.them.org> <20090119141053.GE45099@adacore.com> <20090121105348.GD148@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2B/JsCI69OhZNC5r" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-01/txt/msg00470.txt.bz2 --2B/JsCI69OhZNC5r Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 725 Eli Zaretskii (eliz@gnu.org): > > Index: doc/gdb.texinfo > > =================================================================== > > RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v > > retrieving revision 1.545 > > diff -u -p -r1.545 gdb.texinfo > > --- doc/gdb.texinfo 14 Jan 2009 11:47:07 -0000 1.545 > > +++ doc/gdb.texinfo 21 Jan 2009 10:52:02 -0000 > > This part is approved, with a few minor comments Thank you for the review Eli. I have attached the new patch; I will commit it when the other part is approved. 2009-01-23 Daniel Jacobowitz Jerome Guitton * gdb.texinfo (Startup): Document --with-system-gdbinit. (System-wide configuration): New section. --2B/JsCI69OhZNC5r Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="gdb.texinfo.diff" Content-length: 3284 Index: gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.545 diff -u -p -r1.545 gdb.texinfo --- gdb.texinfo 14 Jan 2009 11:47:07 -0000 1.545 +++ gdb.texinfo 23 Jan 2009 17:20:08 -0000 @@ -1211,7 +1211,13 @@ Sets up the command interpreter as speci @item @cindex init file -Reads the @dfn{init file} (if any) in your home directory@footnote{On +Reads the system-wide @dfn{init file} (if @option{--with-system-gdbinit} was +used when building @value{GDBN}; @pxref{System-wide configuration, + ,System-wide configuration and settings}) and executes all the commands in +that file. + +@item +Reads the init file (if any) in your home directory@footnote{On DOS/Windows systems, the home directory is the one pointed to by the @code{HOME} environment variable.} and executes all the commands in that file. @@ -1244,6 +1250,9 @@ complaints}) that affect subsequent proc and operands. Init files are not executed if you use the @samp{-nx} option (@pxref{Mode Options, ,Choosing Modes}). +To display the list of init files loaded by gdb at startup, you +can use @kbd{gdb --help}. + @cindex init file name @cindex @file{.gdbinit} @cindex @file{gdb.ini} @@ -24304,6 +24313,7 @@ Then give @file{gdb.dvi} to your @sc{dvi * Separate Objdir:: Compiling @value{GDBN} in another directory * Config Names:: Specifying names for hosts and targets * Configure Options:: Summary of options for configure +* System-wide configuration:: Having a system-wide init file @end menu @node Requirements @@ -24646,6 +24656,42 @@ There is no convenient way to generate a There are many other options available as well, but they are generally needed for special purposes only. +@node System-wide configuration +@section System-wide configuration and settings +@cindex system-wide init file + +@value{GDBN} can be configured to have a system-wide init file; +this file will be read and executed at startup (@pxref{Startup, , What +@value{GDBN} does during startup}). + +Here is the corresponding configure option: + +@table @code +@item --with-system-gdbinit=@var{file} +Specify that the default location of the system-wide init file is +@var{file}. +@end table + +If @value{GDBN} has been configured with the option @option{--prefix=$prefix}, +it may be subject to relocation. Two possible cases: + +@itemize @bullet +@item +If the default location of this init file contains @file{$prefix}, +it will be subject to relocation. Suppose that the configure options +are @option{--prefix=$prefix --with-system-gdbinit=$prefix/etc/gdbinit}; +if @value{GDBN} is moved from @file{$prefix} to @file{$install}, the system +init file is looked for as @file{$install/etc/gdbinit} instead of +@file{$prefix/etc/gdbinit}. + +@item +By contrast, if the default location does not contain the prefix, +it will not be relocated. E.g.@: if @value{GDBN} has been configured with +@option{--prefix=/usr/local --with-system-gdbinit=/usr/share/gdb/gdbinit}, +then @value{GDBN} will always look for @file{/usr/share/gdb/gdbinit}, +wherever @value{GDBN} is installed. +@end itemize + @node Maintenance Commands @appendix Maintenance Commands @cindex maintenance commands --2B/JsCI69OhZNC5r--