* [COMMIT] Get rid of xm-cygwin.h @ 2005-05-06 8:07 Mark Kettenis 2005-05-06 10:16 ` Eli Zaretskii 0 siblings, 1 reply; 7+ messages in thread From: Mark Kettenis @ 2005-05-06 8:07 UTC (permalink / raw) To: gdb-patches; +Cc: eliz [Oops, forgot to send this last wednesday.] We always include "fopen-bin.h" now, and CRLF_SOURCE_FILES is gone too. So this is obvious! Eli, any chance you can get rid of xm-go32.h too? Overriding gdbinit from within go32-nat.c seems like an options for me. Mark 2005-05-04 Mark Kettenis <kettenis@gnu.org> * config/i386/cygwin.mh (XM_FILE): Remove variable. * config/i386/xm-cygwin.h: Remove file. Index: config/i386/cygwin.mh =================================================================== RCS file: /cvs/src/src/gdb/config/i386/cygwin.mh,v retrieving revision 1.6 diff -u -p -r1.6 cygwin.mh --- config/i386/cygwin.mh 4 Feb 2002 11:00:10 -0000 1.6 +++ config/i386/cygwin.mh 4 May 2005 16:24:23 -0000 @@ -1,5 +1,4 @@ MH_CFLAGS= -XM_FILE=xm-cygwin.h NATDEPFILES= i386-nat.o win32-nat.o corelow.o NAT_FILE=nm-cygwin.h XM_CLIBS= ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [COMMIT] Get rid of xm-cygwin.h 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 0 siblings, 1 reply; 7+ messages in thread From: Eli Zaretskii @ 2005-05-06 10:16 UTC (permalink / raw) To: Mark Kettenis; +Cc: gdb-patches > 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. ^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFA] Get rid of xm-go32.h (was: [COMMIT] Get rid of xm-cygwin.h) 2005-05-06 10:16 ` Eli Zaretskii @ 2005-05-12 12:16 ` Eli Zaretskii 2005-05-12 13:00 ` Daniel Jacobowitz 2005-05-12 19:08 ` Mark Kettenis 0 siblings, 2 replies; 7+ messages in thread From: Eli Zaretskii @ 2005-05-12 12:16 UTC (permalink / raw) To: gdb-patches > 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. 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 <eliz@gnu.org> * 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; ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Get rid of xm-go32.h (was: [COMMIT] Get rid of xm-cygwin.h) 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 1 sibling, 1 reply; 7+ messages in thread From: Daniel Jacobowitz @ 2005-05-12 13:00 UTC (permalink / raw) To: Eli Zaretskii; +Cc: gdb-patches On Thu, May 12, 2005 at 11:55:30AM +0300, Eli Zaretskii wrote: > > 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. > > 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? FWIW, I like this solution. Do we still need either of those targets? I haven't seen reports of anyone using them in the time I've been a GDB developer. -- Daniel Jacobowitz CodeSourcery, LLC ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Get rid of xm-go32.h (was: [COMMIT] Get rid of xm-cygwin.h) 2005-05-12 13:00 ` Daniel Jacobowitz @ 2005-05-12 13:26 ` Eli Zaretskii 0 siblings, 0 replies; 7+ messages in thread From: Eli Zaretskii @ 2005-05-12 13:26 UTC (permalink / raw) To: gdb-patches > Date: Thu, 12 May 2005 08:41:42 -0400 > From: Daniel Jacobowitz <drow@false.org> > Cc: gdb-patches@sourceware.org > > FWIW, I like this solution. Thanks for reviewing the patch. > Do we still need either of those targets? I haven't seen reports of > anyone using them in the time I've been a GDB developer. If we think they are no longer needed, we should begin by declaring them obsolete in NEWS. We could then stop bothering about updating them. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Get rid of xm-go32.h (was: [COMMIT] Get rid of xm-cygwin.h) 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 19:08 ` Mark Kettenis 2005-05-12 21:46 ` Eli Zaretskii 1 sibling, 1 reply; 7+ messages in thread From: Mark Kettenis @ 2005-05-12 19:08 UTC (permalink / raw) To: eliz; +Cc: gdb-patches 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Get rid of xm-go32.h (was: [COMMIT] Get rid of xm-cygwin.h) 2005-05-12 19:08 ` Mark Kettenis @ 2005-05-12 21:46 ` Eli Zaretskii 0 siblings, 0 replies; 7+ messages in thread From: Eli Zaretskii @ 2005-05-12 21:46 UTC (permalink / raw) To: Mark Kettenis; +Cc: gdb-patches > 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" ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-05-12 21:35 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 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 is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox