aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/Makefile.in2
-rw-r--r--gdb/cli/cli-cmds.c13
-rw-r--r--gdb/config/i386/xm-go32.h21
-rw-r--r--gdb/go32-nat.c6
-rw-r--r--gdb/top.c10
5 files changed, 21 insertions, 31 deletions
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index a971bff..4241ffd 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1993,7 +1993,7 @@ gnu-v3-abi.o: gnu-v3-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(cp_support_h) \
go32-nat.o: go32-nat.c $(defs_h) $(inferior_h) $(gdb_wait_h) $(gdbcore_h) \
$(command_h) $(gdbcmd_h) $(floatformat_h) $(buildsym_h) \
$(i387_tdep_h) $(i386_tdep_h) $(value_h) $(regcache_h) \
- $(gdb_string_h)
+ $(gdb_string_h) $(top_h)
h8300-tdep.o: h8300-tdep.c $(defs_h) $(value_h) $(arch_utils_h) $(regcache_h) \
$(gdbcore_h) $(objfiles_h) $(gdb_assert_h) $(dis_asm_h) \
$(dwarf2_frame_h) $(frame_base_h) $(frame_unwind_h)
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 3d25f1a..af11096 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -50,10 +50,6 @@
#include "tui/tui.h" /* For tui_active et.al. */
#endif
-#ifndef GDBINIT_FILENAME
-#define GDBINIT_FILENAME ".gdbinit"
-#endif
-
/* Prototypes for local command functions */
static void complete_command (char *, int);
@@ -1100,6 +1096,7 @@ void
init_cli_cmds (void)
{
struct cmd_list_element *c;
+ char *source_help_text;
/* Define the classes of commands.
They will appear in the help list in the reverse of this order. */
@@ -1164,10 +1161,12 @@ End with a line of just \"end\".\n\
Use the \"document\" command to give documentation for the new command.\n\
Commands defined in this way may have up to ten arguments."));
- c = add_cmd ("source", class_support, source_command, _("\
+ source_help_text = xstrprintf (_("\
Read commands from a file named FILE.\n\
-Note that the file \"" GDBINIT_FILENAME "\" is read automatically in this way\n\
-when gdb is started."), &cmdlist);
+Note that the file \"%s\" is read automatically in this way\n\
+when gdb is started."), gdbinit);
+ c = add_cmd ("source", class_support, source_command,
+ source_help_text, &cmdlist);
set_cmd_completer (c, filename_completer);
add_com ("quit", class_support, quit_command, _("Exit gdb."));
diff --git a/gdb/config/i386/xm-go32.h b/gdb/config/i386/xm-go32.h
deleted file mode 100644
index 168c5d7..0000000
--- a/gdb/config/i386/xm-go32.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Host-dependent definitions for Intel x86 running DJGPP.
- Copyright 1993-1996 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#define GDBINIT_FILENAME "gdb.ini"
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index 9758129..0556f57 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -1,5 +1,5 @@
/* Native debugging support for Intel x86 running DJGPP.
- Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1997, 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
Written by Robert Hoehne.
This file is part of GDB.
@@ -34,6 +34,7 @@
#include "value.h"
#include "regcache.h"
#include "gdb_string.h"
+#include "top.h"
#include <stdio.h> /* might be required for __DJGPP_MINOR__ */
#include <stdlib.h>
@@ -894,6 +895,9 @@ init_go32_ops (void)
/* We are always processing GCC-compiled programs. */
processing_gcc_compilation = 2;
+
+ /* Override the default name of the GDB init file. */
+ strcpy (gdbinit, "gdb.ini");
}
unsigned short windows_major, windows_minor;
diff --git a/gdb/top.c b/gdb/top.c
index b56a3cf..1bd22e3 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -71,10 +71,18 @@
/* 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
+
#ifndef GDBINIT_FILENAME
#define GDBINIT_FILENAME ".gdbinit"
#endif
-char gdbinit[] = GDBINIT_FILENAME;
+char gdbinit[PATH_MAX + 1] = GDBINIT_FILENAME;
int inhibit_gdbinit = 0;