From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9950 invoked by alias); 25 Jan 2009 22:39:11 -0000 Received: (qmail 9941 invoked by uid 22791); 25 Jan 2009 22:39:11 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_37,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 25 Jan 2009 22:39:06 +0000 Received: (qmail 27616 invoked from network); 25 Jan 2009 22:39:04 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 25 Jan 2009 22:39:04 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [RFA] add gdbserver --remote-debug switch Date: Sun, 25 Jan 2009 22:39:00 -0000 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_SpOfJnx54MkgD/H" Message-Id: <200901252240.18348.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-01/txt/msg00479.txt.bz2 --Boundary-00=_SpOfJnx54MkgD/H Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 320 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 --Boundary-00=_SpOfJnx54MkgD/H Content-Type: text/x-diff; charset="iso 8859-15"; name="remote_debug_switch.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="remote_debug_switch.diff" Content-length: 2770 gdb/gdbserver/ 2009-01-25 Pedro Alves * server.c (gdbserver_usage): Mention --remote-debug. (main): Accept '--remote-debug' switch. gdb/doc/ 2009-01-25 Pedro Alves * 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 --Boundary-00=_SpOfJnx54MkgD/H--