Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* --with-pkgversion and --with-bugurl support for GDB
@ 2008-05-19 20:46 Joseph S. Myers
  2008-05-20  0:05 ` Eli Zaretskii
  0 siblings, 1 reply; 15+ messages in thread
From: Joseph S. Myers @ 2008-05-19 20:46 UTC (permalink / raw)
  To: gdb-patches

This patch adds support for the --with-pkgversion and --with-bugurl 
configure options to GDB.  These options are used to specify a version and 
bug-reporting URL for a packaged version of GDB, and are supported by GCC 
and GNU Binutils using the same configure macros as this patch makes GDB 
use.

A previous version was submitted by Vladimir in 2006
<http://sourceware.org/ml/gdb-patches/2006-07/msg00171.html>; since
then, the feature has been added to GCC and GNU Binutils as noted
above, so addressing
<http://sourceware.org/ml/gdb-patches/2006-07/msg00173.html> which was
the only comment on the previous patch.

This patch deals with GDB proper, the manual, gdbserver and gdbreplay
(to which previously missing --version and --help support is added).
We have a patch for the simulators as well, but I'd like to resolve
any issues with this patch before preparing that one for submission.

Tested on i686-pc-linux-gnu.  OK to commit?

2008-05-19  Vladimir Prus  <vladimir@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* acinclude.m4: Include ../config/acx.m4.
	* configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
	* configure: Regenerate.
	* Makefile.in (PKGVERSION, REPORT_BUGS_TO): Define.
	(GDB_CFLAGS): Define to include PKGVERSION and REPORT_BUGS_TO
	settings.
	* main.c (print_gdb_help): Use REPORT_BUGS_TO for bug-reporting
	address.
	* top.c (print_gdb_version): Use PKGVERSION and REPORT_BUGS_TO.

doc:
2008-05-19  Vladimir Prus  <vladimir@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* configure.ac: Include ../../config/acx.m4.  Use ACX_PKGVERSION
	and ACX_BUGURL.
	* configure: Regenerate.
	* Makefile.in (PKGVERSION, BUGURL_TEXI): Define.
	(GDBvn.texi): Define VERSION_PACKAGE and BUGURL.
	* gdb.texinfo: Use VERSION_PACKAGE and BUGURL.  Remove
	mailing-list-specific text about bug reporting.

gdbserver:
2008-05-19  Vladimir Prus  <vladimir@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* acinclude.m4: Include ../../config/acx.m4.
	* configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
	* configure: Regenerate.
	* Makefile.in (PKGVERSION, REPORT_BUGS_TO): New.
	(GLOBAL_CFLAGS): Add them.
	(gdbreplay$(EXEEXT)): Add version.o.
	* server.c (gdbserver_version): Print PKGVERSION.
	(gdbsrever_usage): Add stream parameter.  Print REPORT_BUGS_TO.
	(main): Adjust gdbserver_usage calls.
	* gdbreplay.c (version, host_name): Add declarations.
	(gdbreplay_version, gdbreplay_usage): New.
	(main): Accept --version and --help options.

Index: gdb/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.1021
diff -u -p -r1.1021 Makefile.in
--- gdb/Makefile.in	16 May 2008 12:51:21 -0000	1.1021
+++ gdb/Makefile.in	19 May 2008 15:50:41 -0000
@@ -348,7 +348,11 @@ CONFIG_UNINSTALL = @CONFIG_UNINSTALL@
 # your system doesn't have fcntl.h in /usr/include (which is where it
 # should be according to Posix).
 DEFS = @DEFS@
-GDB_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/config -DLOCALEDIR="\"$(localedir)\"" $(DEFS)
+PKGVERSION := "\"@PKGVERSION@\""
+REPORT_BUGS_TO = "\"@REPORT_BUGS_TO@\""
+GDB_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/config \
+   -DLOCALEDIR="\"$(localedir)\"" -DPKGVERSION=$(PKGVERSION) \
+   -DREPORT_BUGS_TO=$(REPORT_BUGS_TO) $(DEFS)
 
 # MH_CFLAGS, if defined, has host-dependent CFLAGS from the config directory.
 GLOBAL_CFLAGS = $(MH_CFLAGS)
Index: gdb/acinclude.m4
===================================================================
RCS file: /cvs/src/src/gdb/acinclude.m4,v
retrieving revision 1.18
diff -u -p -r1.18 acinclude.m4
--- gdb/acinclude.m4	23 Apr 2008 12:21:47 -0000	1.18
+++ gdb/acinclude.m4	19 May 2008 15:50:42 -0000
@@ -20,6 +20,9 @@ sinclude(../config/lib-ld.m4)
 sinclude(../config/lib-prefix.m4)
 sinclude(../config/lib-link.m4)
 
+dnl For ACX_PKGVERSION and ACX_BUGURL.
+sinclude(../config/acx.m4)
+
 #
 # Sometimes the native compiler is a bogus stub for gcc or /usr/ucb/cc. This
 # makes configure think it's cross compiling. If --target wasn't used, then
Index: gdb/configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/configure.ac,v
retrieving revision 1.68
diff -u -p -r1.68 configure.ac
--- gdb/configure.ac	19 Apr 2008 05:06:54 -0000	1.68
+++ gdb/configure.ac	19 May 2008 15:50:44 -0000
@@ -362,6 +362,9 @@ if test "$enable_profiling" = yes ; then
   CFLAGS="$OLD_CFLAGS"
 fi
 
+ACX_PKGVERSION([GDB])
+ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/])
+
 # --------------------- #
 # Checks for programs.  #
 # --------------------- #
Index: gdb/main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.67
diff -u -p -r1.67 main.c
--- gdb/main.c	14 Mar 2008 17:21:07 -0000	1.67
+++ gdb/main.c	19 May 2008 15:50:44 -0000
@@ -966,6 +966,9 @@ Options:\n\n\
   fputs_unfiltered (_("\n\
 For more information, type \"help\" from within GDB, or consult the\n\
 GDB manual (available as on-line info or a printed manual).\n\
-Report bugs to \"bug-gdb@gnu.org\".\
 "), stream);
+  if (REPORT_BUGS_TO[0] && stream == gdb_stdout)
+    fprintf_unfiltered (stream, _("\
+Report bugs to \"%s\".\n\
+"), REPORT_BUGS_TO);
 }
Index: gdb/top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.141
diff -u -p -r1.141 top.c
--- gdb/top.c	5 May 2008 09:47:46 -0000	1.141
+++ gdb/top.c	19 May 2008 15:50:45 -0000
@@ -1125,7 +1125,7 @@ print_gdb_version (struct ui_file *strea
      program to parse, and is just canonical program name and version
      number, which starts after last space. */
 
-  fprintf_filtered (stream, "GNU gdb %s\n", version);
+  fprintf_filtered (stream, "GNU gdb %s%s\n", PKGVERSION, version);
 
   /* Second line is a copyright notice. */
 
@@ -1154,6 +1154,12 @@ and \"show warranty\" for details.\n");
       fprintf_filtered (stream, "%s", host_name);
     }
   fprintf_filtered (stream, "\".");
+
+#ifdef REPORT_BUGS_TO
+  fprintf_filtered (stream, 
+		    _("\nFor bug reporting instructions, please see:\n"));
+  fprintf_filtered (stream, "%s.\n", REPORT_BUGS_TO);
+#endif
 }
 \f
 /* get_prompt: access method for the GDB prompt string.  */
Index: gdb/doc/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/doc/Makefile.in,v
retrieving revision 1.41
diff -u -p -r1.41 Makefile.in
--- gdb/doc/Makefile.in	1 Jan 2008 22:53:14 -0000	1.41
+++ gdb/doc/Makefile.in	19 May 2008 15:50:45 -0000
@@ -61,6 +61,10 @@ TEXI2ROFF=texi2roff
 # where to find texi2dvi, ditto
 TEXI2DVI=texi2dvi
 
+# Package version and bug-reporting URL.
+PKGVERSION = @PKGVERSION@
+BUGURL_TEXI = @REPORT_BUGS_TEXI@
+
 # Where is the source dir for the READLINE library doc?  
 # Traditionally readline is in .. or .
 READLINE_DIR = ${gdbdir}/../readline/doc
@@ -279,6 +283,10 @@ refcard.pdf : refcard.tex $(REFEDITS)
 # File to record current GDB version number (copied from main dir version.in)
 GDBvn.texi : ${gdbdir}/version.in
 	echo "@set GDBVN `sed q $(srcdir)/../version.in`" > ./GDBvn.new
+	if [ -n "$(PKGVERSION)" ]; then \
+	  echo "@set VERSION_PACKAGE $(PKGVERSION)" >> ./GDBvn.new; \
+	fi
+	echo "@set BUGURL $(BUGURL_TEXI)" >> ./GDBvn.new
 	mv GDBvn.new GDBvn.texi
 
 # Updated atomically
Index: gdb/doc/configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/doc/configure.ac,v
retrieving revision 1.1
diff -u -p -r1.1 configure.ac
--- gdb/doc/configure.ac	7 Jan 2005 21:53:22 -0000	1.1
+++ gdb/doc/configure.ac	19 May 2008 15:50:45 -0000
@@ -1,5 +1,8 @@
 AC_PREREQ(2.59)
 AC_INIT(refcard.tex)
+sinclude(../../config/acx.m4)
 AC_PROG_INSTALL
 AC_PROG_LN_S
+ACX_PKGVERSION([GDB])
+ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/])
 AC_OUTPUT(Makefile)
Index: gdb/doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.495
diff -u -p -r1.495 gdb.texinfo
--- gdb/doc/gdb.texinfo	9 May 2008 17:02:01 -0000	1.495
+++ gdb/doc/gdb.texinfo	19 May 2008 15:50:51 -0000
@@ -49,6 +49,9 @@ This file documents the @sc{gnu} debugge
 
 This is the @value{EDITION} Edition, of @cite{Debugging with
 @value{GDBN}: the @sc{gnu} Source-Level Debugger} for @value{GDBN}
+@ifset VERSION_PACKAGE
+@value{VERSION_PACKAGE}
+@end ifset
 Version @value{GDBVN}.
 
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,@*
@@ -72,11 +75,15 @@ developing GNU and promoting software fr
 @subtitle The @sc{gnu} Source-Level Debugger
 @sp 1
 @subtitle @value{EDITION} Edition, for @value{GDBN} version @value{GDBVN}
+@ifset VERSION_PACKAGE
+@sp 1
+@subtitle @value{VERSION_PACKAGE}
+@end ifset
 @author Richard Stallman, Roland Pesch, Stan Shebs, et al.
 @page
 @tex
 {\parskip=0pt
-\hfill (Send bugs and comments on @value{GDBN} to bug-gdb\@gnu.org.)\par
+\hfill (Send bugs and comments on @value{GDBN} to @value{BUGURL}.)\par
 \hfill {\it Debugging with @value{GDBN}}\par
 \hfill \TeX{}info \texinfoversion\par
 }
@@ -116,8 +123,11 @@ software in general.  We will miss him.
 
 This file describes @value{GDBN}, the @sc{gnu} symbolic debugger.
 
-This is the @value{EDITION} Edition, for @value{GDBN} Version
-@value{GDBVN}.
+This is the @value{EDITION} Edition, for @value{GDBN}
+@ifset VERSION_PACKAGE
+@value{VERSION_PACKAGE}
+@end ifset
+Version @value{GDBVN}.
 
 Copyright (C) 1988-2006 Free Software Foundation, Inc.
 
@@ -22632,25 +22642,10 @@ individuals in the file @file{etc/SERVIC
 distribution.
 @c should add a web page ref...
 
+@ifset BUGURL
 In any event, we also recommend that you submit bug reports for
-@value{GDBN}.  The preferred method is to submit them directly using
-@uref{http://www.gnu.org/software/gdb/bugs/, @value{GDBN}'s Bugs web
-page}.  Alternatively, the @email{bug-gdb@@gnu.org, e-mail gateway} can
-be used.
-
-@strong{Do not send bug reports to @samp{info-gdb}, or to
-@samp{help-gdb}, or to any newsgroups.}  Most users of @value{GDBN} do
-not want to receive bug reports.  Those that do have arranged to receive
-@samp{bug-gdb}.
-
-The mailing list @samp{bug-gdb} has a newsgroup @samp{gnu.gdb.bug} which
-serves as a repeater.  The mailing list and the newsgroup carry exactly
-the same messages.  Often people think of posting bug reports to the
-newsgroup instead of mailing them.  This appears to work, but it has one
-problem which can be crucial: a newsgroup posting often lacks a mail
-path back to the sender.  Thus, if we need to ask for more information,
-we may be unable to reach you.  For this reason, it is better to send
-bug reports to the mailing list.
+@value{GDBN} to @value{BUGURL}.
+@end ifset
 
 The fundamental principle of reporting bugs usefully is this:
 @strong{report all the facts}.  If you are not sure whether to state a
Index: gdb/gdbserver/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/Makefile.in,v
retrieving revision 1.58
diff -u -p -r1.58 Makefile.in
--- gdb/gdbserver/Makefile.in	3 May 2008 17:16:43 -0000	1.58
+++ gdb/gdbserver/Makefile.in	19 May 2008 15:50:51 -0000
@@ -87,9 +87,13 @@ READLINE_DEP = $$(READLINE_DIR)
 # -I$(srcdir)/../regformats for regdef.h.
 INCLUDE_CFLAGS = -I. -I${srcdir} -I$(srcdir)/../regformats -I$(INCLUDE_DIR)
 
+PKGVERSION := "\"@PKGVERSION@\""
+REPORT_BUGS_TO = "\"@REPORT_BUGS_TO@\""
+
 # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
 # from the config/ directory.
-GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS}
+GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS} -DPKGVERSION=$(PKGVERSION) \
+   -DREPORT_BUGS_TO=$(REPORT_BUGS_TO)
 #PROFILE_CFLAGS = -pg
 
 WARN_CFLAGS = -Wall
@@ -194,9 +198,9 @@ gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} $
 	${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbserver$(EXEEXT) $(OBS) \
 	  $(GDBSERVER_LIBS) $(XM_CLIBS)
 
-gdbreplay$(EXEEXT): gdbreplay.o
+gdbreplay$(EXEEXT): gdbreplay.o version.o
 	rm -f gdbreplay$(EXEEXT)
-	${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbreplay$(EXEEXT) gdbreplay.o \
+	${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbreplay$(EXEEXT) $^ \
 	  $(XM_CLIBS)
 
 # Put the proper machine-specific files first, so M-. on a machine
Index: gdb/gdbserver/acinclude.m4
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/acinclude.m4,v
retrieving revision 1.6
diff -u -p -r1.6 acinclude.m4
--- gdb/gdbserver/acinclude.m4	23 Apr 2008 12:21:50 -0000	1.6
+++ gdb/gdbserver/acinclude.m4	19 May 2008 15:50:51 -0000
@@ -4,6 +4,9 @@ sinclude(../../bfd/bfd.m4)
 dnl This gets autoconf bugfixes
 sinclude(../../config/override.m4)
 
+dnl For ACX_PKGVERSION and ACX_BUGURL.
+sinclude(../../config/acx.m4)
+
 AC_DEFUN([SRV_CHECK_THREAD_DB],
 [AC_CACHE_CHECK([for libthread_db],[srv_cv_thread_db],
  [old_LIBS="$LIBS"
Index: gdb/gdbserver/configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/configure.ac,v
retrieving revision 1.22
diff -u -p -r1.22 configure.ac
--- gdb/gdbserver/configure.ac	14 Apr 2008 18:04:00 -0000	1.22
+++ gdb/gdbserver/configure.ac	19 May 2008 15:50:52 -0000
@@ -68,6 +68,9 @@ AC_CHECK_TYPES(socklen_t, [], [],
 #include <sys/socket.h>
 ])
 
+ACX_PKGVERSION([GDB])
+ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/])
+
 . ${srcdir}/configure.srv
 
 if test "${srv_mingwce}" = "yes"; then
Index: gdb/gdbserver/gdbreplay.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/gdbreplay.c,v
retrieving revision 1.16
diff -u -p -r1.16 gdbreplay.c
--- gdb/gdbserver/gdbreplay.c	1 Jan 2008 22:53:14 -0000	1.16
+++ gdb/gdbserver/gdbreplay.c	19 May 2008 15:50:52 -0000
@@ -69,6 +69,10 @@ typedef int socklen_t;
 /* Sort of a hack... */
 #define EOL (EOF - 1)
 
+/* Version information, from version.c.  */
+extern const char version[];
+extern const char host_name[];
+
 static int remote_desc;
 
 #ifdef __MINGW32CE__
@@ -387,16 +391,44 @@ play (FILE *fp)
     }
 }
 
+static void
+gdbreplay_version (void)
+{
+  printf ("GNU gdbreplay %s%s\n"
+	  "Copyright (C) 2008 Free Software Foundation, Inc.\n"
+	  "gdbserver is free software, covered by the GNU General Public License.\n"
+	  "This gdbserver was configured as \"%s\"\n",
+	  PKGVERSION, version, host_name);
+}
+
+static void
+gdbreplay_usage (FILE *stream)
+{
+  fprintf (stream, "Usage:\tgdbreplay <logfile> <host:port>\n");
+  if (REPORT_BUGS_TO[0] && stream == stdout)
+    fprintf (stream, "Report bugs to \"%s\".\n", REPORT_BUGS_TO);
+}
+
 int
 main (int argc, char *argv[])
 {
   FILE *fp;
   int ch;
 
+  if (argc >= 2 && strcmp (argv[1], "--version") == 0)
+    {
+      gdbreplay_version ();
+      exit (0);
+    }
+  if (argc >= 2 && strcmp (argv[1], "--help") == 0)
+    {
+      gdbreplay_usage (stdout);
+      exit (0);
+    }
+
   if (argc < 3)
     {
-      fprintf (stderr, "Usage: gdbreplay <logfile> <host:port>\n");
-      fflush (stderr);
+      gdbreplay_usage (stderr);
       exit (1);
     }
   fp = fopen (argv[1], "r");
Index: gdb/gdbserver/server.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/server.c,v
retrieving revision 1.72
diff -u -p -r1.72 server.c
--- gdb/gdbserver/server.c	9 May 2008 17:37:36 -0000	1.72
+++ gdb/gdbserver/server.c	19 May 2008 15:50:52 -0000
@@ -1178,26 +1178,28 @@ myresume (char *own_buf, int step, int *
 static void
 gdbserver_version (void)
 {
-  printf ("GNU gdbserver %s\n"
+  printf ("GNU gdbserver %s%s\n"
 	  "Copyright (C) 2007 Free Software Foundation, Inc.\n"
 	  "gdbserver is free software, covered by the GNU General Public License.\n"
 	  "This gdbserver was configured as \"%s\"\n",
-	  version, host_name);
+	  PKGVERSION, version, host_name);
 }
 
 static void
-gdbserver_usage (void)
+gdbserver_usage (FILE *stream)
 {
-  printf ("Usage:\tgdbserver [OPTIONS] COMM PROG [ARGS ...]\n"
-	  "\tgdbserver [OPTIONS] --attach COMM PID\n"
-	  "\tgdbserver [OPTIONS] --multi COMM\n"
-	  "\n"
-	  "COMM may either be a tty device (for serial debugging), or \n"
-	  "HOST:PORT to listen for a TCP connection.\n"
-	  "\n"
-	  "Options:\n"
-	  "  --debug\t\tEnable debugging output.\n"
-	  "  --wrapper WRAPPER --\tRun WRAPPER to start new programs.\n");
+  fprintf (stream, "Usage:\tgdbserver [OPTIONS] COMM PROG [ARGS ...]\n"
+	   "\tgdbserver [OPTIONS] --attach COMM PID\n"
+	   "\tgdbserver [OPTIONS] --multi COMM\n"
+	   "\n"
+	   "COMM may either be a tty device (for serial debugging), or \n"
+	   "HOST:PORT to listen for a TCP connection.\n"
+	   "\n"
+	   "Options:\n"
+	   "  --debug\t\tEnable debugging output.\n"
+	   "  --wrapper WRAPPER --\tRun WRAPPER to start new programs.\n");
+  if (REPORT_BUGS_TO[0] && stream == stdout)
+    fprintf (stream, "Report bugs to \"%s\".\n", REPORT_BUGS_TO);
 }
 
 #undef require_running
@@ -1234,7 +1236,7 @@ main (int argc, char *argv[])
 	}
       else if (strcmp (*next_arg, "--help") == 0)
 	{
-	  gdbserver_usage ();
+	  gdbserver_usage (stdout);
 	  exit (0);
 	}
       else if (strcmp (*next_arg, "--attach") == 0)
@@ -1251,7 +1253,7 @@ main (int argc, char *argv[])
 
 	  if (next_arg == wrapper_argv || *next_arg == NULL)
 	    {
-	      gdbserver_usage ();
+	      gdbserver_usage (stderr);
 	      exit (1);
 	    }
 
@@ -1280,7 +1282,7 @@ main (int argc, char *argv[])
   next_arg++;
   if (port == NULL || (!attach && !multi_mode && *next_arg == NULL))
     {
-      gdbserver_usage ();
+      gdbserver_usage (stderr);
       exit (1);
     }
 
@@ -1305,7 +1307,7 @@ main (int argc, char *argv[])
 
   if (bad_attach)
     {
-      gdbserver_usage ();
+      gdbserver_usage (stderr);
       exit (1);
     }
 

-- 
Joseph S. Myers
joseph@codesourcery.com


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-pkgversion and --with-bugurl support for GDB
  2008-05-19 20:46 --with-pkgversion and --with-bugurl support for GDB Joseph S. Myers
@ 2008-05-20  0:05 ` Eli Zaretskii
  2008-05-20  3:26   ` Joseph S. Myers
  0 siblings, 1 reply; 15+ messages in thread
From: Eli Zaretskii @ 2008-05-20  0:05 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: gdb-patches

> Date: Mon, 19 May 2008 17:06:55 +0000 (UTC)
> From: "Joseph S. Myers" <joseph@codesourcery.com>
> 
> 	* gdb.texinfo: Use VERSION_PACKAGE and BUGURL.  Remove
> 	mailing-list-specific text about bug reporting.

Thanks.  This part of the patch is approved, except...

> +@ifset BUGURL
>  In any event, we also recommend that you submit bug reports for
> -@value{GDBN}.  The preferred method is to submit them directly using
> -@uref{http://www.gnu.org/software/gdb/bugs/, @value{GDBN}'s Bugs web
> -page}.  Alternatively, the @email{bug-gdb@@gnu.org, e-mail gateway} can
> -be used.
> -
> -@strong{Do not send bug reports to @samp{info-gdb}, or to
> -@samp{help-gdb}, or to any newsgroups.}  Most users of @value{GDBN} do
> -not want to receive bug reports.  Those that do have arranged to receive
> -@samp{bug-gdb}.
> -
> -The mailing list @samp{bug-gdb} has a newsgroup @samp{gnu.gdb.bug} which
> -serves as a repeater.  The mailing list and the newsgroup carry exactly
> -the same messages.  Often people think of posting bug reports to the
> -newsgroup instead of mailing them.  This appears to work, but it has one
> -problem which can be crucial: a newsgroup posting often lacks a mail
> -path back to the sender.  Thus, if we need to ask for more information,
> -we may be unable to reach you.  For this reason, it is better to send
> -bug reports to the mailing list.
> +@value{GDBN} to @value{BUGURL}.
> +@end ifset

Why do you want to remove all this stuff?  If you don't want it under
BUGURL/VERSION_PACKAGE (whose utility, I must admit, I don't fully
understand), then please leave it alone when BUGURL is NOT set.  If
you _really_ think it's a good idea to remove this text
unconditionally, please at least tell why you think so.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-pkgversion and --with-bugurl support for GDB
  2008-05-20  0:05 ` Eli Zaretskii
@ 2008-05-20  3:26   ` Joseph S. Myers
  2008-05-20 15:25     ` Eli Zaretskii
  0 siblings, 1 reply; 15+ messages in thread
From: Joseph S. Myers @ 2008-05-20  3:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

On Mon, 19 May 2008, Eli Zaretskii wrote:

> > +@ifset BUGURL
> >  In any event, we also recommend that you submit bug reports for
> > -@value{GDBN}.  The preferred method is to submit them directly using
> > -@uref{http://www.gnu.org/software/gdb/bugs/, @value{GDBN}'s Bugs web
> > -page}.  Alternatively, the @email{bug-gdb@@gnu.org, e-mail gateway} can
> > -be used.
> > -
> > -@strong{Do not send bug reports to @samp{info-gdb}, or to
> > -@samp{help-gdb}, or to any newsgroups.}  Most users of @value{GDBN} do
> > -not want to receive bug reports.  Those that do have arranged to receive
> > -@samp{bug-gdb}.
> > -
> > -The mailing list @samp{bug-gdb} has a newsgroup @samp{gnu.gdb.bug} which
> > -serves as a repeater.  The mailing list and the newsgroup carry exactly
> > -the same messages.  Often people think of posting bug reports to the
> > -newsgroup instead of mailing them.  This appears to work, but it has one
> > -problem which can be crucial: a newsgroup posting often lacks a mail
> > -path back to the sender.  Thus, if we need to ask for more information,
> > -we may be unable to reach you.  For this reason, it is better to send
> > -bug reports to the mailing list.
> > +@value{GDBN} to @value{BUGURL}.
> > +@end ifset
> 
> Why do you want to remove all this stuff?  If you don't want it under
> BUGURL/VERSION_PACKAGE (whose utility, I must admit, I don't fully
> understand), then please leave it alone when BUGURL is NOT set.  If
> you _really_ think it's a good idea to remove this text
> unconditionally, please at least tell why you think so.

The only case when BUGURL is not set is when someone has used 
--without-bugurl, which has the specific effect of disabling bug reporting 
information.  By default, it's set to 
http://www.gnu.org/software/gdb/bugs/ - that's the effect of ACX_BUGURL, 
the default URL is passed to it.

I do not see any mention of info-gdb or help-gdb at 
<http://www.gnu.org/software/gdb/mailing-lists/>, so I think that part of 
the information is obsolete.  It also appears that, in practice, little 
use is made of bug-gdb and the bug database is the recommended approach.  
Thus, it seems to me that the appropriate default is to refer to whatever 
BUGURL is, which by default is the web page where further information is 
present about information to put in bug reports, and which may be 
configured by any distributor to point to their own bug database.  Should 
we wish to document alternative methods for reporting bugs in FSF GDB, or 
to add information or caveats about those methods, I think the right 
approach is to add the information to that web page (GCC for example has a 
very extensive web page with instructions at 
<http://gcc.gnu.org/bugs.html>).  This means the useful part of the 
information in the manual is the pointer to the web page.

-- 
Joseph S. Myers
joseph@codesourcery.com


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-pkgversion and --with-bugurl support for GDB
  2008-05-20  3:26   ` Joseph S. Myers
@ 2008-05-20 15:25     ` Eli Zaretskii
  2008-05-20 18:24       ` Joseph S. Myers
  0 siblings, 1 reply; 15+ messages in thread
From: Eli Zaretskii @ 2008-05-20 15:25 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: gdb-patches

> Date: Mon, 19 May 2008 19:50:42 +0000 (UTC)
> From: "Joseph S. Myers" <joseph@codesourcery.com>
> cc: gdb-patches@sourceware.org
> 
> I do not see any mention of info-gdb or help-gdb at 
> <http://www.gnu.org/software/gdb/mailing-lists/>, so I think that part of 
> the information is obsolete.

The right place to check whether these lists exist is
http://lists.gnu.org/mailman/listinfo/.  In any case, the text that
referred to these two said NOT to use them.

> It also appears that, in practice, little 
> use is made of bug-gdb and the bug database is the recommended approach.  
> Thus, it seems to me that the appropriate default is to refer to whatever 
> BUGURL is, which by default is the web page where further information is 
> present about information to put in bug reports, and which may be 
> configured by any distributor to point to their own bug database.  Should 
> we wish to document alternative methods for reporting bugs in FSF GDB, or 
> to add information or caveats about those methods, I think the right 
> approach is to add the information to that web page (GCC for example has a 
> very extensive web page with instructions at 
> <http://gcc.gnu.org/bugs.html>).

Sorry, I don't agree.  I think the manual should have clear
instructions on how to report bugs efficiently.  I don't like to ask
users to study Web pages to know that when they are already reading
documentation.

I don't mind removing obsolete information, but please either update
the rest to talk about bug-gdb and gdb@sources.redhat.com, or leave it
intact and I will get to updating it when I have time.

Thanks.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-pkgversion and --with-bugurl support for GDB
  2008-05-20 15:25     ` Eli Zaretskii
@ 2008-05-20 18:24       ` Joseph S. Myers
  2008-05-21  2:54         ` Eli Zaretskii
                           ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Joseph S. Myers @ 2008-05-20 18:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

On Tue, 20 May 2008, Eli Zaretskii wrote:

> Sorry, I don't agree.  I think the manual should have clear
> instructions on how to report bugs efficiently.  I don't like to ask
> users to study Web pages to know that when they are already reading
> documentation.
> 
> I don't mind removing obsolete information, but please either update
> the rest to talk about bug-gdb and gdb@sources.redhat.com, or leave it
> intact and I will get to updating it when I have time.

This version keeps the original text if the default BUGURL value is
used.  Tested with and without --with-bugurl use.  OK to commit?

2008-05-20  Vladimir Prus  <vladimir@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* acinclude.m4: Include ../config/acx.m4.
	* configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
	* configure: Regenerate.
	* Makefile.in (PKGVERSION, REPORT_BUGS_TO): Define.
	(GDB_CFLAGS): Define to include PKGVERSION and REPORT_BUGS_TO
	settings.
	* main.c (print_gdb_help): Use REPORT_BUGS_TO for bug-reporting
	address.
	* top.c (print_gdb_version): Use PKGVERSION and REPORT_BUGS_TO.

doc:
2008-05-20  Vladimir Prus  <vladimir@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* configure.ac: Include ../../config/acx.m4.  Use ACX_PKGVERSION
	and ACX_BUGURL.
	* configure: Regenerate.
	* Makefile.in (PKGVERSION, BUGURL_TEXI): Define.
	(GDBvn.texi): Define VERSION_PACKAGE, BUGURL and BUGURL_DEFAULT.
	* gdb.texinfo: Use VERSION_PACKAGE and BUGURL.  Remove
	mailing-list-specific text about bug reporting unless
	BUGURL_DEFAULT.

gdbserver:
2008-05-20  Vladimir Prus  <vladimir@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* acinclude.m4: Include ../../config/acx.m4.
	* configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
	* configure: Regenerate.
	* Makefile.in (PKGVERSION, REPORT_BUGS_TO): New.
	(GLOBAL_CFLAGS): Add them.
	(gdbreplay$(EXEEXT)): Add version.o.
	* server.c (gdbserver_version): Print PKGVERSION.
	(gdbsrever_usage): Add stream parameter.  Print REPORT_BUGS_TO.
	(main): Adjust gdbserver_usage calls.
	* gdbreplay.c (version, host_name): Add declarations.
	(gdbreplay_version, gdbreplay_usage): New.
	(main): Accept --version and --help options.

Index: gdb/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.1021
diff -u -p -r1.1021 Makefile.in
--- gdb/Makefile.in	16 May 2008 12:51:21 -0000	1.1021
+++ gdb/Makefile.in	20 May 2008 16:05:54 -0000
@@ -348,7 +348,11 @@ CONFIG_UNINSTALL = @CONFIG_UNINSTALL@
 # your system doesn't have fcntl.h in /usr/include (which is where it
 # should be according to Posix).
 DEFS = @DEFS@
-GDB_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/config -DLOCALEDIR="\"$(localedir)\"" $(DEFS)
+PKGVERSION := "\"@PKGVERSION@\""
+REPORT_BUGS_TO = "\"@REPORT_BUGS_TO@\""
+GDB_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/config \
+   -DLOCALEDIR="\"$(localedir)\"" -DPKGVERSION=$(PKGVERSION) \
+   -DREPORT_BUGS_TO=$(REPORT_BUGS_TO) $(DEFS)
 
 # MH_CFLAGS, if defined, has host-dependent CFLAGS from the config directory.
 GLOBAL_CFLAGS = $(MH_CFLAGS)
Index: gdb/acinclude.m4
===================================================================
RCS file: /cvs/src/src/gdb/acinclude.m4,v
retrieving revision 1.18
diff -u -p -r1.18 acinclude.m4
--- gdb/acinclude.m4	23 Apr 2008 12:21:47 -0000	1.18
+++ gdb/acinclude.m4	20 May 2008 16:05:54 -0000
@@ -20,6 +20,9 @@ sinclude(../config/lib-ld.m4)
 sinclude(../config/lib-prefix.m4)
 sinclude(../config/lib-link.m4)
 
+dnl For ACX_PKGVERSION and ACX_BUGURL.
+sinclude(../config/acx.m4)
+
 #
 # Sometimes the native compiler is a bogus stub for gcc or /usr/ucb/cc. This
 # makes configure think it's cross compiling. If --target wasn't used, then
Index: gdb/configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/configure.ac,v
retrieving revision 1.68
diff -u -p -r1.68 configure.ac
--- gdb/configure.ac	19 Apr 2008 05:06:54 -0000	1.68
+++ gdb/configure.ac	20 May 2008 16:05:56 -0000
@@ -362,6 +362,9 @@ if test "$enable_profiling" = yes ; then
   CFLAGS="$OLD_CFLAGS"
 fi
 
+ACX_PKGVERSION([GDB])
+ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/])
+
 # --------------------- #
 # Checks for programs.  #
 # --------------------- #
Index: gdb/main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.67
diff -u -p -r1.67 main.c
--- gdb/main.c	14 Mar 2008 17:21:07 -0000	1.67
+++ gdb/main.c	20 May 2008 16:05:56 -0000
@@ -966,6 +966,9 @@ Options:\n\n\
   fputs_unfiltered (_("\n\
 For more information, type \"help\" from within GDB, or consult the\n\
 GDB manual (available as on-line info or a printed manual).\n\
-Report bugs to \"bug-gdb@gnu.org\".\
 "), stream);
+  if (REPORT_BUGS_TO[0] && stream == gdb_stdout)
+    fprintf_unfiltered (stream, _("\
+Report bugs to \"%s\".\n\
+"), REPORT_BUGS_TO);
 }
Index: gdb/top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.141
diff -u -p -r1.141 top.c
--- gdb/top.c	5 May 2008 09:47:46 -0000	1.141
+++ gdb/top.c	20 May 2008 16:05:57 -0000
@@ -1125,7 +1125,7 @@ print_gdb_version (struct ui_file *strea
      program to parse, and is just canonical program name and version
      number, which starts after last space. */
 
-  fprintf_filtered (stream, "GNU gdb %s\n", version);
+  fprintf_filtered (stream, "GNU gdb %s%s\n", PKGVERSION, version);
 
   /* Second line is a copyright notice. */
 
@@ -1154,6 +1154,12 @@ and \"show warranty\" for details.\n");
       fprintf_filtered (stream, "%s", host_name);
     }
   fprintf_filtered (stream, "\".");
+
+#ifdef REPORT_BUGS_TO
+  fprintf_filtered (stream, 
+		    _("\nFor bug reporting instructions, please see:\n"));
+  fprintf_filtered (stream, "%s.\n", REPORT_BUGS_TO);
+#endif
 }
 \f
 /* get_prompt: access method for the GDB prompt string.  */
Index: gdb/doc/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/doc/Makefile.in,v
retrieving revision 1.41
diff -u -p -r1.41 Makefile.in
--- gdb/doc/Makefile.in	1 Jan 2008 22:53:14 -0000	1.41
+++ gdb/doc/Makefile.in	20 May 2008 16:05:57 -0000
@@ -61,6 +61,10 @@ TEXI2ROFF=texi2roff
 # where to find texi2dvi, ditto
 TEXI2DVI=texi2dvi
 
+# Package version and bug-reporting URL.
+PKGVERSION = @PKGVERSION@
+BUGURL_TEXI = @REPORT_BUGS_TEXI@
+
 # Where is the source dir for the READLINE library doc?  
 # Traditionally readline is in .. or .
 READLINE_DIR = ${gdbdir}/../readline/doc
@@ -279,6 +283,13 @@ refcard.pdf : refcard.tex $(REFEDITS)
 # File to record current GDB version number (copied from main dir version.in)
 GDBvn.texi : ${gdbdir}/version.in
 	echo "@set GDBVN `sed q $(srcdir)/../version.in`" > ./GDBvn.new
+	if [ -n "$(PKGVERSION)" ]; then \
+	  echo "@set VERSION_PACKAGE $(PKGVERSION)" >> ./GDBvn.new; \
+	fi
+	echo "@set BUGURL $(BUGURL_TEXI)" >> ./GDBvn.new
+	if [ "$(BUGURL_TEXI)" = "@uref{http://www.gnu.org/software/gdb/bugs/}" ]; then \
+	  echo "@set BUGURL_DEFAULT" >> ./GDBvn.new; \
+	fi
 	mv GDBvn.new GDBvn.texi
 
 # Updated atomically
Index: gdb/doc/configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/doc/configure.ac,v
retrieving revision 1.1
diff -u -p -r1.1 configure.ac
--- gdb/doc/configure.ac	7 Jan 2005 21:53:22 -0000	1.1
+++ gdb/doc/configure.ac	20 May 2008 16:05:59 -0000
@@ -1,5 +1,8 @@
 AC_PREREQ(2.59)
 AC_INIT(refcard.tex)
+sinclude(../../config/acx.m4)
 AC_PROG_INSTALL
 AC_PROG_LN_S
+ACX_PKGVERSION([GDB])
+ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/])
 AC_OUTPUT(Makefile)
Index: gdb/doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.495
diff -u -p -r1.495 gdb.texinfo
--- gdb/doc/gdb.texinfo	9 May 2008 17:02:01 -0000	1.495
+++ gdb/doc/gdb.texinfo	20 May 2008 16:06:04 -0000
@@ -49,6 +49,9 @@ This file documents the @sc{gnu} debugge
 
 This is the @value{EDITION} Edition, of @cite{Debugging with
 @value{GDBN}: the @sc{gnu} Source-Level Debugger} for @value{GDBN}
+@ifset VERSION_PACKAGE
+@value{VERSION_PACKAGE}
+@end ifset
 Version @value{GDBVN}.
 
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,@*
@@ -72,11 +75,15 @@ developing GNU and promoting software fr
 @subtitle The @sc{gnu} Source-Level Debugger
 @sp 1
 @subtitle @value{EDITION} Edition, for @value{GDBN} version @value{GDBVN}
+@ifset VERSION_PACKAGE
+@sp 1
+@subtitle @value{VERSION_PACKAGE}
+@end ifset
 @author Richard Stallman, Roland Pesch, Stan Shebs, et al.
 @page
 @tex
 {\parskip=0pt
-\hfill (Send bugs and comments on @value{GDBN} to bug-gdb\@gnu.org.)\par
+\hfill (Send bugs and comments on @value{GDBN} to @value{BUGURL}.)\par
 \hfill {\it Debugging with @value{GDBN}}\par
 \hfill \TeX{}info \texinfoversion\par
 }
@@ -116,8 +123,11 @@ software in general.  We will miss him.
 
 This file describes @value{GDBN}, the @sc{gnu} symbolic debugger.
 
-This is the @value{EDITION} Edition, for @value{GDBN} Version
-@value{GDBVN}.
+This is the @value{EDITION} Edition, for @value{GDBN}
+@ifset VERSION_PACKAGE
+@value{VERSION_PACKAGE}
+@end ifset
+Version @value{GDBVN}.
 
 Copyright (C) 1988-2006 Free Software Foundation, Inc.
 
@@ -22632,6 +22642,8 @@ individuals in the file @file{etc/SERVIC
 distribution.
 @c should add a web page ref...
 
+@ifset BUGURL
+@ifset BUGURL_DEFAULT
 In any event, we also recommend that you submit bug reports for
 @value{GDBN}.  The preferred method is to submit them directly using
 @uref{http://www.gnu.org/software/gdb/bugs/, @value{GDBN}'s Bugs web
@@ -22651,6 +22663,12 @@ problem which can be crucial: a newsgrou
 path back to the sender.  Thus, if we need to ask for more information,
 we may be unable to reach you.  For this reason, it is better to send
 bug reports to the mailing list.
+@end ifset
+@ifclear BUGURL_DEFAULT
+In any event, we also recommend that you submit bug reports for
+@value{GDBN} to @value{BUGURL}.
+@end ifclear
+@end ifset
 
 The fundamental principle of reporting bugs usefully is this:
 @strong{report all the facts}.  If you are not sure whether to state a
Index: gdb/gdbserver/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/Makefile.in,v
retrieving revision 1.58
diff -u -p -r1.58 Makefile.in
--- gdb/gdbserver/Makefile.in	3 May 2008 17:16:43 -0000	1.58
+++ gdb/gdbserver/Makefile.in	20 May 2008 16:06:04 -0000
@@ -87,9 +87,13 @@ READLINE_DEP = $$(READLINE_DIR)
 # -I$(srcdir)/../regformats for regdef.h.
 INCLUDE_CFLAGS = -I. -I${srcdir} -I$(srcdir)/../regformats -I$(INCLUDE_DIR)
 
+PKGVERSION := "\"@PKGVERSION@\""
+REPORT_BUGS_TO = "\"@REPORT_BUGS_TO@\""
+
 # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
 # from the config/ directory.
-GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS}
+GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS} -DPKGVERSION=$(PKGVERSION) \
+   -DREPORT_BUGS_TO=$(REPORT_BUGS_TO)
 #PROFILE_CFLAGS = -pg
 
 WARN_CFLAGS = -Wall
@@ -194,9 +198,9 @@ gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} $
 	${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbserver$(EXEEXT) $(OBS) \
 	  $(GDBSERVER_LIBS) $(XM_CLIBS)
 
-gdbreplay$(EXEEXT): gdbreplay.o
+gdbreplay$(EXEEXT): gdbreplay.o version.o
 	rm -f gdbreplay$(EXEEXT)
-	${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbreplay$(EXEEXT) gdbreplay.o \
+	${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbreplay$(EXEEXT) $^ \
 	  $(XM_CLIBS)
 
 # Put the proper machine-specific files first, so M-. on a machine
Index: gdb/gdbserver/acinclude.m4
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/acinclude.m4,v
retrieving revision 1.6
diff -u -p -r1.6 acinclude.m4
--- gdb/gdbserver/acinclude.m4	23 Apr 2008 12:21:50 -0000	1.6
+++ gdb/gdbserver/acinclude.m4	20 May 2008 16:06:04 -0000
@@ -4,6 +4,9 @@ sinclude(../../bfd/bfd.m4)
 dnl This gets autoconf bugfixes
 sinclude(../../config/override.m4)
 
+dnl For ACX_PKGVERSION and ACX_BUGURL.
+sinclude(../../config/acx.m4)
+
 AC_DEFUN([SRV_CHECK_THREAD_DB],
 [AC_CACHE_CHECK([for libthread_db],[srv_cv_thread_db],
  [old_LIBS="$LIBS"
Index: gdb/gdbserver/configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/configure.ac,v
retrieving revision 1.22
diff -u -p -r1.22 configure.ac
--- gdb/gdbserver/configure.ac	14 Apr 2008 18:04:00 -0000	1.22
+++ gdb/gdbserver/configure.ac	20 May 2008 16:06:05 -0000
@@ -68,6 +68,9 @@ AC_CHECK_TYPES(socklen_t, [], [],
 #include <sys/socket.h>
 ])
 
+ACX_PKGVERSION([GDB])
+ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/])
+
 . ${srcdir}/configure.srv
 
 if test "${srv_mingwce}" = "yes"; then
Index: gdb/gdbserver/gdbreplay.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/gdbreplay.c,v
retrieving revision 1.16
diff -u -p -r1.16 gdbreplay.c
--- gdb/gdbserver/gdbreplay.c	1 Jan 2008 22:53:14 -0000	1.16
+++ gdb/gdbserver/gdbreplay.c	20 May 2008 16:06:05 -0000
@@ -69,6 +69,10 @@ typedef int socklen_t;
 /* Sort of a hack... */
 #define EOL (EOF - 1)
 
+/* Version information, from version.c.  */
+extern const char version[];
+extern const char host_name[];
+
 static int remote_desc;
 
 #ifdef __MINGW32CE__
@@ -387,16 +391,44 @@ play (FILE *fp)
     }
 }
 
+static void
+gdbreplay_version (void)
+{
+  printf ("GNU gdbreplay %s%s\n"
+	  "Copyright (C) 2008 Free Software Foundation, Inc.\n"
+	  "gdbserver is free software, covered by the GNU General Public License.\n"
+	  "This gdbserver was configured as \"%s\"\n",
+	  PKGVERSION, version, host_name);
+}
+
+static void
+gdbreplay_usage (FILE *stream)
+{
+  fprintf (stream, "Usage:\tgdbreplay <logfile> <host:port>\n");
+  if (REPORT_BUGS_TO[0] && stream == stdout)
+    fprintf (stream, "Report bugs to \"%s\".\n", REPORT_BUGS_TO);
+}
+
 int
 main (int argc, char *argv[])
 {
   FILE *fp;
   int ch;
 
+  if (argc >= 2 && strcmp (argv[1], "--version") == 0)
+    {
+      gdbreplay_version ();
+      exit (0);
+    }
+  if (argc >= 2 && strcmp (argv[1], "--help") == 0)
+    {
+      gdbreplay_usage (stdout);
+      exit (0);
+    }
+
   if (argc < 3)
     {
-      fprintf (stderr, "Usage: gdbreplay <logfile> <host:port>\n");
-      fflush (stderr);
+      gdbreplay_usage (stderr);
       exit (1);
     }
   fp = fopen (argv[1], "r");
Index: gdb/gdbserver/server.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/server.c,v
retrieving revision 1.72
diff -u -p -r1.72 server.c
--- gdb/gdbserver/server.c	9 May 2008 17:37:36 -0000	1.72
+++ gdb/gdbserver/server.c	20 May 2008 16:06:05 -0000
@@ -1178,26 +1178,28 @@ myresume (char *own_buf, int step, int *
 static void
 gdbserver_version (void)
 {
-  printf ("GNU gdbserver %s\n"
+  printf ("GNU gdbserver %s%s\n"
 	  "Copyright (C) 2007 Free Software Foundation, Inc.\n"
 	  "gdbserver is free software, covered by the GNU General Public License.\n"
 	  "This gdbserver was configured as \"%s\"\n",
-	  version, host_name);
+	  PKGVERSION, version, host_name);
 }
 
 static void
-gdbserver_usage (void)
+gdbserver_usage (FILE *stream)
 {
-  printf ("Usage:\tgdbserver [OPTIONS] COMM PROG [ARGS ...]\n"
-	  "\tgdbserver [OPTIONS] --attach COMM PID\n"
-	  "\tgdbserver [OPTIONS] --multi COMM\n"
-	  "\n"
-	  "COMM may either be a tty device (for serial debugging), or \n"
-	  "HOST:PORT to listen for a TCP connection.\n"
-	  "\n"
-	  "Options:\n"
-	  "  --debug\t\tEnable debugging output.\n"
-	  "  --wrapper WRAPPER --\tRun WRAPPER to start new programs.\n");
+  fprintf (stream, "Usage:\tgdbserver [OPTIONS] COMM PROG [ARGS ...]\n"
+	   "\tgdbserver [OPTIONS] --attach COMM PID\n"
+	   "\tgdbserver [OPTIONS] --multi COMM\n"
+	   "\n"
+	   "COMM may either be a tty device (for serial debugging), or \n"
+	   "HOST:PORT to listen for a TCP connection.\n"
+	   "\n"
+	   "Options:\n"
+	   "  --debug\t\tEnable debugging output.\n"
+	   "  --wrapper WRAPPER --\tRun WRAPPER to start new programs.\n");
+  if (REPORT_BUGS_TO[0] && stream == stdout)
+    fprintf (stream, "Report bugs to \"%s\".\n", REPORT_BUGS_TO);
 }
 
 #undef require_running
@@ -1234,7 +1236,7 @@ main (int argc, char *argv[])
 	}
       else if (strcmp (*next_arg, "--help") == 0)
 	{
-	  gdbserver_usage ();
+	  gdbserver_usage (stdout);
 	  exit (0);
 	}
       else if (strcmp (*next_arg, "--attach") == 0)
@@ -1251,7 +1253,7 @@ main (int argc, char *argv[])
 
 	  if (next_arg == wrapper_argv || *next_arg == NULL)
 	    {
-	      gdbserver_usage ();
+	      gdbserver_usage (stderr);
 	      exit (1);
 	    }
 
@@ -1280,7 +1282,7 @@ main (int argc, char *argv[])
   next_arg++;
   if (port == NULL || (!attach && !multi_mode && *next_arg == NULL))
     {
-      gdbserver_usage ();
+      gdbserver_usage (stderr);
       exit (1);
     }
 
@@ -1305,7 +1307,7 @@ main (int argc, char *argv[])
 
   if (bad_attach)
     {
-      gdbserver_usage ();
+      gdbserver_usage (stderr);
       exit (1);
     }
 

-- 
Joseph S. Myers
joseph@codesourcery.com


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-pkgversion and --with-bugurl support for GDB
  2008-05-20 18:24       ` Joseph S. Myers
@ 2008-05-21  2:54         ` Eli Zaretskii
  2008-05-30 15:23         ` Ping " Joseph S. Myers
  2008-06-05 20:24         ` Daniel Jacobowitz
  2 siblings, 0 replies; 15+ messages in thread
From: Eli Zaretskii @ 2008-05-21  2:54 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: gdb-patches

> Date: Tue, 20 May 2008 16:09:26 +0000 (UTC)
> From: "Joseph S. Myers" <joseph@codesourcery.com>
> cc: gdb-patches@sourceware.org
> 
> On Tue, 20 May 2008, Eli Zaretskii wrote:
> 
> > Sorry, I don't agree.  I think the manual should have clear
> > instructions on how to report bugs efficiently.  I don't like to ask
> > users to study Web pages to know that when they are already reading
> > documentation.
> > 
> > I don't mind removing obsolete information, but please either update
> > the rest to talk about bug-gdb and gdb@sources.redhat.com, or leave it
> > intact and I will get to updating it when I have time.
> 
> This version keeps the original text if the default BUGURL value is
> used.  Tested with and without --with-bugurl use.  OK to commit?

Thanks, the doc/ part is okay with me, provided that you actually
tried to say "make info" both with and without the default URL.

As for the rest, please wait for others to approve that (unless they
did that already).

Thanks again for working on this.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Ping Re: --with-pkgversion and --with-bugurl support for GDB
  2008-05-20 18:24       ` Joseph S. Myers
  2008-05-21  2:54         ` Eli Zaretskii
@ 2008-05-30 15:23         ` Joseph S. Myers
  2008-06-05 20:24         ` Daniel Jacobowitz
  2 siblings, 0 replies; 15+ messages in thread
From: Joseph S. Myers @ 2008-05-30 15:23 UTC (permalink / raw)
  To: gdb-patches

Ping.  This patch 
<http://sourceware.org/ml/gdb-patches/2008-05/msg00591.html> is pending 
review.  OK to commit?

-- 
Joseph S. Myers
joseph@codesourcery.com


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-pkgversion and --with-bugurl support for GDB
  2008-05-20 18:24       ` Joseph S. Myers
  2008-05-21  2:54         ` Eli Zaretskii
  2008-05-30 15:23         ` Ping " Joseph S. Myers
@ 2008-06-05 20:24         ` Daniel Jacobowitz
  2008-06-05 21:28           ` Joseph S. Myers
  2 siblings, 1 reply; 15+ messages in thread
From: Daniel Jacobowitz @ 2008-06-05 20:24 UTC (permalink / raw)
  To: gdb-patches

On Tue, May 20, 2008 at 04:09:26PM +0000, Joseph S. Myers wrote:
> On Tue, 20 May 2008, Eli Zaretskii wrote:
> 
> > Sorry, I don't agree.  I think the manual should have clear
> > instructions on how to report bugs efficiently.  I don't like to ask
> > users to study Web pages to know that when they are already reading
> > documentation.
> > 
> > I don't mind removing obsolete information, but please either update
> > the rest to talk about bug-gdb and gdb@sources.redhat.com, or leave it
> > intact and I will get to updating it when I have time.
> 
> This version keeps the original text if the default BUGURL value is
> used.  Tested with and without --with-bugurl use.  OK to commit?

Issues I found:

  - There's an #ifdef, but we define it unconditionally.

  - You added the defines to the GCC command line for all files, but
  only a small handfull (currently two) need them.  If the quoting
  makes it difficult to stuff them into config.h, I'd rather they were
  only passed to those two files.  It may be easier to put them in
  config.h, I'm not sure.

Otherwise, looks OK.  Thanks.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-pkgversion and --with-bugurl support for GDB
  2008-06-05 20:24         ` Daniel Jacobowitz
@ 2008-06-05 21:28           ` Joseph S. Myers
  2008-06-05 21:45             ` Daniel Jacobowitz
                               ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Joseph S. Myers @ 2008-06-05 21:28 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

On Thu, 5 Jun 2008, Daniel Jacobowitz wrote:

> Issues I found:
> 
>   - There's an #ifdef, but we define it unconditionally.
> 
>   - You added the defines to the GCC command line for all files, but
>   only a small handfull (currently two) need them.  If the quoting
>   makes it difficult to stuff them into config.h, I'd rather they were
>   only passed to those two files.  It may be easier to put them in
>   config.h, I'm not sure.

How does this patch version seem?  The definitions are put in config.h
by adding extra AC_DEFINE_UNQUOTED calls, and the #ifdef
REPORT_BUGS_TO is replaced by a check of REPORT_BUGS_TO[0] as in other
places.

2008-06-05  Vladimir Prus  <vladimir@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* acinclude.m4: Include ../config/acx.m4.
	* configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
	* configure, config.in: Regenerate.
	* main.c (print_gdb_help): Use REPORT_BUGS_TO for bug-reporting
	address.
	* top.c (print_gdb_version): Use PKGVERSION and REPORT_BUGS_TO.

doc:
2008-06-05  Vladimir Prus  <vladimir@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* configure.ac: Include ../../config/acx.m4.  Use ACX_PKGVERSION
	and ACX_BUGURL.
	* configure: Regenerate.
	* Makefile.in (PKGVERSION, BUGURL_TEXI): Define.
	(GDBvn.texi): Define VERSION_PACKAGE, BUGURL and BUGURL_DEFAULT.
	* gdb.texinfo: Use VERSION_PACKAGE and BUGURL.  Remove
	mailing-list-specific text about bug reporting unless
	BUGURL_DEFAULT.

gdbserver:
2008-06-05  Vladimir Prus  <vladimir@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* acinclude.m4: Include ../../config/acx.m4.
	* configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
	* configure, config.in: Regenerate.
	* Makefile.in (gdbreplay$(EXEEXT)): Add version.o.
	* server.c (gdbserver_version): Print PKGVERSION.
	(gdbsrever_usage): Add stream parameter.  Print REPORT_BUGS_TO.
	(main): Adjust gdbserver_usage calls.
	* gdbreplay.c (version, host_name): Add declarations.
	(gdbreplay_version, gdbreplay_usage): New.
	(main): Accept --version and --help options.

Index: gdb/acinclude.m4
===================================================================
RCS file: /cvs/src/src/gdb/acinclude.m4,v
retrieving revision 1.18
diff -u -p -r1.18 acinclude.m4
--- gdb/acinclude.m4	23 Apr 2008 12:21:47 -0000	1.18
+++ gdb/acinclude.m4	5 Jun 2008 21:23:19 -0000
@@ -20,6 +20,9 @@ sinclude(../config/lib-ld.m4)
 sinclude(../config/lib-prefix.m4)
 sinclude(../config/lib-link.m4)
 
+dnl For ACX_PKGVERSION and ACX_BUGURL.
+sinclude(../config/acx.m4)
+
 #
 # Sometimes the native compiler is a bogus stub for gcc or /usr/ucb/cc. This
 # makes configure think it's cross compiling. If --target wasn't used, then
Index: gdb/configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/configure.ac,v
retrieving revision 1.68
diff -u -p -r1.68 configure.ac
--- gdb/configure.ac	19 Apr 2008 05:06:54 -0000	1.68
+++ gdb/configure.ac	5 Jun 2008 21:23:22 -0000
@@ -362,6 +362,11 @@ if test "$enable_profiling" = yes ; then
   CFLAGS="$OLD_CFLAGS"
 fi
 
+ACX_PKGVERSION([GDB])
+ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/])
+AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package description])
+AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address])
+
 # --------------------- #
 # Checks for programs.  #
 # --------------------- #
Index: gdb/main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.67
diff -u -p -r1.67 main.c
--- gdb/main.c	14 Mar 2008 17:21:07 -0000	1.67
+++ gdb/main.c	5 Jun 2008 21:23:22 -0000
@@ -966,6 +966,9 @@ Options:\n\n\
   fputs_unfiltered (_("\n\
 For more information, type \"help\" from within GDB, or consult the\n\
 GDB manual (available as on-line info or a printed manual).\n\
-Report bugs to \"bug-gdb@gnu.org\".\
 "), stream);
+  if (REPORT_BUGS_TO[0] && stream == gdb_stdout)
+    fprintf_unfiltered (stream, _("\
+Report bugs to \"%s\".\n\
+"), REPORT_BUGS_TO);
 }
Index: gdb/top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.141
diff -u -p -r1.141 top.c
--- gdb/top.c	5 May 2008 09:47:46 -0000	1.141
+++ gdb/top.c	5 Jun 2008 21:23:22 -0000
@@ -1125,7 +1125,7 @@ print_gdb_version (struct ui_file *strea
      program to parse, and is just canonical program name and version
      number, which starts after last space. */
 
-  fprintf_filtered (stream, "GNU gdb %s\n", version);
+  fprintf_filtered (stream, "GNU gdb %s%s\n", PKGVERSION, version);
 
   /* Second line is a copyright notice. */
 
@@ -1154,6 +1154,13 @@ and \"show warranty\" for details.\n");
       fprintf_filtered (stream, "%s", host_name);
     }
   fprintf_filtered (stream, "\".");
+
+  if (REPORT_BUGS_TO[0])
+    {
+      fprintf_filtered (stream, 
+			_("\nFor bug reporting instructions, please see:\n"));
+      fprintf_filtered (stream, "%s.\n", REPORT_BUGS_TO);
+    }
 }
 \f
 /* get_prompt: access method for the GDB prompt string.  */
Index: gdb/doc/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/doc/Makefile.in,v
retrieving revision 1.41
diff -u -p -r1.41 Makefile.in
--- gdb/doc/Makefile.in	1 Jan 2008 22:53:14 -0000	1.41
+++ gdb/doc/Makefile.in	5 Jun 2008 21:23:22 -0000
@@ -61,6 +61,10 @@ TEXI2ROFF=texi2roff
 # where to find texi2dvi, ditto
 TEXI2DVI=texi2dvi
 
+# Package version and bug-reporting URL.
+PKGVERSION = @PKGVERSION@
+BUGURL_TEXI = @REPORT_BUGS_TEXI@
+
 # Where is the source dir for the READLINE library doc?  
 # Traditionally readline is in .. or .
 READLINE_DIR = ${gdbdir}/../readline/doc
@@ -279,6 +283,13 @@ refcard.pdf : refcard.tex $(REFEDITS)
 # File to record current GDB version number (copied from main dir version.in)
 GDBvn.texi : ${gdbdir}/version.in
 	echo "@set GDBVN `sed q $(srcdir)/../version.in`" > ./GDBvn.new
+	if [ -n "$(PKGVERSION)" ]; then \
+	  echo "@set VERSION_PACKAGE $(PKGVERSION)" >> ./GDBvn.new; \
+	fi
+	echo "@set BUGURL $(BUGURL_TEXI)" >> ./GDBvn.new
+	if [ "$(BUGURL_TEXI)" = "@uref{http://www.gnu.org/software/gdb/bugs/}" ]; then \
+	  echo "@set BUGURL_DEFAULT" >> ./GDBvn.new; \
+	fi
 	mv GDBvn.new GDBvn.texi
 
 # Updated atomically
Index: gdb/doc/configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/doc/configure.ac,v
retrieving revision 1.1
diff -u -p -r1.1 configure.ac
--- gdb/doc/configure.ac	7 Jan 2005 21:53:22 -0000	1.1
+++ gdb/doc/configure.ac	5 Jun 2008 21:23:23 -0000
@@ -1,5 +1,8 @@
 AC_PREREQ(2.59)
 AC_INIT(refcard.tex)
+sinclude(../../config/acx.m4)
 AC_PROG_INSTALL
 AC_PROG_LN_S
+ACX_PKGVERSION([GDB])
+ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/])
 AC_OUTPUT(Makefile)
Index: gdb/doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.495
diff -u -p -r1.495 gdb.texinfo
--- gdb/doc/gdb.texinfo	9 May 2008 17:02:01 -0000	1.495
+++ gdb/doc/gdb.texinfo	5 Jun 2008 21:23:28 -0000
@@ -49,6 +49,9 @@ This file documents the @sc{gnu} debugge
 
 This is the @value{EDITION} Edition, of @cite{Debugging with
 @value{GDBN}: the @sc{gnu} Source-Level Debugger} for @value{GDBN}
+@ifset VERSION_PACKAGE
+@value{VERSION_PACKAGE}
+@end ifset
 Version @value{GDBVN}.
 
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,@*
@@ -72,11 +75,15 @@ developing GNU and promoting software fr
 @subtitle The @sc{gnu} Source-Level Debugger
 @sp 1
 @subtitle @value{EDITION} Edition, for @value{GDBN} version @value{GDBVN}
+@ifset VERSION_PACKAGE
+@sp 1
+@subtitle @value{VERSION_PACKAGE}
+@end ifset
 @author Richard Stallman, Roland Pesch, Stan Shebs, et al.
 @page
 @tex
 {\parskip=0pt
-\hfill (Send bugs and comments on @value{GDBN} to bug-gdb\@gnu.org.)\par
+\hfill (Send bugs and comments on @value{GDBN} to @value{BUGURL}.)\par
 \hfill {\it Debugging with @value{GDBN}}\par
 \hfill \TeX{}info \texinfoversion\par
 }
@@ -116,8 +123,11 @@ software in general.  We will miss him.
 
 This file describes @value{GDBN}, the @sc{gnu} symbolic debugger.
 
-This is the @value{EDITION} Edition, for @value{GDBN} Version
-@value{GDBVN}.
+This is the @value{EDITION} Edition, for @value{GDBN}
+@ifset VERSION_PACKAGE
+@value{VERSION_PACKAGE}
+@end ifset
+Version @value{GDBVN}.
 
 Copyright (C) 1988-2006 Free Software Foundation, Inc.
 
@@ -22632,6 +22642,8 @@ individuals in the file @file{etc/SERVIC
 distribution.
 @c should add a web page ref...
 
+@ifset BUGURL
+@ifset BUGURL_DEFAULT
 In any event, we also recommend that you submit bug reports for
 @value{GDBN}.  The preferred method is to submit them directly using
 @uref{http://www.gnu.org/software/gdb/bugs/, @value{GDBN}'s Bugs web
@@ -22651,6 +22663,12 @@ problem which can be crucial: a newsgrou
 path back to the sender.  Thus, if we need to ask for more information,
 we may be unable to reach you.  For this reason, it is better to send
 bug reports to the mailing list.
+@end ifset
+@ifclear BUGURL_DEFAULT
+In any event, we also recommend that you submit bug reports for
+@value{GDBN} to @value{BUGURL}.
+@end ifclear
+@end ifset
 
 The fundamental principle of reporting bugs usefully is this:
 @strong{report all the facts}.  If you are not sure whether to state a
Index: gdb/gdbserver/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/Makefile.in,v
retrieving revision 1.58
diff -u -p -r1.58 Makefile.in
--- gdb/gdbserver/Makefile.in	3 May 2008 17:16:43 -0000	1.58
+++ gdb/gdbserver/Makefile.in	5 Jun 2008 21:23:29 -0000
@@ -194,9 +194,9 @@ gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} $
 	${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbserver$(EXEEXT) $(OBS) \
 	  $(GDBSERVER_LIBS) $(XM_CLIBS)
 
-gdbreplay$(EXEEXT): gdbreplay.o
+gdbreplay$(EXEEXT): gdbreplay.o version.o
 	rm -f gdbreplay$(EXEEXT)
-	${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbreplay$(EXEEXT) gdbreplay.o \
+	${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbreplay$(EXEEXT) $^ \
 	  $(XM_CLIBS)
 
 # Put the proper machine-specific files first, so M-. on a machine
Index: gdb/gdbserver/acinclude.m4
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/acinclude.m4,v
retrieving revision 1.6
diff -u -p -r1.6 acinclude.m4
--- gdb/gdbserver/acinclude.m4	23 Apr 2008 12:21:50 -0000	1.6
+++ gdb/gdbserver/acinclude.m4	5 Jun 2008 21:23:29 -0000
@@ -4,6 +4,9 @@ sinclude(../../bfd/bfd.m4)
 dnl This gets autoconf bugfixes
 sinclude(../../config/override.m4)
 
+dnl For ACX_PKGVERSION and ACX_BUGURL.
+sinclude(../../config/acx.m4)
+
 AC_DEFUN([SRV_CHECK_THREAD_DB],
 [AC_CACHE_CHECK([for libthread_db],[srv_cv_thread_db],
  [old_LIBS="$LIBS"
Index: gdb/gdbserver/configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/configure.ac,v
retrieving revision 1.22
diff -u -p -r1.22 configure.ac
--- gdb/gdbserver/configure.ac	14 Apr 2008 18:04:00 -0000	1.22
+++ gdb/gdbserver/configure.ac	5 Jun 2008 21:23:29 -0000
@@ -68,6 +68,11 @@ AC_CHECK_TYPES(socklen_t, [], [],
 #include <sys/socket.h>
 ])
 
+ACX_PKGVERSION([GDB])
+ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/])
+AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package description])
+AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address])
+
 . ${srcdir}/configure.srv
 
 if test "${srv_mingwce}" = "yes"; then
Index: gdb/gdbserver/gdbreplay.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/gdbreplay.c,v
retrieving revision 1.16
diff -u -p -r1.16 gdbreplay.c
--- gdb/gdbserver/gdbreplay.c	1 Jan 2008 22:53:14 -0000	1.16
+++ gdb/gdbserver/gdbreplay.c	5 Jun 2008 21:23:29 -0000
@@ -69,6 +69,10 @@ typedef int socklen_t;
 /* Sort of a hack... */
 #define EOL (EOF - 1)
 
+/* Version information, from version.c.  */
+extern const char version[];
+extern const char host_name[];
+
 static int remote_desc;
 
 #ifdef __MINGW32CE__
@@ -387,16 +391,44 @@ play (FILE *fp)
     }
 }
 
+static void
+gdbreplay_version (void)
+{
+  printf ("GNU gdbreplay %s%s\n"
+	  "Copyright (C) 2008 Free Software Foundation, Inc.\n"
+	  "gdbserver is free software, covered by the GNU General Public License.\n"
+	  "This gdbserver was configured as \"%s\"\n",
+	  PKGVERSION, version, host_name);
+}
+
+static void
+gdbreplay_usage (FILE *stream)
+{
+  fprintf (stream, "Usage:\tgdbreplay <logfile> <host:port>\n");
+  if (REPORT_BUGS_TO[0] && stream == stdout)
+    fprintf (stream, "Report bugs to \"%s\".\n", REPORT_BUGS_TO);
+}
+
 int
 main (int argc, char *argv[])
 {
   FILE *fp;
   int ch;
 
+  if (argc >= 2 && strcmp (argv[1], "--version") == 0)
+    {
+      gdbreplay_version ();
+      exit (0);
+    }
+  if (argc >= 2 && strcmp (argv[1], "--help") == 0)
+    {
+      gdbreplay_usage (stdout);
+      exit (0);
+    }
+
   if (argc < 3)
     {
-      fprintf (stderr, "Usage: gdbreplay <logfile> <host:port>\n");
-      fflush (stderr);
+      gdbreplay_usage (stderr);
       exit (1);
     }
   fp = fopen (argv[1], "r");
Index: gdb/gdbserver/server.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/server.c,v
retrieving revision 1.72
diff -u -p -r1.72 server.c
--- gdb/gdbserver/server.c	9 May 2008 17:37:36 -0000	1.72
+++ gdb/gdbserver/server.c	5 Jun 2008 21:23:30 -0000
@@ -1178,26 +1178,28 @@ myresume (char *own_buf, int step, int *
 static void
 gdbserver_version (void)
 {
-  printf ("GNU gdbserver %s\n"
+  printf ("GNU gdbserver %s%s\n"
 	  "Copyright (C) 2007 Free Software Foundation, Inc.\n"
 	  "gdbserver is free software, covered by the GNU General Public License.\n"
 	  "This gdbserver was configured as \"%s\"\n",
-	  version, host_name);
+	  PKGVERSION, version, host_name);
 }
 
 static void
-gdbserver_usage (void)
+gdbserver_usage (FILE *stream)
 {
-  printf ("Usage:\tgdbserver [OPTIONS] COMM PROG [ARGS ...]\n"
-	  "\tgdbserver [OPTIONS] --attach COMM PID\n"
-	  "\tgdbserver [OPTIONS] --multi COMM\n"
-	  "\n"
-	  "COMM may either be a tty device (for serial debugging), or \n"
-	  "HOST:PORT to listen for a TCP connection.\n"
-	  "\n"
-	  "Options:\n"
-	  "  --debug\t\tEnable debugging output.\n"
-	  "  --wrapper WRAPPER --\tRun WRAPPER to start new programs.\n");
+  fprintf (stream, "Usage:\tgdbserver [OPTIONS] COMM PROG [ARGS ...]\n"
+	   "\tgdbserver [OPTIONS] --attach COMM PID\n"
+	   "\tgdbserver [OPTIONS] --multi COMM\n"
+	   "\n"
+	   "COMM may either be a tty device (for serial debugging), or \n"
+	   "HOST:PORT to listen for a TCP connection.\n"
+	   "\n"
+	   "Options:\n"
+	   "  --debug\t\tEnable debugging output.\n"
+	   "  --wrapper WRAPPER --\tRun WRAPPER to start new programs.\n");
+  if (REPORT_BUGS_TO[0] && stream == stdout)
+    fprintf (stream, "Report bugs to \"%s\".\n", REPORT_BUGS_TO);
 }
 
 #undef require_running
@@ -1234,7 +1236,7 @@ main (int argc, char *argv[])
 	}
       else if (strcmp (*next_arg, "--help") == 0)
 	{
-	  gdbserver_usage ();
+	  gdbserver_usage (stdout);
 	  exit (0);
 	}
       else if (strcmp (*next_arg, "--attach") == 0)
@@ -1251,7 +1253,7 @@ main (int argc, char *argv[])
 
 	  if (next_arg == wrapper_argv || *next_arg == NULL)
 	    {
-	      gdbserver_usage ();
+	      gdbserver_usage (stderr);
 	      exit (1);
 	    }
 
@@ -1280,7 +1282,7 @@ main (int argc, char *argv[])
   next_arg++;
   if (port == NULL || (!attach && !multi_mode && *next_arg == NULL))
     {
-      gdbserver_usage ();
+      gdbserver_usage (stderr);
       exit (1);
     }
 
@@ -1305,7 +1307,7 @@ main (int argc, char *argv[])
 
   if (bad_attach)
     {
-      gdbserver_usage ();
+      gdbserver_usage (stderr);
       exit (1);
     }
 

-- 
Joseph S. Myers
joseph@codesourcery.com


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-pkgversion and --with-bugurl support for GDB
  2008-06-05 21:28           ` Joseph S. Myers
@ 2008-06-05 21:45             ` Daniel Jacobowitz
  2008-06-06 10:21             ` Eli Zaretskii
  2008-06-10 12:58             ` Andreas Schwab
  2 siblings, 0 replies; 15+ messages in thread
From: Daniel Jacobowitz @ 2008-06-05 21:45 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: gdb-patches

On Thu, Jun 05, 2008 at 09:28:15PM +0000, Joseph S. Myers wrote:
> How does this patch version seem?  The definitions are put in config.h
> by adding extra AC_DEFINE_UNQUOTED calls, and the #ifdef
> REPORT_BUGS_TO is replaced by a check of REPORT_BUGS_TO[0] as in other
> places.

Looks fine to me.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-pkgversion and --with-bugurl support for GDB
  2008-06-05 21:28           ` Joseph S. Myers
  2008-06-05 21:45             ` Daniel Jacobowitz
@ 2008-06-06 10:21             ` Eli Zaretskii
  2008-06-06 20:22               ` Joseph S. Myers
  2008-06-10 12:58             ` Andreas Schwab
  2 siblings, 1 reply; 15+ messages in thread
From: Eli Zaretskii @ 2008-06-06 10:21 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: drow, gdb-patches

> Date: Thu, 5 Jun 2008 21:28:15 +0000 (UTC)
> From: "Joseph S. Myers" <joseph@codesourcery.com>
> cc: gdb-patches@sourceware.org
> 
> +static void
> +gdbreplay_version (void)
> +{
> +  printf ("GNU gdbreplay %s%s\n"
> +	  "Copyright (C) 2008 Free Software Foundation, Inc.\n"
> +	  "gdbserver is free software, covered by the GNU General Public License.\n"
> +	  "This gdbserver was configured as \"%s\"\n",
> +	  PKGVERSION, version, host_name);

We start by announcing a "GNU gdbreplay", but thereafter talk about
"gdbserver".  Is that right?  Shouldn't we either (1) use gdbreplay
throughout, or (2) say something like "GNU gdbreplay (gdbserver %s%s)"?


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-pkgversion and --with-bugurl support for GDB
  2008-06-06 10:21             ` Eli Zaretskii
@ 2008-06-06 20:22               ` Joseph S. Myers
  2008-06-06 20:26                 ` Daniel Jacobowitz
  2008-06-06 20:32                 ` Eli Zaretskii
  0 siblings, 2 replies; 15+ messages in thread
From: Joseph S. Myers @ 2008-06-06 20:22 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: drow, gdb-patches

On Fri, 6 Jun 2008, Eli Zaretskii wrote:

> > Date: Thu, 5 Jun 2008 21:28:15 +0000 (UTC)
> > From: "Joseph S. Myers" <joseph@codesourcery.com>
> > cc: gdb-patches@sourceware.org
> > 
> > +static void
> > +gdbreplay_version (void)
> > +{
> > +  printf ("GNU gdbreplay %s%s\n"
> > +	  "Copyright (C) 2008 Free Software Foundation, Inc.\n"
> > +	  "gdbserver is free software, covered by the GNU General Public License.\n"
> > +	  "This gdbserver was configured as \"%s\"\n",
> > +	  PKGVERSION, version, host_name);
> 
> We start by announcing a "GNU gdbreplay", but thereafter talk about
> "gdbserver".  Is that right?  Shouldn't we either (1) use gdbreplay
> throughout, or (2) say something like "GNU gdbreplay (gdbserver %s%s)"?

OK to commit this patch to say gdbreplay consistently?

2008-06-06  Joseph Myers  <joseph@codesourcery.com>

	* gdbreplay.c (gdbreplay_version): Say gdbreplay in version
	message, not gdbserver.

Index: gdbreplay.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/gdbreplay.c,v
retrieving revision 1.17
diff -u -p -r1.17 gdbreplay.c
--- gdbreplay.c	5 Jun 2008 22:36:57 -0000	1.17
+++ gdbreplay.c	6 Jun 2008 20:20:18 -0000
@@ -396,8 +396,8 @@ gdbreplay_version (void)
 {
   printf ("GNU gdbreplay %s%s\n"
 	  "Copyright (C) 2008 Free Software Foundation, Inc.\n"
-	  "gdbserver is free software, covered by the GNU General Public License.\n"
-	  "This gdbserver was configured as \"%s\"\n",
+	  "gdbreplay is free software, covered by the GNU General Public License.\n"
+	  "This gdbreplay was configured as \"%s\"\n",
 	  PKGVERSION, version, host_name);
 }
 

-- 
Joseph S. Myers
joseph@codesourcery.com


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-pkgversion and --with-bugurl support for GDB
  2008-06-06 20:22               ` Joseph S. Myers
@ 2008-06-06 20:26                 ` Daniel Jacobowitz
  2008-06-06 20:32                 ` Eli Zaretskii
  1 sibling, 0 replies; 15+ messages in thread
From: Daniel Jacobowitz @ 2008-06-06 20:26 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: Eli Zaretskii, gdb-patches

On Fri, Jun 06, 2008 at 08:21:41PM +0000, Joseph S. Myers wrote:
> OK to commit this patch to say gdbreplay consistently?
> 
> 2008-06-06  Joseph Myers  <joseph@codesourcery.com>
> 
> 	* gdbreplay.c (gdbreplay_version): Say gdbreplay in version
> 	message, not gdbserver.

Yes.  Thanks!

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-pkgversion and --with-bugurl support for GDB
  2008-06-06 20:22               ` Joseph S. Myers
  2008-06-06 20:26                 ` Daniel Jacobowitz
@ 2008-06-06 20:32                 ` Eli Zaretskii
  1 sibling, 0 replies; 15+ messages in thread
From: Eli Zaretskii @ 2008-06-06 20:32 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: drow, gdb-patches

> Date: Fri, 6 Jun 2008 20:21:41 +0000 (UTC)
> From: "Joseph S. Myers" <joseph@codesourcery.com>
> cc: drow@false.org, gdb-patches@sourceware.org
> 
> OK to commit this patch to say gdbreplay consistently?
> 
> 2008-06-06  Joseph Myers  <joseph@codesourcery.com>
> 
> 	* gdbreplay.c (gdbreplay_version): Say gdbreplay in version
> 	message, not gdbserver.

Fine with me, thanks.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-pkgversion and --with-bugurl support for GDB
  2008-06-05 21:28           ` Joseph S. Myers
  2008-06-05 21:45             ` Daniel Jacobowitz
  2008-06-06 10:21             ` Eli Zaretskii
@ 2008-06-10 12:58             ` Andreas Schwab
  2 siblings, 0 replies; 15+ messages in thread
From: Andreas Schwab @ 2008-06-10 12:58 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: Daniel Jacobowitz, gdb-patches

"Joseph S. Myers" <joseph@codesourcery.com> writes:

> @@ -1154,6 +1154,13 @@ and \"show warranty\" for details.\n");
>        fprintf_filtered (stream, "%s", host_name);
>      }
>    fprintf_filtered (stream, "\".");
> +
> +  if (REPORT_BUGS_TO[0])
> +    {
> +      fprintf_filtered (stream, 
> +			_("\nFor bug reporting instructions, please see:\n"));
> +      fprintf_filtered (stream, "%s.\n", REPORT_BUGS_TO);

print_gdb_version is not supposed to print a final newline, see its uses
in captured_main.  Committed as obvious.

Andreas.

2008-06-10  Andreas Schwab  <schwab@suse.de>

	* top.c (print_gdb_version): Don't print final newline.

--- gdb/top.c.~1.142.~	2008-06-06 10:04:20.000000000 +0200
+++ gdb/top.c	2008-06-10 13:43:35.000000000 +0200
@@ -1159,7 +1159,7 @@ and \"show warranty\" for details.\n");
     {
       fprintf_filtered (stream, 
 			_("\nFor bug reporting instructions, please see:\n"));
-      fprintf_filtered (stream, "%s.\n", REPORT_BUGS_TO);
+      fprintf_filtered (stream, "%s.", REPORT_BUGS_TO);
     }
 }
 \f

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-06-10 11:58 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-19 20:46 --with-pkgversion and --with-bugurl support for GDB Joseph S. Myers
2008-05-20  0:05 ` Eli Zaretskii
2008-05-20  3:26   ` Joseph S. Myers
2008-05-20 15:25     ` Eli Zaretskii
2008-05-20 18:24       ` Joseph S. Myers
2008-05-21  2:54         ` Eli Zaretskii
2008-05-30 15:23         ` Ping " Joseph S. Myers
2008-06-05 20:24         ` Daniel Jacobowitz
2008-06-05 21:28           ` Joseph S. Myers
2008-06-05 21:45             ` Daniel Jacobowitz
2008-06-06 10:21             ` Eli Zaretskii
2008-06-06 20:22               ` Joseph S. Myers
2008-06-06 20:26                 ` Daniel Jacobowitz
2008-06-06 20:32                 ` Eli Zaretskii
2008-06-10 12:58             ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox