Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] gdbserver usage message improvement
@ 2002-05-15 19:20 Martin Pool
  2002-05-15 19:32 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Pool @ 2002-05-15 19:20 UTC (permalink / raw)
  To: gdb-patches

[I previously sent this to bug-gdb, but it looks like the newsgroup is
just full of spam, so I thought I'd resend it here.]

This small patch brings gdbserver's usage message up to date with the
manual, so that it indicates it can support TCP as well as serial
connections.  I remember being puzzled by this in the past, so I think
it would make gdb more friendly to have the message correct.

As far as I can see TCP is supported on all platforms where gdbserver
builds.

Thanks,
-- 
Martin 
(please cc me on replies)


cd /home/mbp/work/gdb/gdb-5.2/gdb/gdbserver/
diff -u -p /home/mbp/work/gdb/gdb-5.2/gdb/gdbserver/server.c.\~1\~ /home/mbp/work/gdb/gdb-5.2/gdb/gdbserver/server.c
--- /home/mbp/work/gdb/gdb-5.2/gdb/gdbserver/server.c.~1~	Sat Mar 30 06:03:34 2002
+++ /home/mbp/work/gdb/gdb-5.2/gdb/gdbserver/server.c	Tue May 14 16:03:47 2002
@@ -56,6 +56,16 @@ attach_inferior (int pid, char *statuspt
 
 extern int remote_debug;
 
+static void
+gdbserver_usage (void)
+{
+  error ("Usage:\tgdbserver COMM PROG [ARGS ...]\n"
+	 "\tgdbserver COMM --attach PID\n"
+	 "\n"
+	 "COMM may either be a tty device (for serial debugging), or \n"
+	 "HOST:PORT to listen for a TCP connection.\n");
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -89,8 +99,9 @@ main (int argc, char *argv[])
     }
 
   if (argc < 3 || bad_attach)
-    error ("Usage:\tgdbserver tty prog [args ...]\n"
-		 "\tgdbserver tty --attach pid");
+    {
+      gdbserver_usage();
+    }
 
   initialize_low ();
 

Diff finished at Tue May 14 16:04:33


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] gdbserver usage message improvement
  2002-05-15 19:20 [patch] gdbserver usage message improvement Martin Pool
@ 2002-05-15 19:32 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2002-05-15 19:32 UTC (permalink / raw)
  To: gdb-patches, mbp

On Thu, May 16, 2002 at 12:20:27PM +1000, Martin Pool wrote:
> [I previously sent this to bug-gdb, but it looks like the newsgroup is
> just full of spam, so I thought I'd resend it here.]
> 
> This small patch brings gdbserver's usage message up to date with the
> manual, so that it indicates it can support TCP as well as serial
> connections.  I remember being puzzled by this in the past, so I think
> it would make gdb more friendly to have the message correct.
> 
> As far as I can see TCP is supported on all platforms where gdbserver
> builds.
> 
> Thanks,
> -- 
> Martin 
> (please cc me on replies)

Thanks for the patch, I've committed it (after removing an extra pair
of braces).

FYI, we'd appreciate it if you could include ChangeLog entries with
patches; saves me having to make one up myself :)

2002-05-15  Daniel Jacobowitz  <drow@mvista.com>

        From Martin Pool <mbp@samba.org>:
        * gdbserver/server.c (gdbserver_usage): New function.
        (main): Call it.

> 
> 
> cd /home/mbp/work/gdb/gdb-5.2/gdb/gdbserver/
> diff -u -p /home/mbp/work/gdb/gdb-5.2/gdb/gdbserver/server.c.\~1\~ /home/mbp/work/gdb/gdb-5.2/gdb/gdbserver/server.c
> --- /home/mbp/work/gdb/gdb-5.2/gdb/gdbserver/server.c.~1~	Sat Mar 30 06:03:34 2002
> +++ /home/mbp/work/gdb/gdb-5.2/gdb/gdbserver/server.c	Tue May 14 16:03:47 2002
> @@ -56,6 +56,16 @@ attach_inferior (int pid, char *statuspt
>  
>  extern int remote_debug;
>  
> +static void
> +gdbserver_usage (void)
> +{
> +  error ("Usage:\tgdbserver COMM PROG [ARGS ...]\n"
> +	 "\tgdbserver COMM --attach PID\n"
> +	 "\n"
> +	 "COMM may either be a tty device (for serial debugging), or \n"
> +	 "HOST:PORT to listen for a TCP connection.\n");
> +}
> +
>  int
>  main (int argc, char *argv[])
>  {
> @@ -89,8 +99,9 @@ main (int argc, char *argv[])
>      }
>  
>    if (argc < 3 || bad_attach)
> -    error ("Usage:\tgdbserver tty prog [args ...]\n"
> -		 "\tgdbserver tty --attach pid");
> +    {
> +      gdbserver_usage();
> +    }
>  
>    initialize_low ();
>  
> 
> Diff finished at Tue May 14 16:04:33
> 

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-05-16  2:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-15 19:20 [patch] gdbserver usage message improvement Martin Pool
2002-05-15 19:32 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox