* remote.c, remote-utils.c: Use SERIAL_FLUSH_INPUT after opening it.
authorJim Kingdon <jkingdon@engr.sgi.com>
Tue, 21 Sep 1993 20:35:36 +0000 (20:35 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Tue, 21 Sep 1993 20:35:36 +0000 (20:35 +0000)
gdb/ChangeLog
gdb/remote-utils.c
gdb/remote.c

index 63e5cb3d0ab287d0b6200fc4c122263f332e9ad4..aa3fe96c2951decda36e5964e91ff006aeaef6ce 100644 (file)
@@ -1,5 +1,7 @@
 Tue Sep 21 11:44:00 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
 
+       * remote.c, remote-utils.c: Use SERIAL_FLUSH_INPUT after opening it.
+
        * printcmd.c (print_scalar_formatted): When truncating value we are
        going to print as unsigned, handle it generally for any length
        less than sizeof (LONGEST), rather than special-casing sizeof (char),
index 290e73fceb9a71d90055e37d6f210d7e34ab974a..efe166958d99303362bb503471c60b167dc36ecb 100644 (file)
@@ -183,6 +183,10 @@ gr_open(args, from_tty, gr)
 
   SERIAL_RAW (sr_get_desc());
 
+  /* If there is something sitting in the buffer we might take it as a
+     response to a command, which would be bad.  */
+  SERIAL_FLUSH_INPUT (sr_get_desc ());
+
   /* default retries */
   if (sr_get_retries() == 0)
     sr_set_retries(1);
index 0f174df0e42f4631608a5a87e9a3647ab8854368..d3fef8ba12b440c4b283dec1875f3cb25909dd78 100644 (file)
@@ -302,6 +302,10 @@ device is attached to the remote system (e.g. /dev/ttya).");
 
   SERIAL_RAW (remote_desc);
 
+  /* If there is something sitting in the buffer we might take it as a
+     response to a command, which would be bad.  */
+  SERIAL_FLUSH_INPUT (remote_desc);
+
   if (from_tty)
     {
       puts_filtered ("Remote debugging using ");
This page took 0.031596 seconds and 4 git commands to generate.