* Makefile.in (go32-nat.o): Add $(top_h) to prerequisites.

* go32-nat.c: Include top.h.  Update copyright years.
	(init_go32_ops): Override the default value of gdbinit[] with
	"gdb.ini".

	* cli/cli-cmds.c (init_cli_cmds): Use gdbinit[] instead of a
	compile-time literal string GDBINIT_FILENAME.

	* top.c (PATH_MAX): Define if not defined.
	(gdbinit): Declare with a constant size PATH_MAX.

	* config/i386/go32.mh (XM_FILE): Remove.

	* config/i386/xm-go32.h: Remove file.
This commit is contained in:
Eli Zaretskii 2005-05-12 21:23:17 +00:00
parent e0ecbda10d
commit eaae39195e
5 changed files with 21 additions and 31 deletions

View file

@ -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)

View file

@ -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."));

View file

@ -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"

View file

@ -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;

View file

@ -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;