remote_timeout

J.T. Conklin jtc@redback.com
Mon Aug 23 18:19:00 GMT 1999


>>>>> "Stan" == Stan Shebs <shebs@cygnus.com> writes:
Stan> Since this is clearly a case of Cygnus making everbody's lives
Stan> miserable for the sake of E7000-using customers :-), I'm
Stan> amenable to bumping the default down to a more reasonable level.
Stan> It would be even more clever to add the default timeout to the
Stan> target vector, but I'll leave that as an exercise for the
Stan> energetic.

If remote_timeout is going to be set by the target vector, there
should probably be a value that indicates the 'default' for whatever
protocol you're using.  Then the target's open() function would only
set remote_timeout iff it holds the default value --- Maybe something
like how baudrate is handled now.

As I'm not feeling particularly energetic today, I'm just sending in a
patch that restores the default value of 2 to remote_timeout.  I did
add a comment that explains a bit of the history behind the changes to
the default that have occured over the years.

        --jtc

1999-08-23  J.T. Conklin  <jtc@redback.com>

	* top.c (remote_timeout): Change default to 2.  Add comment
 	explaining history of changes to the default value.
	* remote.c (_initialize_remote): Remove code that adds set/ 
	show remotetimeout, as that's also done in top.c

Index: top.c
===================================================================
RCS file: /home/jtc/CVSROOT/gdb/gdb/top.c,v
retrieving revision 1.2
diff -c -r1.2 top.c
*** top.c	1999/08/23 23:49:14	1.2
--- top.c	1999/08/24 01:02:22
***************
*** 323,329 ****
  
  /* Timeout limit for response from target. */
  
! int remote_timeout = 20;	/* Set default to 20 */
  
  /* Non-zero tells remote* modules to output debugging info.  */
  
--- 323,347 ----
  
  /* Timeout limit for response from target. */
  
! /* The default value has been changed many times over the years.  It 
!    was originally 5 seconds.  But that was thought to be a long time 
!    to sit and wait, so it was changed to 2 seconds.  That was thought
!    to be plenty unless the connection was going through some terminal 
!    server or multiplexer or other form of hairy serial connection.
! 
!    In mid-1996, remote_timeout was moved from remote.c to top.c and 
!    it began being used in other remote-* targets.  It appears that the
!    default was changed to 20 seconds at that time, perhaps because the
!    Hitachi E7000 ICE didn't always respond in a timely manner.
! 
!    But if 5 seconds is a long time to sit and wait for retransmissions,
!    20 seconds is far worse.  This demonstrates the difficulty of using 
!    a single variable for all protocol timeouts.
! 
!    As remote.c is used much more than remote-e7000.c, it was changed 
!    back to 2 seconds in 1999. */
! 
! int remote_timeout = 2;
  
  /* Non-zero tells remote* modules to output debugging info.  */
  
Index: remote.c
===================================================================
RCS file: /home/jtc/CVSROOT/gdb/gdb/remote.c,v
retrieving revision 1.2
diff -c -r1.2 remote.c
*** remote.c	1999/08/23 22:16:31	1.2
--- remote.c	1999/08/23 23:50:39
***************
*** 249,263 ****
  
  static struct target_ops extended_async_remote_ops;
  
- /* This was 5 seconds, which is a long time to sit and wait.
-    Unless this is going though some terminal server or multiplexer or
-    other form of hairy serial connection, I would think 2 seconds would
-    be plenty.  */
- 
- /* Changed to allow option to set timeout value.
-    was static int remote_timeout = 2; */
- extern int remote_timeout;
- 
  /* This variable chooses whether to send a ^C or a break when the user
     requests program interruption.  Although ^C is usually what remote
     systems expect, and that is the default here, sometimes a break is
--- 249,254 ----
***************
*** 5159,5171 ****
  response packet.  GDB supplies the initial `$' character, and the\n\
  terminating `#' character and checksum.",
  	   &maintenancelist);
- 
-   add_show_from_set
-     (add_set_cmd ("remotetimeout", no_class,
- 		  var_integer, (char *) &remote_timeout,
- 		  "Set timeout value for remote read.\n",
- 		  &setlist),
-      &showlist);
  
    add_show_from_set
      (add_set_cmd ("remotebreak", no_class,
--- 5150,5155 ----


-- 
J.T. Conklin
RedBack Networks


More information about the Gdb mailing list