From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 361 invoked by alias); 12 May 2005 21:35:57 -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 32750 invoked from network); 12 May 2005 21:35:49 -0000 Received: from unknown (HELO legolas.inter.net.il) (192.114.186.24) by sourceware.org with SMTP; 12 May 2005 21:35:49 -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 EJA15496 (AUTH halo1); Fri, 13 May 2005 00:35:38 +0300 (IDT) Date: Thu, 12 May 2005 21:46:00 -0000 From: "Eli Zaretskii" To: Mark Kettenis Message-ID: <01c5573a$Blat.v2.4$2d0a5a20@zahav.net.il> Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=ISO-8859-1 CC: gdb-patches@sourceware.org In-reply-to: <200505121904.j4CJ4l0f012030@elgar.sibelius.xs4all.nl> (message from Mark Kettenis on Thu, 12 May 2005 21:04:47 +0200 (CEST)) Subject: Re: [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> <01c556d0$Blat.v2.4$7f0d6de0@zahav.net.il> <200505121904.j4CJ4l0f012030@elgar.sibelius.xs4all.nl> X-SW-Source: 2005-05/txt/msg00315.txt.bz2 > Date: Thu, 12 May 2005 21:04:47 +0200 (CEST) > From: Mark Kettenis > CC: gdb-patches@sourceware.org > > I'd happily see tm-cisco.h and tm-os68k.h removed. But if there are > reasons to keep them, or if you don't feel like doing the legwork > needed to remove the associated targets completely, just remove the > definition of GDBINIT_FILENAME from those files. Will do the latter. (As I told earlier in this thread, I don't think we should remove these targets without going through deprecating them first, which should be announced in NEWS.) > -XM_FILE= xm-go32.h > +XM_FILE= > > NAT_FILE= nm-go32.h > NATDEPFILES= go32-nat.o i386-nat.o > > Please remove XM_FILE completely. Done. > +#ifndef PATH_MAX > +# ifdef FILENAME_MAX > +# define PATH_MAX FILENAME_MAX > +# else > +# define PATH_MAX 512 > +# endif > +#endif > > I think the proper constant to use here is NAME_MAX, which is the > POSIX standard for the "Maximum number of bytes in a filename (not > including terminating null)". I don't want to use NAME_MAX because it's too conservative on some platforms. For example, DJGPP sets it to 12, which limits it to 8+3 names. I know that PATH_MAX can be as large as 4K on some platforms, but I think that waste is not important enough to care about. I committed the patches with PATH_MAX, but if you insist, I will change that to NAME_MAX in a separate patch. > Why not simply write: > > char gdbinit[NAME_MAX + 1] = ".gdbinit"; Done. > init_cli_cmds (void) > { > struct cmd_list_element *c; > + char *source_help_text; > + extern char gdbinit[]; > > Please don't add new 'externs'. Include "top.h" instead. Done. Here's the patch that was actually committed: 2005-05-13 Eli Zaretskii * 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. Don't define 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. Index: gdb/config/i386/go32.mh =================================================================== RCS file: /cvs/src/src/gdb/config/i386/go32.mh,v retrieving revision 1.8 diff -u -r1.8 go32.mh --- gdb/config/i386/go32.mh 20 Jan 2004 09:29:17 -0000 1.8 +++ gdb/config/i386/go32.mh 12 May 2005 21:14:34 -0000 @@ -1,8 +1,6 @@ # Host: Intel x86 running DJGPP MH_CFLAGS= -XM_FILE= xm-go32.h - NAT_FILE= nm-go32.h NATDEPFILES= go32-nat.o i386-nat.o Index: gdb/cli/cli-cmds.c =================================================================== RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v retrieving revision 1.59 diff -u -r1.59 cli-cmds.c --- gdb/cli/cli-cmds.c 28 Apr 2005 20:32:41 -0000 1.59 +++ gdb/cli/cli-cmds.c 12 May 2005 21:15:16 -0000 @@ -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 @@ 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 @@ 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.")); Index: gdb/Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.728 diff -u -r1.728 Makefile.in --- gdb/Makefile.in 12 May 2005 20:21:18 -0000 1.728 +++ gdb/Makefile.in 12 May 2005 21:16:10 -0000 @@ -1993,7 +1993,7 @@ 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) Index: gdb/config/i386/xm-go32.h =================================================================== RCS file: /cvs/src/src/gdb/config/i386/xm-go32.h,v retrieving revision 1.9 diff -u -r1.9 xm-go32.h --- gdb/config/i386/xm-go32.h 2004-11-13 17:00:02 1.9 +++ /dev/null 2005-05-12 08:47:16 @@ -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"