This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Setting up GDB init files broken in DJGPP
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Daniel Jacobowitz <drow at false dot org>, Jerome Guitton <guitton at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 14 Apr 2009 20:32:18 +0300
- Subject: Setting up GDB init files broken in DJGPP
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
AFAICS, this change:
2009-01-28 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.
broke the DJGPP port, in that it now looks for ~/.gdbinit rather than
~/gdb.ini. (The former is an invalid file name on DOS filesystems.)
So all the gdb.ini files, such as the ones generated while building
GDB and Emacs, are no longer sourced.
The problem is that the change not only introduced a new function
get_init_files and moved the code that looked up the gdbinit file(s)
there from captured_main, but it also caused the code which looks for
these files to be run _before_ initialize_all_files (which is called
inside gdb_init). In fact, it moved the code even before the
command-line arguments are parsed and acted upon. The DJGPP build
overrides the default value of gdbinit, assigned in top.c from
GDBINIT_FILENAME, inside init_go32_ops, but that is called in
initialize_all_files, which now is too late.
I've re-read the discussion about this change back in last December,
and I couldn't find anything there that would explain why the order of
the code execution was changed. Can someone tell whether there were
such reasons, and if so, what they were? If not, perhaps simply
moving the code after the call to gdb_init is all that's needed to fix
this.
TIA