Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: [RFA] add gdbserver --remote-debug switch
Date: Sun, 25 Jan 2009 22:39:00 -0000	[thread overview]
Message-ID: <200901252240.18348.pedro@codesourcery.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 320 bytes --]

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

[-- Attachment #2: remote_debug_switch.diff --]
[-- Type: text/x-diff, Size: 2770 bytes --]

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

             reply	other threads:[~2009-01-25 22:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-25 22:39 Pedro Alves [this message]
2009-01-25 23:09 ` Daniel Jacobowitz
2009-01-26  3:48 ` Eli Zaretskii
2009-01-26 16:26   ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200901252240.18348.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox