From: "Eli Zaretskii" <eliz@gnu.org>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Get rid of xm-go32.h (was: [COMMIT] Get rid of xm-cygwin.h)
Date: Thu, 12 May 2005 21:46:00 -0000 [thread overview]
Message-ID: <01c5573a$Blat.v2.4$2d0a5a20@zahav.net.il> (raw)
In-Reply-To: <200505121904.j4CJ4l0f012030@elgar.sibelius.xs4all.nl> (message from Mark Kettenis on Thu, 12 May 2005 21:04:47 +0200 (CEST))
> Date: Thu, 12 May 2005 21:04:47 +0200 (CEST)
> From: Mark Kettenis <mark.kettenis@xs4all.nl>
> 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 <eliz@gnu.org>
* 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"
prev parent reply other threads:[~2005-05-12 21:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-06 8:07 [COMMIT] Get rid of xm-cygwin.h Mark Kettenis
2005-05-06 10:16 ` Eli Zaretskii
2005-05-12 12:16 ` [RFA] Get rid of xm-go32.h (was: [COMMIT] Get rid of xm-cygwin.h) Eli Zaretskii
2005-05-12 13:00 ` Daniel Jacobowitz
2005-05-12 13:26 ` Eli Zaretskii
2005-05-12 19:08 ` Mark Kettenis
2005-05-12 21:46 ` Eli Zaretskii [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='01c5573a$Blat.v2.4$2d0a5a20@zahav.net.il' \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=mark.kettenis@xs4all.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox