Reimplement DJGPP's .gdbinit -> gdb.ini renaming.

This simplifies the .gdbinit filename selection logic.

We have a GDBINIT_FILENAME define that supposedly configurations would
override, but none do so.  Instead, the only configuration that wants
a different file name instead of ".gdbinit", djgpp, does a strcpy over
the gdbinit global array.  This means the array needs to be sized, and
the code that does that is doing the usual
'PATH_MAX/FILENAME_MAX/fallback constant/etc.' mess.

Instead of all that, it's much simpler to have configure specificy the
.gdbinit filename.  As bonus, we can then make the "gdbinit" global
array const.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* configure.ac (GDBINIT): Define, depending on host.
	* go32-nat.c (init_go32_ops): Don't override gdbinit here.
	* top.c (PATH_MAX): Delete fallback definition.
	(GDBINIT_FILENAME): Delete.
	(gdbinit): Reimplement as const char array set to the GDBINIT
	string constant.
	* top.h (gdbinit): Make const.
This commit is contained in:
Pedro Alves
2013-07-01 11:24:17 +00:00
parent 50dd979345
commit e655c1a2f5
7 changed files with 42 additions and 17 deletions

14
gdb/configure vendored
View File

@ -12329,6 +12329,20 @@ $as_echo "#define HAVE_PERSONALITY 1" >>confdefs.h
fi
case $host_os in
go32* | *djgpp*)
gdbinit=gdb.ini
;;
*)
gdbinit=.gdbinit
;;
esac
cat >>confdefs.h <<_ACEOF
#define GDBINIT "$gdbinit"
_ACEOF
# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
# except that the argument to --with-sysroot is optional.