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]

Setting up GDB init files broken in DJGPP


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


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