From e655c1a2f59367d66f81e446f39b84e9eeee1465 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 1 Jul 2013 11:24:17 +0000 Subject: 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 * 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. --- gdb/top.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'gdb/top.c') diff --git a/gdb/top.c b/gdb/top.c index 8ac756f..e78897f 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -78,20 +78,9 @@ extern void initialize_all_files (void); #define DEFAULT_PROMPT "(gdb) " #endif -/* Initialization file name for gdb. This is overridden in some configs. */ - -#ifndef PATH_MAX -# ifdef FILENAME_MAX -# define PATH_MAX FILENAME_MAX -# else -# define PATH_MAX 512 -# endif -#endif +/* Initialization file name for gdb. This is host-dependent. */ -#ifndef GDBINIT_FILENAME -#define GDBINIT_FILENAME ".gdbinit" -#endif -char gdbinit[PATH_MAX + 1] = GDBINIT_FILENAME; +const char gdbinit[] = GDBINIT; int inhibit_gdbinit = 0; -- cgit v1.1