From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: eliz@gnu.org
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 19:08:00 -0000 [thread overview]
Message-ID: <200505121904.j4CJ4l0f012030@elgar.sibelius.xs4all.nl> (raw)
In-Reply-To: <01c556d0$Blat.v2.4$7f0d6de0@zahav.net.il> (eliz@gnu.org)
Date: Thu, 12 May 2005 11:55:30 +0300
From: "Eli Zaretskii" <eliz@gnu.org>
> Date: Fri, 06 May 2005 13:14:08 +0300
> From: "Eli Zaretskii" <eliz@gnu.org>
> CC: gdb-patches@sourceware.org
>
> > Date: Fri, 6 May 2005 10:07:09 +0200
> > From: Mark Kettenis <kettenis@gnu.org>
> > 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.
Thanks!
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?
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.
--- 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
Please remove XM_FILE completely.
--- 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
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)". Hmm, so the code should actually use
`NAME_MAX + 1' for the array size.
#ifndef GDBINIT_FILENAME
#define GDBINIT_FILENAME ".gdbinit"
#endif
-char gdbinit[] = GDBINIT_FILENAME;
+char gdbinit[PATH_MAX];
Why not simply write:
char gdbinit[NAME_MAX + 1] = ".gdbinit";
That way we don't need the strcpy in gdb_init().
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[];
Please don't add new 'externs'. Include "top.h" instead.
Mark
next prev parent reply other threads:[~2005-05-12 19:05 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 [this message]
2005-05-12 21:46 ` Eli Zaretskii
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=200505121904.j4CJ4l0f012030@elgar.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
/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