This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Setting up GDB init files broken in DJGPP
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Jerome Guitton <guitton at adacore dot com>
- Cc: Eli Zaretskii <eliz at gnu dot org>, Daniel Jacobowitz <drow at false dot org>, gdb-patches at sourceware dot org
- Date: Wed, 22 Apr 2009 12:38:12 -0700
- Subject: Re: Setting up GDB init files broken in DJGPP
- References: <83ljq3m999.fsf@gnu.org> <20090417174113.GA4851@adacore.com>
> 2009-04-17 Jerome Guitton <guitton@adacore.com>
>
> * main.c (captured_main): Move gdbinit lookups after gdb_init.
This looks fine, but I propose we move this call further down, past
the blocks that do an early exist if --version or --help is specified,
as well as past the interpreter initialization. If those fail, no point
in spending time computing these files. That also corresponds better
to what used to be done before.
I'm testing the attached patch... (Jerome is supposed to be on holiday)
--
Joel
commit 9493d644c2a2cb3464cf139515be528a6e140ffe
Author: Joel Brobecker <brobecker@adacore.com>
Date: Wed Apr 22 12:35:50 2009 -0700
* main.c (captured_main): Move gdbinit lookups further down,
making sure it's not called until the basename of the gdbinit file
has been set.
diff --git a/gdb/main.c b/gdb/main.c
index 86607d3..2f6cd75 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -359,8 +359,6 @@ captured_main (void *data)
}
}
- get_init_files (&system_gdbinit, &home_gdbinit, &local_gdbinit);
-
#ifdef RELOC_SRCDIR
add_substitute_path_rule (RELOC_SRCDIR,
make_relative_prefix (argv[0], BINDIR,
@@ -778,6 +776,8 @@ Excess command line arguments ignored. (%s%s)\n"),
quit_pre_print = error_pre_print;
warning_pre_print = _("\nwarning: ");
+ get_init_files (&system_gdbinit, &home_gdbinit, &local_gdbinit);
+
/* 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