Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Enable hidden option -l
@ 2004-12-06 23:44 Andreas Schwab
  2004-12-07  5:00 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Andreas Schwab @ 2004-12-06 23:44 UTC (permalink / raw)
  To: gdb-patches

GDB has (since the beginning of CVS history) a hidden option -l that can
be used to set the timeout for remote communication.  But it was never
possible to pass it because it is missing from long_options.

The option is quite useful when debugging gdbserver.

Andreas.

2004-12-07  Andreas Schwab  <schwab@suse.de>

	* main.c (long_options): Add entry for "-l".
	(print_gdb_help): Add line for -l option.

doc/
	* gdb.texinfo (Mode Options): Document -l option.

--- gdb/main.c.~1.44.~	2004-08-11 00:36:39.000000000 +0200
+++ gdb/main.c	2004-12-07 00:06:51.356849960 +0100
@@ -300,6 +300,7 @@ captured_main (void *data)
       {"statistics", no_argument, 0, OPT_STATISTICS},
       {"write", no_argument, &write_files, 1},
       {"args", no_argument, &set_args, 1},
+      {"l", required_argument, 0, 'l'},
       {0, no_argument, 0, 0}
     };
 
@@ -854,6 +855,7 @@ Options:\n\n\
                      Select a specific interpreter / user interface\n\
 "), stream);
   fputs_unfiltered (_("\
+  -l TIMEOUT         Set timeout in seconds for remote debugging.\n\
   --mapped           Use mapped symbol files if supported on this system.\n\
   --nw		     Do not use a window interface.\n\
   --nx               Do not read "), stream);
--- gdb/doc/gdb.texinfo.~1.227.~	2004-11-23 23:11:14.000000000 +0100
+++ gdb/doc/gdb.texinfo	2004-12-07 00:06:19.054873173 +0100
@@ -1078,6 +1078,11 @@ This option stops option processing.
 Set the line speed (baud rate or bits per second) of any serial
 interface used by @value{GDBN} for remote debugging.
 
+@item -l @var{timeout}
+@cindex @code{-l}
+Set the timeout (in seconds) of any communication used by @value{GDBN}
+for remote debugging.
+
 @item -tty @var{device}
 @itemx -t @var{device}
 @cindex @code{--tty}

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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

* Re: Enable hidden option -l
  2004-12-06 23:44 Enable hidden option -l Andreas Schwab
@ 2004-12-07  5:00 ` Eli Zaretskii
  2004-12-07  5:24 ` Daniel Jacobowitz
  2004-12-12 18:13 ` Andrew Cagney
  2 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2004-12-07  5:00 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gdb-patches

> From: Andreas Schwab <schwab@suse.de>
> Date: Tue, 07 Dec 2004 00:42:04 +0100
> 
> 2004-12-07  Andreas Schwab  <schwab@suse.de>
> 
> 	* main.c (long_options): Add entry for "-l".
> 	(print_gdb_help): Add line for -l option.
> 
> doc/
> 	* gdb.texinfo (Mode Options): Document -l option.

The gdb.texinfo patch is approved.  Thanks.

If the code is approved (I personally am in favor), I think we shiould
document this in NEWS as well.


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

* Re: Enable hidden option -l
  2004-12-06 23:44 Enable hidden option -l Andreas Schwab
  2004-12-07  5:00 ` Eli Zaretskii
@ 2004-12-07  5:24 ` Daniel Jacobowitz
  2004-12-07 15:56   ` Andreas Schwab
  2004-12-12 18:13 ` Andrew Cagney
  2 siblings, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2004-12-07  5:24 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gdb-patches

On Tue, Dec 07, 2004 at 12:42:04AM +0100, Andreas Schwab wrote:
> GDB has (since the beginning of CVS history) a hidden option -l that can
> be used to set the timeout for remote communication.  But it was never
> possible to pass it because it is missing from long_options.
> 
> The option is quite useful when debugging gdbserver.

This is the same as "set remotetimeout".  I can see how the command
line argument would be useful, though.  Eli and I both think this is a
good idea; so I'll approve the code change.


-- 
Daniel Jacobowitz


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

* Re: Enable hidden option -l
  2004-12-07  5:24 ` Daniel Jacobowitz
@ 2004-12-07 15:56   ` Andreas Schwab
  0 siblings, 0 replies; 8+ messages in thread
From: Andreas Schwab @ 2004-12-07 15:56 UTC (permalink / raw)
  To: gdb-patches

Daniel Jacobowitz <drow@false.org> writes:

> On Tue, Dec 07, 2004 at 12:42:04AM +0100, Andreas Schwab wrote:
>> GDB has (since the beginning of CVS history) a hidden option -l that can
>> be used to set the timeout for remote communication.  But it was never
>> possible to pass it because it is missing from long_options.
>> 
>> The option is quite useful when debugging gdbserver.
>
> This is the same as "set remotetimeout".

Oh, I only grepped in the gdb toplevel so I missed the cli directory.

> I can see how the command line argument would be useful, though.  Eli
> and I both think this is a good idea; so I'll approve the code change.

This is what I'm checking in:

2004-12-07  Andreas Schwab  <schwab@suse.de>

	* main.c (long_options): Add entry for "-l".
	(print_gdb_help): Add line for -l option.
	* NEWS: Mention it.

doc/
	* gdb.texinfo (Mode Options): Document -l option.

Index: gdb/NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.167
diff -u -p -a -r1.167 NEWS
--- gdb/NEWS	14 Nov 2004 00:10:52 -0000	1.167
+++ gdb/NEWS	7 Dec 2004 11:00:56 -0000
@@ -14,6 +14,11 @@ NEC V850					v850-*-*
 
 *** Changes in GDB 6.3:
 
+* New command line option
+
+GDB now accepts -l followed by a number to set the timeout for remote
+debugging.
+
 * GDB works with GCC -feliminate-dwarf2-dups
 
 GDB now supports a more compact representation of DWARF-2 debug
Index: gdb/main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.44
diff -u -p -a -r1.44 main.c
--- gdb/main.c	10 Aug 2004 22:36:39 -0000	1.44
+++ gdb/main.c	7 Dec 2004 11:00:56 -0000
@@ -300,6 +300,7 @@ captured_main (void *data)
       {"statistics", no_argument, 0, OPT_STATISTICS},
       {"write", no_argument, &write_files, 1},
       {"args", no_argument, &set_args, 1},
+     {"l", required_argument, 0, 'l'},
       {0, no_argument, 0, 0}
     };
 
@@ -854,6 +855,7 @@ Options:\n\n\
                      Select a specific interpreter / user interface\n\
 "), stream);
   fputs_unfiltered (_("\
+  -l TIMEOUT         Set timeout in seconds for remote debugging.\n\
   --mapped           Use mapped symbol files if supported on this system.\n\
   --nw		     Do not use a window interface.\n\
   --nx               Do not read "), stream);
Index: gdb/doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.227
diff -u -p -a -r1.227 gdb.texinfo
--- gdb/doc/gdb.texinfo	23 Nov 2004 12:12:15 -0000	1.227
+++ gdb/doc/gdb.texinfo	7 Dec 2004 11:00:57 -0000
@@ -1078,6 +1078,11 @@ This option stops option processing.
 Set the line speed (baud rate or bits per second) of any serial
 interface used by @value{GDBN} for remote debugging.
 
+@item -l @var{timeout}
+@cindex @code{-l}
+Set the timeout (in seconds) of any communication used by @value{GDBN}
+for remote debugging.
+
 @item -tty @var{device}
 @itemx -t @var{device}
 @cindex @code{--tty}

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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

* Re: Enable hidden option -l
  2004-12-06 23:44 Enable hidden option -l Andreas Schwab
  2004-12-07  5:00 ` Eli Zaretskii
  2004-12-07  5:24 ` Daniel Jacobowitz
@ 2004-12-12 18:13 ` Andrew Cagney
  2004-12-12 18:33   ` Andreas Schwab
  2004-12-15 16:42   ` Andreas Schwab
  2 siblings, 2 replies; 8+ messages in thread
From: Andrew Cagney @ 2004-12-12 18:13 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gdb-patches

Andreas Schwab wrote:
> GDB has (since the beginning of CVS history) a hidden option -l that can
> be used to set the timeout for remote communication.  But it was never
> possible to pass it because it is missing from long_options.
> 
> The option is quite useful when debugging gdbserver.

Can you test this?  At least to the point of ensuring that it affects 
the corresponding variable.

Andrew


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

* Re: Enable hidden option -l
  2004-12-12 18:13 ` Andrew Cagney
@ 2004-12-12 18:33   ` Andreas Schwab
  2004-12-15 16:42   ` Andreas Schwab
  1 sibling, 0 replies; 8+ messages in thread
From: Andreas Schwab @ 2004-12-12 18:33 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

Andrew Cagney <cagney@gnu.org> writes:

> Andreas Schwab wrote:
>> GDB has (since the beginning of CVS history) a hidden option -l that can
>> be used to set the timeout for remote communication.  But it was never
>> possible to pass it because it is missing from long_options.
>> The option is quite useful when debugging gdbserver.
>
> Can you test this?

You mean a test for the gdb testsuite?

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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

* Re: Enable hidden option -l
  2004-12-12 18:13 ` Andrew Cagney
  2004-12-12 18:33   ` Andreas Schwab
@ 2004-12-15 16:42   ` Andreas Schwab
  2005-02-09 16:49     ` Andrew Cagney
  1 sibling, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2004-12-15 16:42 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

Andrew Cagney <cagney@gnu.org> writes:

> Can you test this?  At least to the point of ensuring that it affects the
> corresponding variable.

How about this?

2004-12-15  Andreas Schwab  <schwab@suse.de>

	* gdb.base/remotetimeout.exp: New file.

--- /dev/null	2004-10-26 03:06:42.000000000 +0200
+++ gdb/testsuite/gdb.base/remotetimeout.exp	2004-12-15 15:15:23.995381757 +0100
@@ -0,0 +1,46 @@
+# Copyright 2004 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@gnu.org
+
+# This is a test for the gdb invocation option -l.
+
+if $tracelevel then {
+    strace $tracelevel
+}
+
+
+global GDBFLAGS
+
+# Skip test if target does not support argument passing.
+if [target_info exists noargs] {
+    return;
+}
+
+#
+# Test that -l is processed correctly.
+#
+set old_gdbflags $GDBFLAGS
+set GDBFLAGS "-l 42"
+gdb_exit
+gdb_start
+gdb_test "show remotetimeout" \
+	"Timeout limit to wait for target to respond is 42\." \
+	"correct remotetimeout printed"
+
+set GDBFLAGS $old_gdbflags
+

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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

* Re: Enable hidden option -l
  2004-12-15 16:42   ` Andreas Schwab
@ 2005-02-09 16:49     ` Andrew Cagney
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Cagney @ 2005-02-09 16:49 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gdb-patches

Andreas Schwab wrote:
> Andrew Cagney <cagney@gnu.org> writes:
> 
> 
>>Can you test this?  At least to the point of ensuring that it affects the
>>corresponding variable.
> 
> 
> How about this?

Perfect.  I've committed it.

thanks,
Andrew

> 2004-12-15  Andreas Schwab  <schwab@suse.de>
> 
> 	* gdb.base/remotetimeout.exp: New file.
> 
> --- /dev/null	2004-10-26 03:06:42.000000000 +0200
> +++ gdb/testsuite/gdb.base/remotetimeout.exp	2004-12-15 15:15:23.995381757 +0100
> @@ -0,0 +1,46 @@
> +# Copyright 2004 Free Software Foundation, Inc.
> +
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 2 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
> +
> +# Please email any bugs, comments, and/or additions to this file to:
> +# bug-gdb@gnu.org
> +
> +# This is a test for the gdb invocation option -l.
> +
> +if $tracelevel then {
> +    strace $tracelevel
> +}
> +
> +
> +global GDBFLAGS
> +
> +# Skip test if target does not support argument passing.
> +if [target_info exists noargs] {
> +    return;
> +}
> +
> +#
> +# Test that -l is processed correctly.
> +#
> +set old_gdbflags $GDBFLAGS
> +set GDBFLAGS "-l 42"
> +gdb_exit
> +gdb_start
> +gdb_test "show remotetimeout" \
> +	"Timeout limit to wait for target to respond is 42\." \
> +	"correct remotetimeout printed"
> +
> +set GDBFLAGS $old_gdbflags
> +
> 
> Andreas.
> 


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

end of thread, other threads:[~2005-02-09 14:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-06 23:44 Enable hidden option -l Andreas Schwab
2004-12-07  5:00 ` Eli Zaretskii
2004-12-07  5:24 ` Daniel Jacobowitz
2004-12-07 15:56   ` Andreas Schwab
2004-12-12 18:13 ` Andrew Cagney
2004-12-12 18:33   ` Andreas Schwab
2004-12-15 16:42   ` Andreas Schwab
2005-02-09 16:49     ` Andrew Cagney

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