aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/server.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2008-06-05 22:36:57 +0000
committerJoseph Myers <joseph@codesourcery.com>2008-06-05 22:36:57 +0000
commitc16158bc9c346310d06db48674a3dfc3e241e8df (patch)
tree2e8363eab355ee85b6b45cc963bb03edf058bbd2 /gdb/gdbserver/server.c
parent75c99385347dccd47be824629ed4dda494bfc037 (diff)
downloadgdb-c16158bc9c346310d06db48674a3dfc3e241e8df.zip
gdb-c16158bc9c346310d06db48674a3dfc3e241e8df.tar.gz
gdb-c16158bc9c346310d06db48674a3dfc3e241e8df.tar.bz2
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.
Diffstat (limited to 'gdb/gdbserver/server.c')
-rw-r--r--gdb/gdbserver/server.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index ab4d8ec..57f5500 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -1178,26 +1178,28 @@ myresume (char *own_buf, int step, int *signalp, char *statusp)
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);
}