This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] GDBServer: give more complete usage information
- From: Pedro Alves <palves at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 1 Apr 2015 10:10:29 -0000
- Subject: [binutils-gdb] GDBServer: give more complete usage information
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=41f98f0276aede918c3aca37aa6371c8a3c9fbe7
commit 41f98f0276aede918c3aca37aa6371c8a3c9fbe7
Author: Pedro Alves <palves@redhat.com>
Date: Wed Apr 1 11:01:44 2015 +0100
GDBServer: give more complete usage information
--attach/--multi are currently only mentioned on the usage info first
lines, the meaning of PROG is completely absent and the COMM text does
not mention '-/stdio'.
A few options are missing:
. --disable-randomization / --no-disable-randomization is not mentioned.
Although the manual has a comment saying these are superceded by
QDisableRandomization, that only makes sense for "run" in
extended-remote mode. When we start gdbserver passing it a PROG,
--disable-randomization / --no-disable-randomization do take effect.
So I think we should document these.
. We show --debug / --remote-debug, so might as well show --disable-packet too.
GDB's --help has this "For more information, consult the GDB manual"
blurb that is missing in GDBserver's --help.
Then shuffle things around a bit into "Operating modes", "Other
options" and "Debug options" sections, similarly to GDB's --help
structure.
Before:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ ./gdbserver/gdbserver --help
Usage: gdbserver [OPTIONS] COMM PROG [ARGS ...]
gdbserver [OPTIONS] --attach COMM PID
gdbserver [OPTIONS] --multi COMM
COMM may either be a tty device (for serial debugging), or
HOST:PORT to listen for a TCP connection.
Options:
--debug Enable general debugging output.
--debug-format=opt1[,opt2,...]
Specify extra content in debugging output.
Options:
all
none
timestamp
--remote-debug Enable remote protocol debugging output.
--version Display version information and exit.
--wrapper WRAPPER -- Run WRAPPER to start new programs.
--once Exit after the first connection has closed.
Report bugs to "<http://www.gnu.org/software/gdb/bugs/>".
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
After:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ ./gdbserver/gdbserver --help
Usage: gdbserver [OPTIONS] COMM PROG [ARGS ...]
gdbserver [OPTIONS] --attach COMM PID
gdbserver [OPTIONS] --multi COMM
COMM may either be a tty device (for serial debugging),
HOST:PORT to listen for a TCP connection, or '-' or 'stdio' to use
stdin/stdout of gdbserver.
PROG is the executable program. ARGS are arguments passed to inferior.
PID is the process ID to attach to, when --attach is specified.
Operating modes:
--attach Attach to running process PID.
--multi Start server without a specific program, and
only quit when explicitly commanded.
--once Exit after the first connection has closed.
--help Print this message and then exit.
--version Display version information and exit.
Other options:
--wrapper WRAPPER -- Run WRAPPER to start new programs.
--disable-randomization
Run PROG with address space randomization disabled.
--no-disable-randomization
Don't disable address space randomization when
starting PROG.
Debug options:
--debug Enable general debugging output.
--debug-format=opt1[,opt2,...]
Specify extra content in debugging output.
Options:
all
none
timestamp
--remote-debug Enable remote protocol debugging output.
--disable-packet=opt1[,opt2,...]
Disable support for RSP packets or features.
Options:
vCont, Tthread, qC, qfThreadInfo and
threads (disable all threading packets).
For more information, consult the GDB manual (available as on-line
info or a printed manual).
Report bugs to "<http://www.gnu.org/software/gdb/bugs/>".
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gdb/gdbserver/ChangeLog:
2015-04-01 Pedro Alves <palves@redhat.com>
Cleber Rosa <crosa@redhat.com>
* server.c (gdbserver_usage): Reorganize and extend the usage
message.
Diff:
---
gdb/gdbserver/ChangeLog | 6 ++++++
gdb/gdbserver/server.c | 40 +++++++++++++++++++++++++++++++++-------
2 files changed, 39 insertions(+), 7 deletions(-)
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 396abcb..5abdac2 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,9 @@
+2015-04-01 Pedro Alves <palves@redhat.com>
+ Cleber Rosa <crosa@redhat.com>
+
+ * server.c (gdbserver_usage): Reorganize and extend the usage
+ message.
+
2015-03-24 Pedro Alves <palves@redhat.com>
* linux-low.c (check_stopped_by_breakpoint): Tweak debug log
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 96b31b8..3408ef7 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -2996,10 +2996,32 @@ gdbserver_usage (FILE *stream)
"\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"
+ "COMM may either be a tty device (for serial debugging),\n"
+ "HOST:PORT to listen for a TCP connection, or '-' or 'stdio' to use \n"
+ "stdin/stdout of gdbserver.\n"
+ "PROG is the executable program. ARGS are arguments passed to inferior.\n"
+ "PID is the process ID to attach to, when --attach is specified.\n"
+ "\n"
+ "Operating modes:\n"
+ "\n"
+ " --attach Attach to running process PID.\n"
+ " --multi Start server without a specific program, and\n"
+ " only quit when explicitly commanded.\n"
+ " --once Exit after the first connection has closed.\n"
+ " --help Print this message and then exit.\n"
+ " --version Display version information and exit.\n"
+ "\n"
+ "Other options:\n"
+ "\n"
+ " --wrapper WRAPPER -- Run WRAPPER to start new programs.\n"
+ " --disable-randomization\n"
+ " Run PROG with address space randomization disabled.\n"
+ " --no-disable-randomization\n"
+ " Don't disable address space randomization when\n"
+ " starting PROG.\n"
+ "\n"
+ "Debug options:\n"
"\n"
- "Options:\n"
" --debug Enable general debugging output.\n"
" --debug-format=opt1[,opt2,...]\n"
" Specify extra content in debugging output.\n"
@@ -3008,10 +3030,14 @@ gdbserver_usage (FILE *stream)
" none\n"
" timestamp\n"
" --remote-debug Enable remote protocol debugging output.\n"
- " --version Display version information and exit.\n"
- " --wrapper WRAPPER -- Run WRAPPER to start new programs.\n"
- " --once Exit after the first connection has "
- "closed.\n");
+ " --disable-packet=opt1[,opt2,...]\n"
+ " Disable support for RSP packets or features.\n"
+ " Options:\n"
+ " vCont, Tthread, qC, qfThreadInfo and \n"
+ " threads (disable all threading packets).\n"
+ "\n"
+ "For more information, consult the GDB manual (available as on-line \n"
+ "info or a printed manual).\n");
if (REPORT_BUGS_TO[0] && stream == stdout)
fprintf (stream, "Report bugs to \"%s\".\n", REPORT_BUGS_TO);
}