Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Add support for --with-system-gdbinit
@ 2009-01-14 13:56 Daniel Jacobowitz
  2009-01-14 19:39 ` Eli Zaretskii
  2009-01-16 11:54 ` Jerome Guitton
  0 siblings, 2 replies; 21+ messages in thread
From: Daniel Jacobowitz @ 2009-01-14 13:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Jerome Guitton, Eli Zaretskii

As described on gdb@ last month, this patch adds support for a
system-wide gdbinit file.  The path will be automatically relocated if
the GDB binary is moved, so it can be used for a system-wide directory
like /etc or a prefixed directory like /opt/vendor/share.

Eli, is the doc patch OK?

-- 
Daniel Jacobowitz
CodeSourcery

2008-12-15  Daniel Jacobowitz  <dan@codesourcery.com>

	* configure, config.in: Regenerated.
	* configure.ac: Add --with-system-gdbinit.
	* main.c (system_gdbinit): New.
	(captured_main): Relocate system_gdbinit.  Load it before
	$HOME/.gdbinit.

2008-12-15  Daniel Jacobowitz  <dan@codesourcery.com>

	* gdb.texinfo (Startup): Document --with-system-gdbinit.

Index: config.in
===================================================================
RCS file: /cvs/src/src/gdb/config.in,v
retrieving revision 1.103
diff -u -p -r1.103 config.in
--- config.in	6 Aug 2008 19:41:31 -0000	1.103
+++ config.in	15 Dec 2008 15:40:34 -0000
@@ -646,6 +646,13 @@
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
+/* System-wide gdbinit file. */
+#undef SYSTEM_GDBINIT
+
+/* Define if the system-wide gdbinit file should be relocated when GDB is
+   moved. */
+#undef SYSTEM_GDBINIT_RELOCATABLE
+
 /* Define if <thread_db.h> has the TD_NOTALLOC error code. */
 #undef THREAD_DB_HAS_TD_NOTALLOC
 
Index: configure
===================================================================
RCS file: /cvs/src/src/gdb/configure,v
retrieving revision 1.262
diff -u -p -r1.262 configure
--- configure	21 Nov 2008 22:35:57 -0000	1.262
+++ configure	15 Dec 2008 15:40:36 -0000
@@ -895,6 +895,7 @@ Optional Packages:
                           on systems with version 2 of the GNU C library
                           (use with caution on other system)
   --with-sysroot=DIR Search for usr/lib et al within DIR.
+  --with-system-gdbinit=file       Automatically load a system-wide gdbinit file
   --with-tcl              directory containing tcl configuration (tclConfig.sh)
   --with-tk               directory containing tk configuration (tkConfig.sh)
   --with-x                use the X Window System
@@ -19417,6 +19418,49 @@ fi;
 
 
 
+system_gdbinit=
+
+# Check whether --with-system-gdbinit or --without-system-gdbinit was given.
+if test "${with_system_gdbinit+set}" = set; then
+  withval="$with_system_gdbinit"
+  system_gdbinit=${withval}
+fi;
+
+
+  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+  test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+  ac_define_dir=`eval echo $system_gdbinit`
+  ac_define_dir=`eval echo $ac_define_dir`
+
+cat >>confdefs.h <<_ACEOF
+#define SYSTEM_GDBINIT "$ac_define_dir"
+_ACEOF
+
+
+
+if test "x$prefix" = xNONE; then
+  test_prefix=$ac_default_prefix
+else
+  test_prefix=$prefix
+fi
+if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
+  test_exec_prefix=$test_prefix
+else
+  test_exec_prefix=$exec_prefix
+fi
+case ${system_gdbinit} in
+ "${test_prefix}"|"${test_prefix}/"*|\
+ "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
+ '${prefix}'|'${prefix}/'*|\
+ '${exec_prefix}'|'${exec_prefix}/'*)
+
+cat >>confdefs.h <<\_ACEOF
+#define SYSTEM_GDBINIT_RELOCATABLE 1
+_ACEOF
+
+   ;;
+esac
+
 # Check whether --enable-werror or --disable-werror was given.
 if test "${enable_werror+set}" = set; then
   enableval="$enable_werror"
Index: configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/configure.ac,v
retrieving revision 1.82
diff -u -p -r1.82 configure.ac
--- configure.ac	21 Nov 2008 22:35:58 -0000	1.82
+++ configure.ac	15 Dec 2008 15:40:36 -0000
@@ -1488,6 +1488,34 @@ AC_ARG_WITH(sysroot,
 AC_SUBST(TARGET_SYSTEM_ROOT)
 AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
 
+system_gdbinit=
+AC_ARG_WITH(system-gdbinit,
+[  --with-system-gdbinit=file       Automatically load a system-wide gdbinit file],
+[system_gdbinit=${withval}])
+
+AC_DEFINE_DIR(SYSTEM_GDBINIT, system_gdbinit,
+              [System-wide gdbinit file.])
+
+if test "x$prefix" = xNONE; then
+  test_prefix=$ac_default_prefix
+else
+  test_prefix=$prefix
+fi
+if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
+  test_exec_prefix=$test_prefix
+else
+  test_exec_prefix=$exec_prefix
+fi
+case ${system_gdbinit} in
+ "${test_prefix}"|"${test_prefix}/"*|\
+ "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
+ '${prefix}'|'${prefix}/'*|\
+ '${exec_prefix}'|'${exec_prefix}/'*)
+  AC_DEFINE(SYSTEM_GDBINIT_RELOCATABLE, 1,
+            [Define if the system-wide gdbinit file should be relocated when GDB is moved.])
+   ;;
+esac
+
 AC_ARG_ENABLE(werror,
   [  --enable-werror    treat compile warnings as errors],
   [case "${enableval}" in
Index: main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.70
diff -u -p -r1.70 main.c
--- main.c	29 Jul 2008 14:16:15 -0000	1.70
+++ main.c	15 Dec 2008 15:40:36 -0000
@@ -83,6 +83,9 @@ int return_child_result_value = -1;
 /* Whether to enable writing into executable and core files */
 extern int write_files;
 
+/* The system-wide gdbinit file.  */
+static char *system_gdbinit = SYSTEM_GDBINIT;
+
 static void print_gdb_help (struct ui_file *);
 
 /* These two are used to set the external editor commands when gdb is farming
@@ -268,6 +271,24 @@ captured_main (void *data)
 	}
     }
 
+#ifdef SYSTEM_GDBINIT_RELOCATABLE
+  system_gdbinit = make_relative_prefix (argv[0], BINDIR, SYSTEM_GDBINIT);
+  if (system_gdbinit)
+    {
+      struct stat s;
+      int res = 0;
+
+      if (stat (system_gdbinit, &s) == 0)
+	res = 1;
+
+      if (res == 0)
+	{
+	  xfree (system_gdbinit);
+	  system_gdbinit = SYSTEM_GDBINIT;
+	}
+    }
+#endif
+
   /* There will always be an interpreter.  Either the one passed into
      this captured main, or one specified by the user at start up, or
      the console.  Initialize the interpreter to the one requested by 
@@ -679,6 +700,13 @@ Excess command line arguments ignored. (
   quit_pre_print = error_pre_print;
   warning_pre_print = _("\nwarning: ");
 
+  /* Read and execute the system-wide gdbinit file, if it exists.
+     This is done *before* all the command line arguments are
+     processed; it sets global parameters, which are independent of
+     what file you are debugging or what directory you are in.  */
+  if (system_gdbinit[0] && !inhibit_gdbinit)
+    catch_command_errors (source_script, system_gdbinit, 0, RETURN_MASK_ALL);
+
   /* Read and execute $HOME/.gdbinit file, if it exists.  This is done
      *before* all the command line arguments are processed; it sets
      global parameters, which are independent of what file you are
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.537
diff -u -p -r1.537 gdb.texinfo
--- doc/gdb.texinfo	27 Nov 2008 09:23:01 -0000	1.537
+++ doc/gdb.texinfo	15 Dec 2008 15:40:42 -0000
@@ -1219,6 +1219,10 @@ Sets up the command interpreter as speci
 
 @item
 @cindex init file
+Reads the system-wide @dfn{init file} (if @option{--with-system-gdbinit} was
+used when building @value{GDBN}) and executes all the commands in that file.
+
+@item
 Reads the @dfn{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


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-14 13:56 Add support for --with-system-gdbinit Daniel Jacobowitz
@ 2009-01-14 19:39 ` Eli Zaretskii
  2009-01-14 19:50   ` Daniel Jacobowitz
  2009-01-16 11:54 ` Jerome Guitton
  1 sibling, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2009-01-14 19:39 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches, guitton

> Date: Wed, 14 Jan 2009 08:56:19 -0500
> From: Daniel Jacobowitz <drow@false.org>
> Cc: Jerome Guitton <guitton@adacore.com>, Eli Zaretskii <eliz@gnu.org>
> 
> The path will be automatically relocated if the GDB binary is moved,
> so it can be used for a system-wide directory like /etc or a
> prefixed directory like /opt/vendor/share.

Sorry, I don't understand: what does this mean?  How does one
``relocate a path''?

> Eli, is the doc patch OK?

The doc patch doesn't really say anything useful:

>  @item
>  @cindex init file
> +Reads the system-wide @dfn{init file} (if @option{--with-system-gdbinit} was
> +used when building @value{GDBN}) and executes all the commands in that file.

That's it!  We don't tell what is the name of the file, we don't tell
how to find it, we just tell it _might_ exist and it _might_ be read
by GDB at startup.  That doesn't sound very user-friendly to me.
Contrast that with what the Emacs manual says about site-start.el,
which AFAIU has a similar purpose.

Am I missing something?

At the very least we should have some command-line option (perhaps as
part of "--help") to show where this file should live and what's its
name, and we should describe that right next to the above text.  We
shouldn't assume that the user is the same person who built GDB in the
first place.

Also, doesn't the relocation of the file (whatever it may mean)
warrant some documentation as well?  Assuming I'm a sysadmin who needs
to set up such a site-wide init file, don't I need to know something
else besides what you wrote?


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-14 19:39 ` Eli Zaretskii
@ 2009-01-14 19:50   ` Daniel Jacobowitz
  2009-01-14 20:22     ` Eli Zaretskii
  2009-01-19 14:11     ` Jerome Guitton
  0 siblings, 2 replies; 21+ messages in thread
From: Daniel Jacobowitz @ 2009-01-14 19:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches, guitton

On Wed, Jan 14, 2009 at 09:37:55PM +0200, Eli Zaretskii wrote:
> > The path will be automatically relocated if the GDB binary is moved,
> > so it can be used for a system-wide directory like /etc or a
> > prefixed directory like /opt/vendor/share.
> 
> Sorry, I don't understand: what does this mean?  How does one
> ``relocate a path''?

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.  We use the same algorithm for set
debug-file-directory and set sysroot.

> That's it!  We don't tell what is the name of the file, we don't tell
> how to find it, we just tell it _might_ exist and it _might_ be read
> by GDB at startup.  That doesn't sound very user-friendly to me.
> Contrast that with what the Emacs manual says about site-start.el,
> which AFAIU has a similar purpose.
> 
> Am I missing something?

There isn't a standard name.  It's just whatever is given to the
configure option.  Do you think it should have a standard name?
I definitely need the ability to change the name via configure.

Having --help print it out sounds wise to me.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-14 19:50   ` Daniel Jacobowitz
@ 2009-01-14 20:22     ` Eli Zaretskii
  2009-01-14 20:38       ` Daniel Jacobowitz
  2009-01-19 14:11     ` Jerome Guitton
  1 sibling, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2009-01-14 20:22 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches, guitton

> Date: Wed, 14 Jan 2009 14:49:22 -0500
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sourceware.org, guitton@adacore.com
> 
> On Wed, Jan 14, 2009 at 09:37:55PM +0200, Eli Zaretskii wrote:
> > > The path will be automatically relocated if the GDB binary is moved,
> > > so it can be used for a system-wide directory like /etc or a
> > > prefixed directory like /opt/vendor/share.
> > 
> > Sorry, I don't understand: what does this mean?  How does one
> > ``relocate a path''?
> 
> 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?

> There isn't a standard name.  It's just whatever is given to the
> configure option.

Yes, I saw that much in the patch.

> Do you think it should have a standard name?

Yes, that would at least give the reader a starting point to look.

> Having --help print it out sounds wise to me.

I don't see how we can do less than that.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-14 20:22     ` Eli Zaretskii
@ 2009-01-14 20:38       ` Daniel Jacobowitz
  2009-01-14 21:55         ` Eli Zaretskii
  0 siblings, 1 reply; 21+ messages in thread
From: Daniel Jacobowitz @ 2009-01-14 20:38 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches, guitton

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?

As currently implemented there is no standard location.  We don't put
it in /etc here; we use "$prefix/$host/$target/lib/gdbinit" in case
you have a lot of different configurations installed in the same
place.  I didn't pick a naming policy since the default is the same
as it was before; no global init file.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-14 20:38       ` Daniel Jacobowitz
@ 2009-01-14 21:55         ` Eli Zaretskii
  2009-01-14 23:07           ` Daniel Jacobowitz
  0 siblings, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2009-01-14 21:55 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches, guitton

> 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.)


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-14 21:55         ` Eli Zaretskii
@ 2009-01-14 23:07           ` Daniel Jacobowitz
  2009-01-15  4:10             ` Eli Zaretskii
  0 siblings, 1 reply; 21+ messages in thread
From: Daniel Jacobowitz @ 2009-01-14 23:07 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches, guitton

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


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-14 23:07           ` Daniel Jacobowitz
@ 2009-01-15  4:10             ` Eli Zaretskii
  0 siblings, 0 replies; 21+ messages in thread
From: Eli Zaretskii @ 2009-01-15  4:10 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches, guitton

> Date: Wed, 14 Jan 2009 18:06:29 -0500
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sourceware.org, guitton@adacore.com
> 
> 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.

Thanks for explaining this.  Now I'm quite sure this needs to be
explained in the manual somewhere, or maybe in INSTALL.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-14 13:56 Add support for --with-system-gdbinit Daniel Jacobowitz
  2009-01-14 19:39 ` Eli Zaretskii
@ 2009-01-16 11:54 ` Jerome Guitton
  1 sibling, 0 replies; 21+ messages in thread
From: Jerome Guitton @ 2009-01-16 11:54 UTC (permalink / raw)
  To: gdb-patches, Eli Zaretskii

Daniel Jacobowitz (drow@false.org):

> As described on gdb@ last month, this patch adds support for a
> system-wide gdbinit file.  The path will be automatically relocated if
> the GDB binary is moved, so it can be used for a system-wide directory
> like /etc or a prefixed directory like /opt/vendor/share.

Thank you Dan. If there is anything I can do to help (e.g. write some
more doc/help about this feature), let me know.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-14 19:50   ` Daniel Jacobowitz
  2009-01-14 20:22     ` Eli Zaretskii
@ 2009-01-19 14:11     ` Jerome Guitton
  2009-01-19 14:20       ` Daniel Jacobowitz
  2009-01-19 18:40       ` Eli Zaretskii
  1 sibling, 2 replies; 21+ messages in thread
From: Jerome Guitton @ 2009-01-19 14:11 UTC (permalink / raw)
  To: Eli Zaretskii, gdb-patches

Daniel Jacobowitz (drow@false.org):

> Having --help print it out sounds wise to me.

Maybe we can take this opportunity to print the list of gdbinit loaded in
GDB at startup. Something like:

[...]
  --xdb              XDB compatibility mode.

At startup, GDB reads the following init files and executes their commands:
  * system-wide init file: /etc/gdb/gdbinit
  * user-specific init file: /homes/guitton/.gdbinit
  * local init file: /homes/guitton/work/.gdbinit

For more information, type "help" from within GDB, or consult the
GDB manual (available as on-line info or a printed manual).
[...]


Would that make sense?


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-19 14:11     ` Jerome Guitton
@ 2009-01-19 14:20       ` Daniel Jacobowitz
  2009-01-19 18:40       ` Eli Zaretskii
  1 sibling, 0 replies; 21+ messages in thread
From: Daniel Jacobowitz @ 2009-01-19 14:20 UTC (permalink / raw)
  To: Jerome Guitton; +Cc: Eli Zaretskii, gdb-patches

On Mon, Jan 19, 2009 at 03:10:53PM +0100, Jerome Guitton wrote:
> Maybe we can take this opportunity to print the list of gdbinit loaded in
> GDB at startup. Something like:
> 
> [...]
>   --xdb              XDB compatibility mode.
> 
> At startup, GDB reads the following init files and executes their commands:
>   * system-wide init file: /etc/gdb/gdbinit
>   * user-specific init file: /homes/guitton/.gdbinit
>   * local init file: /homes/guitton/work/.gdbinit
> 
> For more information, type "help" from within GDB, or consult the
> GDB manual (available as on-line info or a printed manual).
> [...]
> 
> 
> Would that make sense?

It does to me - although I suggest using a relative path for that last
item (./.gdbinit), to make it clear that it will change if you cd.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-19 14:11     ` Jerome Guitton
  2009-01-19 14:20       ` Daniel Jacobowitz
@ 2009-01-19 18:40       ` Eli Zaretskii
  2009-01-21 10:54         ` Jerome Guitton
  1 sibling, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2009-01-19 18:40 UTC (permalink / raw)
  To: Jerome Guitton; +Cc: gdb-patches

> Date: Mon, 19 Jan 2009 15:10:53 +0100
> From: Jerome Guitton <guitton@adacore.com>
> 
> At startup, GDB reads the following init files and executes their commands:
>   * system-wide init file: /etc/gdb/gdbinit
>   * user-specific init file: /homes/guitton/.gdbinit
>   * local init file: /homes/guitton/work/.gdbinit
> 
> For more information, type "help" from within GDB, or consult the
> GDB manual (available as on-line info or a printed manual).
> [...]
> 
> 
> Would that make sense?

Yes, with changes suggested by Daniel.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-19 18:40       ` Eli Zaretskii
@ 2009-01-21 10:54         ` Jerome Guitton
  2009-01-21 19:03           ` Eli Zaretskii
  2009-01-23 17:42           ` Daniel Jacobowitz
  0 siblings, 2 replies; 21+ messages in thread
From: Jerome Guitton @ 2009-01-21 10:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1309 bytes --]

Eli Zaretskii (eliz@gnu.org):

> > Date: Mon, 19 Jan 2009 15:10:53 +0100
> > From: Jerome Guitton <guitton@adacore.com>
> > 
> > At startup, GDB reads the following init files and executes their commands:
> >   * system-wide init file: /etc/gdb/gdbinit
> >   * user-specific init file: /homes/guitton/.gdbinit
> >   * local init file: /homes/guitton/work/.gdbinit
> > 
> > For more information, type "help" from within GDB, or consult the
> > GDB manual (available as on-line info or a printed manual).
> > [...]
> > 
> > 
> > Would that make sense?
> 
> Yes, with changes suggested by Daniel.


Here is a patch that takes that into account and adds some
documentation about the relocation. Is it OK to apply?


2009-01-20  Daniel Jacobowitz  <dan@codesourcery.com>
	    Jerome Guitton  <guitton@adacore.com>

	* configure, config.in: Regenerated.
	* configure.ac: Add --with-system-gdbinit.
	* main.c (gdb_program_name): New static variable.
	(get_init_files): New function.
	(captured_main): Use get_init_files. Load system gdbinit before
	$HOME/.gdbinit.
	(print_gdb_help): Print location of init files.

2009-01-20  Daniel Jacobowitz  <dan@codesourcery.com>
	    Jerome Guitton  <guitton@adacore.com>

	* gdb.texinfo (Startup): Document --with-system-gdbinit.
	(System-wide configuration): New section.



[-- Attachment #2: system-wide-gdbinit.diff --]
[-- Type: text/x-diff, Size: 14353 bytes --]

Index: configure
===================================================================
RCS file: /cvs/src/src/gdb/configure,v
retrieving revision 1.264
diff -u -p -r1.264 configure
--- configure	12 Jan 2009 01:10:27 -0000	1.264
+++ configure	21 Jan 2009 10:51:58 -0000
@@ -895,6 +895,7 @@ Optional Packages:
                           on systems with version 2 of the GNU C library
                           (use with caution on other system)
   --with-sysroot=DIR Search for usr/lib et al within DIR.
+  --with-system-gdbinit=file       Automatically load a system-wide gdbinit file
   --with-tcl              directory containing tcl configuration (tclConfig.sh)
   --with-tk               directory containing tk configuration (tkConfig.sh)
   --with-x                use the X Window System
@@ -19482,6 +19483,49 @@ fi;
 
 
 
+system_gdbinit=
+
+# Check whether --with-system-gdbinit or --without-system-gdbinit was given.
+if test "${with_system_gdbinit+set}" = set; then
+  withval="$with_system_gdbinit"
+  system_gdbinit=${withval}
+fi;
+
+
+  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+  test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+  ac_define_dir=`eval echo $system_gdbinit`
+  ac_define_dir=`eval echo $ac_define_dir`
+
+cat >>confdefs.h <<_ACEOF
+#define SYSTEM_GDBINIT "$ac_define_dir"
+_ACEOF
+
+
+
+if test "x$prefix" = xNONE; then
+  test_prefix=$ac_default_prefix
+else
+  test_prefix=$prefix
+fi
+if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
+  test_exec_prefix=$test_prefix
+else
+  test_exec_prefix=$exec_prefix
+fi
+case ${system_gdbinit} in
+ "${test_prefix}"|"${test_prefix}/"*|\
+ "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
+ '${prefix}'|'${prefix}/'*|\
+ '${exec_prefix}'|'${exec_prefix}/'*)
+
+cat >>confdefs.h <<\_ACEOF
+#define SYSTEM_GDBINIT_RELOCATABLE 1
+_ACEOF
+
+   ;;
+esac
+
 # Check whether --enable-werror or --disable-werror was given.
 if test "${enable_werror+set}" = set; then
   enableval="$enable_werror"
Index: config.in
===================================================================
RCS file: /cvs/src/src/gdb/config.in,v
retrieving revision 1.104
diff -u -p -r1.104 config.in
--- config.in	9 Dec 2008 17:18:29 -0000	1.104
+++ config.in	21 Jan 2009 10:51:58 -0000
@@ -655,6 +655,13 @@
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
+/* System-wide gdbinit file. */
+#undef SYSTEM_GDBINIT
+
+/* Define if the system-wide gdbinit file should be relocated when GDB is
+   moved. */
+#undef SYSTEM_GDBINIT_RELOCATABLE
+
 /* Define if <thread_db.h> has the TD_NOTALLOC error code. */
 #undef THREAD_DB_HAS_TD_NOTALLOC
 
Index: configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/configure.ac,v
retrieving revision 1.84
diff -u -p -r1.84 configure.ac
--- configure.ac	12 Jan 2009 01:10:27 -0000	1.84
+++ configure.ac	21 Jan 2009 10:51:58 -0000
@@ -1489,6 +1489,34 @@ AC_ARG_WITH(sysroot,
 AC_SUBST(TARGET_SYSTEM_ROOT)
 AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
 
+system_gdbinit=
+AC_ARG_WITH(system-gdbinit,
+[  --with-system-gdbinit=file       Automatically load a system-wide gdbinit file],
+[system_gdbinit=${withval}])
+
+AC_DEFINE_DIR(SYSTEM_GDBINIT, system_gdbinit,
+              [System-wide gdbinit file.])
+
+if test "x$prefix" = xNONE; then
+  test_prefix=$ac_default_prefix
+else
+  test_prefix=$prefix
+fi
+if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
+  test_exec_prefix=$test_prefix
+else
+  test_exec_prefix=$exec_prefix
+fi
+case ${system_gdbinit} in
+ "${test_prefix}"|"${test_prefix}/"*|\
+ "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
+ '${prefix}'|'${prefix}/'*|\
+ '${exec_prefix}'|'${exec_prefix}/'*)
+  AC_DEFINE(SYSTEM_GDBINIT_RELOCATABLE, 1,
+            [Define if the system-wide gdbinit file should be relocated when GDB is moved.])
+   ;;
+esac
+
 AC_ARG_ENABLE(werror,
   [  --enable-werror    treat compile warnings as errors],
   [case "${enableval}" in
Index: main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.72
diff -u -p -r1.72 main.c
--- main.c	6 Jan 2009 18:31:59 -0000	1.72
+++ main.c	21 Jan 2009 10:51:58 -0000
@@ -83,6 +83,9 @@ int return_child_result_value = -1;
 /* Whether to enable writing into executable and core files */
 extern int write_files;
 
+/* GDB as it has been invoked from the command line (i.e. argv[0]).  */
+static char *gdb_program_name;
+
 static void print_gdb_help (struct ui_file *);
 
 /* These two are used to set the external editor commands when gdb is farming
@@ -90,6 +93,78 @@ static void print_gdb_help (struct ui_fi
 
 extern char *external_editor_command;
 
+/* Compute the locations of init files that GDB should source and return
+   them in SYSTEM_GDBINIT, HOME_GDBINIT, LOCAL_GDBINIT.  If there is 
+   no system gdbinit (resp. home gdbinit and local gdbinit) to be loaded,
+   then SYSTEM_GDBINIT (resp. HOME_GDBINIT and LOCAL_GDBINIT) is set to
+   NULL.  */
+static void
+get_init_files (char **system_gdbinit,
+		char **home_gdbinit,
+		char **local_gdbinit)
+{
+  static char *sysgdbinit = NULL;
+  static char *homeinit = NULL;
+  static char *localinit = NULL;
+  static int initialized = 0;
+
+  if (!initialized)
+    {
+      struct stat homebuf, cwdbuf, s;
+      char *homedir, *relocated_sysgdbinit;
+
+      if (stat (SYSTEM_GDBINIT, &s) == 0)
+	sysgdbinit = SYSTEM_GDBINIT;
+
+#ifdef SYSTEM_GDBINIT_RELOCATABLE
+      relocated_sysgdbinit = make_relative_prefix (gdb_program_name, BINDIR,
+						   SYSTEM_GDBINIT);
+      if (relocated_sysgdbinit)
+	{
+	  struct stat s;
+	  int res = 0;
+
+	  if (stat (relocated_sysgdbinit, &s) == 0)
+	      sysgdbinit = relocated_sysgdbinit;
+	}
+#endif
+
+      homedir = getenv ("HOME");
+
+      /* If the .gdbinit file in the current directory is the same as
+	 the $HOME/.gdbinit file, it should not be sourced.  homebuf
+	 and cwdbuf are used in that purpose. Make sure that the stats
+	 are zero in case one of them fails (this guarantees that they
+	 won't match if either exists).  */
+
+      memset (&homebuf, 0, sizeof (struct stat));
+      memset (&cwdbuf, 0, sizeof (struct stat));
+
+      if (homedir)
+	{
+	  homeinit = xstrprintf ("%s/%s", homedir, gdbinit);
+	  if (stat (homeinit, &homebuf) != 0)
+	    homeinit = NULL;
+
+	  stat (homeinit, &homebuf);
+	}
+
+      if (stat (gdbinit, &cwdbuf) == 0)
+	{
+	  if (!homeinit
+	      || memcmp ((char *) &homebuf, (char *) &cwdbuf,
+			 sizeof (struct stat)))
+	    localinit = gdbinit;
+	}
+      
+      initialized = 1;
+    }
+
+  *system_gdbinit = sysgdbinit;
+  *home_gdbinit = homeinit;
+  *local_gdbinit = localinit;
+}
+
 /* Call command_loop.  If it happens to return, pass that through as a
    non-zero return status. */
 
@@ -156,8 +231,10 @@ captured_main (void *data)
   /* Number of elements used.  */
   int ndir;
 
-  struct stat homebuf, cwdbuf;
-  char *homedir;
+  /* gdb init files.  */
+  char *system_gdbinit;
+  char *home_gdbinit;
+  char *local_gdbinit;
 
   int i;
 
@@ -196,6 +273,8 @@ captured_main (void *data)
   gdb_stdtargerr = gdb_stderr;	/* for moment */
   gdb_stdtargin = gdb_stdin;	/* for moment */
 
+  gdb_program_name = xstrdup (argv[0]);
+
   if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)))
     /* Don't use *_filtered or warning() (which relies on
        current_target) until after initialize_all_files(). */
@@ -274,6 +353,8 @@ captured_main (void *data)
 	}
     }
 
+  get_init_files (&system_gdbinit, &home_gdbinit, &local_gdbinit);
+
   /* There will always be an interpreter.  Either the one passed into
      this captured main, or one specified by the user at start up, or
      the console.  Initialize the interpreter to the one requested by 
@@ -685,33 +766,20 @@ Excess command line arguments ignored. (
   quit_pre_print = error_pre_print;
   warning_pre_print = _("\nwarning: ");
 
+  /* Read and execute the system-wide gdbinit file, if it exists.
+     This is done *before* all the command line arguments are
+     processed; it sets global parameters, which are independent of
+     what file you are debugging or what directory you are in.  */
+  if (system_gdbinit && !inhibit_gdbinit)
+    catch_command_errors (source_script, system_gdbinit, 0, RETURN_MASK_ALL);
+
   /* Read and execute $HOME/.gdbinit file, if it exists.  This is done
      *before* all the command line arguments are processed; it sets
      global parameters, which are independent of what file you are
      debugging or what directory you are in.  */
-  homedir = getenv ("HOME");
-  if (homedir)
-    {
-      char *homeinit = xstrprintf ("%s/%s", homedir, gdbinit);
-
-      if (!inhibit_gdbinit)
-	{
-	  catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL);
-	}
-
-      /* Do stats; no need to do them elsewhere since we'll only
-         need them if homedir is set.  Make sure that they are
-         zero in case one of them fails (this guarantees that they
-         won't match if either exists).  */
-
-      memset (&homebuf, 0, sizeof (struct stat));
-      memset (&cwdbuf, 0, sizeof (struct stat));
 
-      stat (homeinit, &homebuf);
-      stat (gdbinit, &cwdbuf);	/* We'll only need this if
-				   homedir was set.  */
-      xfree (homeinit);
-    }
+  if (home_gdbinit && !inhibit_gdbinit)
+    catch_command_errors (source_script, home_gdbinit, 0, RETURN_MASK_ALL);
 
   /* Now perform all the actions indicated by the arguments.  */
   if (cdarg != NULL)
@@ -779,13 +847,8 @@ Can't attach to process and specify a co
 
   /* Read the .gdbinit file in the current directory, *if* it isn't
      the same as the $HOME/.gdbinit file (it should exist, also).  */
-
-  if (!homedir
-      || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
-    if (!inhibit_gdbinit)
-      {
-	catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL);
-      }
+  if (local_gdbinit && !inhibit_gdbinit)
+    catch_command_errors (source_script, local_gdbinit, 0, RETURN_MASK_ALL);
 
   for (i = 0; i < ncmd; i++)
     {
@@ -857,6 +920,12 @@ gdb_main (struct captured_main_args *arg
 static void
 print_gdb_help (struct ui_file *stream)
 {
+  char *system_gdbinit;
+  char *home_gdbinit;
+  char *local_gdbinit;
+
+  get_init_files (&system_gdbinit, &home_gdbinit, &local_gdbinit);
+
   fputs_unfiltered (_("\
 This is the GNU debugger.  Usage:\n\n\
     gdb [options] [executable-file [core-file or process-id]]\n\
@@ -919,6 +988,21 @@ Options:\n\n\
   --xdb              XDB compatibility mode.\n\
 "), stream);
   fputs_unfiltered (_("\n\
+At startup, GDB reads the following init files and executes their commands:\n\
+"), stream);
+  if (system_gdbinit)
+    fprintf_unfiltered (stream, _("\
+   * system-wide init file: %s\n\
+"), system_gdbinit);
+  if (home_gdbinit)
+    fprintf_unfiltered (stream, _("\
+   * user-specific init file: %s\n\
+"), home_gdbinit);
+  if (local_gdbinit)
+    fprintf_unfiltered (stream, _("\
+   * local init file: ./%s\n\
+"), local_gdbinit);
+  fputs_unfiltered (_("\n\
 For more information, type \"help\" from within GDB, or consult the\n\
 GDB manual (available as on-line info or a printed manual).\n\
 "), stream);
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
@@ -1211,6 +1211,12 @@ Sets up the command interpreter as speci
 
 @item
 @cindex init file
+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 @dfn{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
@@ -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,36 @@ 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 @dfn{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 @dfn{init file} is
+@var{file}.
+@end table
+
+If the default location of this init file contains the prefix,
+it will be subject to relocation. Suppose that @value{GDBN} has been
+configured with @kbd{--prefix=$prefix} and
+@kbd{--with-system-gdbinit=$prefix/etc/gdbinit}; if @value{GDBN} is
+installed somewhere else (say: in @file{$install/bin}), the system
+init file will be looked for relatively to this new location: in our
+case, it will be @file{$install/bin/../etc/gdbinit}.
+
+At the contrary, if the default location does not contain the prefix,
+it will not be relocated. E.g.@: if @value{GDBN} has been configured with
+@kbd{--prefix=/usr/local --with-system-gdbinit=/usr/share/gdb/gdbinit},
+then @value{GDBN} will always look for @kbd{/usr/share/gdb/gdbinit},
+wherever @value{GDBN} is installed.
+
 @node Maintenance Commands
 @appendix Maintenance Commands
 @cindex maintenance commands

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-21 10:54         ` Jerome Guitton
@ 2009-01-21 19:03           ` Eli Zaretskii
  2009-01-23 17:24             ` Jerome Guitton
  2009-01-23 17:42           ` Daniel Jacobowitz
  1 sibling, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2009-01-21 19:03 UTC (permalink / raw)
  To: Jerome Guitton; +Cc: gdb-patches

> Date: Wed, 21 Jan 2009 11:53:48 +0100
> From: Jerome Guitton <guitton@adacore.com>
> Cc: gdb-patches@sourceware.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:

> +Reads the system-wide @dfn{init file} (if @option{--with-system-gdbinit} was

There's no need to use @dfn for the same term more than once.  Once
the term is introduced, you should use it without the @dfn markup.

> +@value{GDBN} can be configured to have a system-wide @dfn{init file};

Likewise.

> +If the default location of this init file contains the prefix,
                                                      ^^^^^^^^^^
It took me a while to understand what is meant by "the prefix".  I
think we should explain this explicitly, as referring to $prefix.

> +it will be subject to relocation. Suppose that @value{GDBN} has been
                                   ^^
Two spaces after a period that ends a sentence, please.

> +configured with @kbd{--prefix=$prefix} and
> +@kbd{--with-system-gdbinit=$prefix/etc/gdbinit}; if @value{GDBN} is

It is better to use @option here, not @kbd, since you are not
describing keyboard input.

> +installed somewhere else (say: in @file{$install/bin}), the system
> +init file will be looked for relatively to this new location: in our
> +case, it will be @file{$install/bin/../etc/gdbinit}.

This is a bit confusing, because you say

  if @value{GDBN} is installed somewhere else (say: in @file{$install/bin})

This subtly introduces the bin/ subdirectory and requires the reader
to know that "@value{GDBN} is installed" refers to the GDB _binary_,
not to GDB as a package.  The latter is, of course, installed in
$prefix and moved to $install.

Can you rewrite this bit to explain that GDB is moved from $prefix to
$install, and then the system-wide init file is looked for as
$install/etc/gdbinit instead of $prefix/etc/gdbinit?

> +At the contrary, if the default location does not contain the prefix,
   ^^^^^^^^^^^^^^^
"By contrast" is better here.

> +it will not be relocated. E.g.@: if @value{GDBN} has been configured with
                           ^^
Two spaces.

Thanks.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-21 19:03           ` Eli Zaretskii
@ 2009-01-23 17:24             ` Jerome Guitton
  2009-01-23 22:55               ` Eli Zaretskii
  0 siblings, 1 reply; 21+ messages in thread
From: Jerome Guitton @ 2009-01-23 17:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 725 bytes --]

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  <dan@codesourcery.com>
	    Jerome Guitton  <guitton@adacore.com>

	* gdb.texinfo (Startup): Document --with-system-gdbinit.
	(System-wide configuration): New section.







[-- Attachment #2: gdb.texinfo.diff --]
[-- Type: text/x-diff, Size: 3284 bytes --]

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-21 10:54         ` Jerome Guitton
  2009-01-21 19:03           ` Eli Zaretskii
@ 2009-01-23 17:42           ` Daniel Jacobowitz
  2009-01-26  9:12             ` Jerome Guitton
  1 sibling, 1 reply; 21+ messages in thread
From: Daniel Jacobowitz @ 2009-01-23 17:42 UTC (permalink / raw)
  To: Jerome Guitton; +Cc: Eli Zaretskii, gdb-patches

On Wed, Jan 21, 2009 at 11:53:48AM +0100, Jerome Guitton wrote:
> +  if (!initialized)
> +    {
> +      struct stat homebuf, cwdbuf, s;
> +      char *homedir, *relocated_sysgdbinit;
> +
> +      if (stat (SYSTEM_GDBINIT, &s) == 0)
> +	sysgdbinit = SYSTEM_GDBINIT;

What, if anything, does SYSTEM_GDBINIT get defined to when GDB is
configured with no special options?

> +      if (homedir)
> +	{
> +	  homeinit = xstrprintf ("%s/%s", homedir, gdbinit);
> +	  if (stat (homeinit, &homebuf) != 0)
> +	    homeinit = NULL;
> +
> +	  stat (homeinit, &homebuf);
> +	}

You've got a bunch of memory leaks in this function; this is one of
them.  homeinit is not freed if it does not exist.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-23 17:24             ` Jerome Guitton
@ 2009-01-23 22:55               ` Eli Zaretskii
  2009-01-28 18:00                 ` Jerome Guitton
  0 siblings, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2009-01-23 22:55 UTC (permalink / raw)
  To: Jerome Guitton; +Cc: gdb-patches

> Date: Fri, 23 Jan 2009 18:24:46 +0100
> From: Jerome Guitton <guitton@adacore.com>
> Cc: gdb-patches@sourceware.org
> 
> > 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.

Thanks, this version is OK.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-23 17:42           ` Daniel Jacobowitz
@ 2009-01-26  9:12             ` Jerome Guitton
  2009-01-26 14:59               ` Daniel Jacobowitz
  0 siblings, 1 reply; 21+ messages in thread
From: Jerome Guitton @ 2009-01-26  9:12 UTC (permalink / raw)
  To: Eli Zaretskii, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]

Daniel Jacobowitz (drow@false.org):

> On Wed, Jan 21, 2009 at 11:53:48AM +0100, Jerome Guitton wrote:
> > +  if (!initialized)
> > +    {
> > +      struct stat homebuf, cwdbuf, s;
> > +      char *homedir, *relocated_sysgdbinit;
> > +
> > +      if (stat (SYSTEM_GDBINIT, &s) == 0)
> > +	sysgdbinit = SYSTEM_GDBINIT;
> 
> What, if anything, does SYSTEM_GDBINIT get defined to when GDB is
> configured with no special options?

It gets defined to "". It is probably clearer to make a special case;
I'll do that.



> > +      if (homedir)
> > +	{
> > +	  homeinit = xstrprintf ("%s/%s", homedir, gdbinit);
> > +	  if (stat (homeinit, &homebuf) != 0)
> > +	    homeinit = NULL;
> > +
> > +	  stat (homeinit, &homebuf);
> > +	}
> 
> You've got a bunch of memory leaks in this function; this is one of
> them.  homeinit is not freed if it does not exist.

True. Even worse, this second call to stat is bogus. Sorry about that.
The patch in attachment should fix this and a couple of memory leaks.
Could you check that it is OK this time?
Thanks,
Jerome


2009-01-26  Daniel Jacobowitz  <dan@codesourcery.com>
	    Jerome Guitton  <guitton@adacore.com>

	* configure, config.in: Regenerated.
	* configure.ac: Add --with-system-gdbinit.
	* main.c (get_init_files): New.
	(captured_main): Use get_init_files.  Load system gdbinit before
	$HOME/.gdbinit.
	(print_gdb_help): Print location of init files.


[-- Attachment #2: system-wide-gdbinit.diff --]
[-- Type: text/x-diff, Size: 11349 bytes --]

Index: config.in
===================================================================
RCS file: /cvs/src/src/gdb/config.in,v
retrieving revision 1.104
diff -u -p -r1.104 config.in
--- config.in	9 Dec 2008 17:18:29 -0000	1.104
+++ config.in	26 Jan 2009 08:54:13 -0000
@@ -655,6 +655,13 @@
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
+/* System-wide gdbinit file. */
+#undef SYSTEM_GDBINIT
+
+/* Define if the system-wide gdbinit file should be relocated when GDB is
+   moved. */
+#undef SYSTEM_GDBINIT_RELOCATABLE
+
 /* Define if <thread_db.h> has the TD_NOTALLOC error code. */
 #undef THREAD_DB_HAS_TD_NOTALLOC
 
Index: configure
===================================================================
RCS file: /cvs/src/src/gdb/configure,v
retrieving revision 1.264
diff -u -p -r1.264 configure
--- configure	12 Jan 2009 01:10:27 -0000	1.264
+++ configure	26 Jan 2009 08:54:16 -0000
@@ -895,6 +895,7 @@ Optional Packages:
                           on systems with version 2 of the GNU C library
                           (use with caution on other system)
   --with-sysroot=DIR Search for usr/lib et al within DIR.
+  --with-system-gdbinit=file       Automatically load a system-wide gdbinit file
   --with-tcl              directory containing tcl configuration (tclConfig.sh)
   --with-tk               directory containing tk configuration (tkConfig.sh)
   --with-x                use the X Window System
@@ -19482,6 +19483,49 @@ fi;
 
 
 
+system_gdbinit=
+
+# Check whether --with-system-gdbinit or --without-system-gdbinit was given.
+if test "${with_system_gdbinit+set}" = set; then
+  withval="$with_system_gdbinit"
+  system_gdbinit=${withval}
+fi;
+
+
+  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+  test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+  ac_define_dir=`eval echo $system_gdbinit`
+  ac_define_dir=`eval echo $ac_define_dir`
+
+cat >>confdefs.h <<_ACEOF
+#define SYSTEM_GDBINIT "$ac_define_dir"
+_ACEOF
+
+
+
+if test "x$prefix" = xNONE; then
+  test_prefix=$ac_default_prefix
+else
+  test_prefix=$prefix
+fi
+if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
+  test_exec_prefix=$test_prefix
+else
+  test_exec_prefix=$exec_prefix
+fi
+case ${system_gdbinit} in
+ "${test_prefix}"|"${test_prefix}/"*|\
+ "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
+ '${prefix}'|'${prefix}/'*|\
+ '${exec_prefix}'|'${exec_prefix}/'*)
+
+cat >>confdefs.h <<\_ACEOF
+#define SYSTEM_GDBINIT_RELOCATABLE 1
+_ACEOF
+
+   ;;
+esac
+
 # Check whether --enable-werror or --disable-werror was given.
 if test "${enable_werror+set}" = set; then
   enableval="$enable_werror"
Index: configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/configure.ac,v
retrieving revision 1.84
diff -u -p -r1.84 configure.ac
--- configure.ac	12 Jan 2009 01:10:27 -0000	1.84
+++ configure.ac	26 Jan 2009 08:54:16 -0000
@@ -1489,6 +1489,34 @@ AC_ARG_WITH(sysroot,
 AC_SUBST(TARGET_SYSTEM_ROOT)
 AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
 
+system_gdbinit=
+AC_ARG_WITH(system-gdbinit,
+[  --with-system-gdbinit=file       Automatically load a system-wide gdbinit file],
+[system_gdbinit=${withval}])
+
+AC_DEFINE_DIR(SYSTEM_GDBINIT, system_gdbinit,
+              [System-wide gdbinit file.])
+
+if test "x$prefix" = xNONE; then
+  test_prefix=$ac_default_prefix
+else
+  test_prefix=$prefix
+fi
+if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
+  test_exec_prefix=$test_prefix
+else
+  test_exec_prefix=$exec_prefix
+fi
+case ${system_gdbinit} in
+ "${test_prefix}"|"${test_prefix}/"*|\
+ "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
+ '${prefix}'|'${prefix}/'*|\
+ '${exec_prefix}'|'${exec_prefix}/'*)
+  AC_DEFINE(SYSTEM_GDBINIT_RELOCATABLE, 1,
+            [Define if the system-wide gdbinit file should be relocated when GDB is moved.])
+   ;;
+esac
+
 AC_ARG_ENABLE(werror,
   [  --enable-werror    treat compile warnings as errors],
   [case "${enableval}" in
Index: main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.72
diff -u -p -r1.72 main.c
--- main.c	6 Jan 2009 18:31:59 -0000	1.72
+++ main.c	26 Jan 2009 08:54:16 -0000
@@ -83,6 +83,9 @@ int return_child_result_value = -1;
 /* Whether to enable writing into executable and core files */
 extern int write_files;
 
+/* GDB as it has been invoked from the command line (i.e. argv[0]).  */
+static char *gdb_program_name;
+
 static void print_gdb_help (struct ui_file *);
 
 /* These two are used to set the external editor commands when gdb is farming
@@ -90,6 +93,82 @@ static void print_gdb_help (struct ui_fi
 
 extern char *external_editor_command;
 
+/* Compute the locations of init files that GDB should source and return
+   them in SYSTEM_GDBINIT, HOME_GDBINIT, LOCAL_GDBINIT.  If there is 
+   no system gdbinit (resp. home gdbinit and local gdbinit) to be loaded,
+   then SYSTEM_GDBINIT (resp. HOME_GDBINIT and LOCAL_GDBINIT) is set to
+   NULL.  */
+static void
+get_init_files (char **system_gdbinit,
+		char **home_gdbinit,
+		char **local_gdbinit)
+{
+  static char *sysgdbinit = NULL;
+  static char *homeinit = NULL;
+  static char *localinit = NULL;
+  static int initialized = 0;
+
+  if (!initialized)
+    {
+      struct stat homebuf, cwdbuf, s;
+      char *homedir, *relocated_sysgdbinit;
+
+      sysgdbinit = SYSTEM_GDBINIT;
+      if (!sysgdbinit [0] || stat (sysgdbinit, &s) != 0)
+	sysgdbinit = NULL;
+
+#ifdef SYSTEM_GDBINIT_RELOCATABLE
+      relocated_sysgdbinit = make_relative_prefix (gdb_program_name, BINDIR,
+						   SYSTEM_GDBINIT);
+      if (relocated_sysgdbinit)
+	{
+	  struct stat s;
+	  int res = 0;
+
+	  if (stat (relocated_sysgdbinit, &s) == 0)
+	    sysgdbinit = relocated_sysgdbinit;
+	  else
+	    xfree (relocated_sysgdbinit);
+	}
+#endif
+
+      homedir = getenv ("HOME");
+
+      /* If the .gdbinit file in the current directory is the same as
+	 the $HOME/.gdbinit file, it should not be sourced.  homebuf
+	 and cwdbuf are used in that purpose. Make sure that the stats
+	 are zero in case one of them fails (this guarantees that they
+	 won't match if either exists).  */
+
+      memset (&homebuf, 0, sizeof (struct stat));
+      memset (&cwdbuf, 0, sizeof (struct stat));
+
+      if (homedir)
+	{
+	  homeinit = xstrprintf ("%s/%s", homedir, gdbinit);
+	  if (stat (homeinit, &homebuf) != 0)
+	    {
+	      xfree (homeinit);
+	      homeinit = NULL;
+	    }
+	}
+
+      if (stat (gdbinit, &cwdbuf) == 0)
+	{
+	  if (!homeinit
+	      || memcmp ((char *) &homebuf, (char *) &cwdbuf,
+			 sizeof (struct stat)))
+	    localinit = gdbinit;
+	}
+      
+      initialized = 1;
+    }
+
+  *system_gdbinit = sysgdbinit;
+  *home_gdbinit = homeinit;
+  *local_gdbinit = localinit;
+}
+
 /* Call command_loop.  If it happens to return, pass that through as a
    non-zero return status. */
 
@@ -156,8 +235,10 @@ captured_main (void *data)
   /* Number of elements used.  */
   int ndir;
 
-  struct stat homebuf, cwdbuf;
-  char *homedir;
+  /* gdb init files.  */
+  char *system_gdbinit;
+  char *home_gdbinit;
+  char *local_gdbinit;
 
   int i;
 
@@ -196,6 +277,8 @@ captured_main (void *data)
   gdb_stdtargerr = gdb_stderr;	/* for moment */
   gdb_stdtargin = gdb_stdin;	/* for moment */
 
+  gdb_program_name = xstrdup (argv[0]);
+
   if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)))
     /* Don't use *_filtered or warning() (which relies on
        current_target) until after initialize_all_files(). */
@@ -274,6 +357,8 @@ captured_main (void *data)
 	}
     }
 
+  get_init_files (&system_gdbinit, &home_gdbinit, &local_gdbinit);
+
   /* There will always be an interpreter.  Either the one passed into
      this captured main, or one specified by the user at start up, or
      the console.  Initialize the interpreter to the one requested by 
@@ -685,33 +770,20 @@ Excess command line arguments ignored. (
   quit_pre_print = error_pre_print;
   warning_pre_print = _("\nwarning: ");
 
+  /* Read and execute the system-wide gdbinit file, if it exists.
+     This is done *before* all the command line arguments are
+     processed; it sets global parameters, which are independent of
+     what file you are debugging or what directory you are in.  */
+  if (system_gdbinit && !inhibit_gdbinit)
+    catch_command_errors (source_script, system_gdbinit, 0, RETURN_MASK_ALL);
+
   /* Read and execute $HOME/.gdbinit file, if it exists.  This is done
      *before* all the command line arguments are processed; it sets
      global parameters, which are independent of what file you are
      debugging or what directory you are in.  */
-  homedir = getenv ("HOME");
-  if (homedir)
-    {
-      char *homeinit = xstrprintf ("%s/%s", homedir, gdbinit);
-
-      if (!inhibit_gdbinit)
-	{
-	  catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL);
-	}
-
-      /* Do stats; no need to do them elsewhere since we'll only
-         need them if homedir is set.  Make sure that they are
-         zero in case one of them fails (this guarantees that they
-         won't match if either exists).  */
 
-      memset (&homebuf, 0, sizeof (struct stat));
-      memset (&cwdbuf, 0, sizeof (struct stat));
-
-      stat (homeinit, &homebuf);
-      stat (gdbinit, &cwdbuf);	/* We'll only need this if
-				   homedir was set.  */
-      xfree (homeinit);
-    }
+  if (home_gdbinit && !inhibit_gdbinit)
+    catch_command_errors (source_script, home_gdbinit, 0, RETURN_MASK_ALL);
 
   /* Now perform all the actions indicated by the arguments.  */
   if (cdarg != NULL)
@@ -779,13 +851,8 @@ Can't attach to process and specify a co
 
   /* Read the .gdbinit file in the current directory, *if* it isn't
      the same as the $HOME/.gdbinit file (it should exist, also).  */
-
-  if (!homedir
-      || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
-    if (!inhibit_gdbinit)
-      {
-	catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL);
-      }
+  if (local_gdbinit && !inhibit_gdbinit)
+    catch_command_errors (source_script, local_gdbinit, 0, RETURN_MASK_ALL);
 
   for (i = 0; i < ncmd; i++)
     {
@@ -857,6 +924,12 @@ gdb_main (struct captured_main_args *arg
 static void
 print_gdb_help (struct ui_file *stream)
 {
+  char *system_gdbinit;
+  char *home_gdbinit;
+  char *local_gdbinit;
+
+  get_init_files (&system_gdbinit, &home_gdbinit, &local_gdbinit);
+
   fputs_unfiltered (_("\
 This is the GNU debugger.  Usage:\n\n\
     gdb [options] [executable-file [core-file or process-id]]\n\
@@ -919,6 +992,21 @@ Options:\n\n\
   --xdb              XDB compatibility mode.\n\
 "), stream);
   fputs_unfiltered (_("\n\
+At startup, GDB reads the following init files and executes their commands:\n\
+"), stream);
+  if (system_gdbinit)
+    fprintf_unfiltered (stream, _("\
+   * system-wide init file: %s\n\
+"), system_gdbinit);
+  if (home_gdbinit)
+    fprintf_unfiltered (stream, _("\
+   * user-specific init file: %s\n\
+"), home_gdbinit);
+  if (local_gdbinit)
+    fprintf_unfiltered (stream, _("\
+   * local init file: ./%s\n\
+"), local_gdbinit);
+  fputs_unfiltered (_("\n\
 For more information, type \"help\" from within GDB, or consult the\n\
 GDB manual (available as on-line info or a printed manual).\n\
 "), stream);

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-26  9:12             ` Jerome Guitton
@ 2009-01-26 14:59               ` Daniel Jacobowitz
  2009-01-28 15:06                 ` Jerome Guitton
  0 siblings, 1 reply; 21+ messages in thread
From: Daniel Jacobowitz @ 2009-01-26 14:59 UTC (permalink / raw)
  To: Jerome Guitton; +Cc: Eli Zaretskii, gdb-patches

On Mon, Jan 26, 2009 at 10:12:34AM +0100, Jerome Guitton wrote:
> 2009-01-26  Daniel Jacobowitz  <dan@codesourcery.com>
> 	    Jerome Guitton  <guitton@adacore.com>
> 
> 	* configure, config.in: Regenerated.
> 	* configure.ac: Add --with-system-gdbinit.
> 	* main.c (get_init_files): New.
> 	(captured_main): Use get_init_files.  Load system gdbinit before
> 	$HOME/.gdbinit.
> 	(print_gdb_help): Print location of init files.

This version looks OK to me.  Thanks!

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-26 14:59               ` Daniel Jacobowitz
@ 2009-01-28 15:06                 ` Jerome Guitton
  0 siblings, 0 replies; 21+ messages in thread
From: Jerome Guitton @ 2009-01-28 15:06 UTC (permalink / raw)
  To: Eli Zaretskii, gdb-patches

Daniel Jacobowitz (drow@false.org):

> On Mon, Jan 26, 2009 at 10:12:34AM +0100, Jerome Guitton wrote:
> > 2009-01-26  Daniel Jacobowitz  <dan@codesourcery.com>
> > 	    Jerome Guitton  <guitton@adacore.com>
> > 
> > 	* configure, config.in: Regenerated.
> > 	* configure.ac: Add --with-system-gdbinit.
> > 	* main.c (get_init_files): New.
> > 	(captured_main): Use get_init_files.  Load system gdbinit before
> > 	$HOME/.gdbinit.
> > 	(print_gdb_help): Print location of init files.
> 
> This version looks OK to me.  Thanks!

Now committed! Thank you.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Add support for --with-system-gdbinit
  2009-01-23 22:55               ` Eli Zaretskii
@ 2009-01-28 18:00                 ` Jerome Guitton
  0 siblings, 0 replies; 21+ messages in thread
From: Jerome Guitton @ 2009-01-28 18:00 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

Eli Zaretskii (eliz@gnu.org):

> > Date: Fri, 23 Jan 2009 18:24:46 +0100
> > From: Jerome Guitton <guitton@adacore.com>
> > Cc: gdb-patches@sourceware.org
> > 
> > > 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.
> 
> Thanks, this version is OK.

This has been committed as well. Thanks!


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2009-01-28 15:06 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-14 13:56 Add support for --with-system-gdbinit Daniel Jacobowitz
2009-01-14 19:39 ` Eli Zaretskii
2009-01-14 19:50   ` Daniel Jacobowitz
2009-01-14 20:22     ` Eli Zaretskii
2009-01-14 20:38       ` Daniel Jacobowitz
2009-01-14 21:55         ` Eli Zaretskii
2009-01-14 23:07           ` Daniel Jacobowitz
2009-01-15  4:10             ` Eli Zaretskii
2009-01-19 14:11     ` Jerome Guitton
2009-01-19 14:20       ` Daniel Jacobowitz
2009-01-19 18:40       ` Eli Zaretskii
2009-01-21 10:54         ` Jerome Guitton
2009-01-21 19:03           ` Eli Zaretskii
2009-01-23 17:24             ` Jerome Guitton
2009-01-23 22:55               ` Eli Zaretskii
2009-01-28 18:00                 ` Jerome Guitton
2009-01-23 17:42           ` Daniel Jacobowitz
2009-01-26  9:12             ` Jerome Guitton
2009-01-26 14:59               ` Daniel Jacobowitz
2009-01-28 15:06                 ` Jerome Guitton
2009-01-16 11:54 ` Jerome Guitton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox