This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] add gdbserver --remote-debug switch
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Sun, 25 Jan 2009 22:40:18 +0000
- Subject: [RFA] add gdbserver --remote-debug switch
Hello,
I've found it useful before to have remote protocol debug output
on the gdbserver side. There's a 'set remote-debug <0|1>' monitor command
available, but no corresponding command line switch, which enables
debugging the initial connection setup, for instance, and it's easier
to use IMHO.
OK?
--
Pedro Alves
gdb/gdbserver/
2009-01-25 Pedro Alves <pedro@codesourcery.com>
* server.c (gdbserver_usage): Mention --remote-debug.
(main): Accept '--remote-debug' switch.
gdb/doc/
2009-01-25 Pedro Alves <pedro@codesourcery.com>
* gdb.texinfo (Using the `gdbserver' Program): Document
--remote-debug.
---
gdb/doc/gdb.texinfo | 9 +++++----
gdb/gdbserver/server.c | 9 ++++++---
2 files changed, 11 insertions(+), 7 deletions(-)
Index: src/gdb/gdbserver/server.c
===================================================================
--- src.orig/gdb/gdbserver/server.c 2009-01-21 12:51:34.000000000 +0000
+++ src/gdb/gdbserver/server.c 2009-01-25 20:55:10.000000000 +0000
@@ -1299,9 +1299,10 @@ gdbserver_usage (FILE *stream)
"HOST:PORT to listen for a TCP connection.\n"
"\n"
"Options:\n"
- " --debug\t\tEnable debugging output.\n"
- " --version\t\tDisplay version information and exit.\n"
- " --wrapper WRAPPER --\tRun WRAPPER to start new programs.\n");
+ " --debug Enable general debugging output.\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");
if (REPORT_BUGS_TO[0] && stream == stdout)
fprintf (stream, "Report bugs to \"%s\".\n", REPORT_BUGS_TO);
}
@@ -1378,6 +1379,8 @@ main (int argc, char *argv[])
}
else if (strcmp (*next_arg, "--debug") == 0)
debug_threads = 1;
+ else if (strcmp (*next_arg, "--remote-debug") == 0)
+ remote_debug = 1;
else if (strcmp (*next_arg, "--disable-packet") == 0)
{
gdbserver_show_disableable (stdout);
Index: src/gdb/doc/gdb.texinfo
===================================================================
--- src.orig/gdb/doc/gdb.texinfo 2009-01-25 20:58:16.000000000 +0000
+++ src/gdb/doc/gdb.texinfo 2009-01-25 21:03:20.000000000 +0000
@@ -13985,10 +13985,11 @@ You can terminate it by using @code{moni
@subsubsection Other Command-Line Arguments for @code{gdbserver}
-You can include @option{--debug} on the @code{gdbserver} command line.
-@code{gdbserver} will display extra status information about the debugging
-process. This option is intended for @code{gdbserver} development and
-for bug reports to the developers.
+The @option{--debug} tells @code{gdbserver} to display extra status
+information about the debugging process. The @option{--remote-debug}
+tells @code{gdbserver} to display remote protocol debug output. These
+options are intended for @code{gdbserver} development and for bug
+reports to the developers.
The @option{--wrapper} option specifies a wrapper to launch programs
for debugging. The option should be followed by the name of the