From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12992 invoked by alias); 12 May 2005 08:59:42 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 12835 invoked from network); 12 May 2005 08:58:54 -0000 Received: from unknown (HELO legolas.inter.net.il) (192.114.186.24) by sourceware.org with SMTP; 12 May 2005 08:58:54 -0000 Received: from zaretski (IGLD-83-130-254-105.inter.net.il [83.130.254.105]) by legolas.inter.net.il (MOS 3.5.6-GR) with ESMTP id EIX06345 (AUTH halo1); Thu, 12 May 2005 11:58:52 +0300 (IDT) Date: Thu, 12 May 2005 12:16:00 -0000 From: "Eli Zaretskii" To: gdb-patches@sourceware.org Message-ID: <01c556d0$Blat.v2.4$7f0d6de0@zahav.net.il> Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=ISO-8859-1 In-reply-to: <01c55224$Blat.v2.4$7c5b84c0@zahav.net.il> (eliz@gnu.org) Subject: [RFA] Get rid of xm-go32.h (was: [COMMIT] Get rid of xm-cygwin.h) Reply-to: Eli Zaretskii References: <200505060807.j468795E005472@jop31.nfra.nl> <01c55224$Blat.v2.4$7c5b84c0@zahav.net.il> X-SW-Source: 2005-05/txt/msg00268.txt.bz2 > Date: Fri, 06 May 2005 13:14:08 +0300 > From: "Eli Zaretskii" > CC: gdb-patches@sourceware.org > > > Date: Fri, 6 May 2005 10:07:09 +0200 > > From: Mark Kettenis > > CC: eliz@gnu.org > > > > Eli, any chance you can get rid of xm-go32.h too? > > Chance, yes. We have a public holiday coming up, I hope I will have > time to finally keep my promise to Andrew. The holiday came, and here's what I have in my sandbox. Is this way of solving the issue of non-standard init file names is acceptable? If so, I will commit the changes. Note that tm-cisco.h and tm-os68k.h override the standard definition of GDBINIT_FILENAME. Should we switch those platforms to the dynamic initialization as well? 2005-05-11 Eli Zaretskii * config/i386/xm-go32.h: Remove file. * config/i386/go32.mh (XM_FILE): Remove xm-go32.h. * go32-nat.c (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 and don't initialize statically. (gdb_init): Initialize gdbinit[] dynamically using GDBINIT_FILENAME. --- gdb/config/i386/xm-go32.h~0 2004-11-13 19:00:02.000000000 +0200 +++ /dev/null 2005-05-12 11:47:16.000000000 +0300 @@ -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" --- gdb/config/i386/go32.m~0 2004-01-20 11:29:16.000000000 +0200 +++ gdb/config/i386/go32.mh 2005-05-11 19:32:58.000000000 +0300 @@ -1,7 +1,7 @@ # Host: Intel x86 running DJGPP MH_CFLAGS= -XM_FILE= xm-go32.h +XM_FILE= NAT_FILE= nm-go32.h NATDEPFILES= go32-nat.o i386-nat.o --- gdb/top.c~0 2005-02-24 15:51:34.000000000 +0200 +++ gdb/top.c 2005-05-11 19:10:20.000000000 +0300 @@ -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]; int inhibit_gdbinit = 0; @@ -1521,6 +1529,11 @@ gdb_init (char *argv0) if (pre_init_ui_hook) pre_init_ui_hook (); + /* Set up the default name of the init file. Specific configs can + override this in some _init_FOO function on one of their source + files. */ + strcpy (gdbinit, GDBINIT_FILENAME); + /* Run the init function of each source file */ getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); --- gdb/cli/cli-cmds.c~0 2005-04-28 23:32:40.000000000 +0300 +++ gdb/cli/cli-cmds.c 2005-05-11 19:21:58.000000000 +0300 @@ -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,8 @@ void init_cli_cmds (void) { struct cmd_list_element *c; + char *source_help_text; + extern char gdbinit[]; /* Define the classes of commands. They will appear in the help list in the reverse of this order. */ @@ -1164,10 +1162,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.")); --- gdb/go32-nat.c~0 2005-02-15 17:49:10.000000000 +0200 +++ gdb/go32-nat.c 2005-05-11 19:31:04.000000000 +0300 @@ -848,6 +848,8 @@ go32_terminal_ours (void) static void init_go32_ops (void) { + extern char gdbinit[]; + go32_ops.to_shortname = "djgpp"; go32_ops.to_longname = "djgpp target process"; go32_ops.to_doc = @@ -894,6 +896,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;