Remove arbitrary printf output limit placed on pmon targets
authorAndrew Cagney <cagney@redhat.com>
Sat, 17 Jun 2000 14:00:31 +0000 (14:00 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sat, 17 Jun 2000 14:00:31 +0000 (14:00 +0000)
gdb/ChangeLog
gdb/remote-mips.c

index a064931..38619e6 100644 (file)
@@ -1,3 +1,10 @@
+Sat Jun 17 16:00:56 2000  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * remote-mips.c: Include <ctype.h>
+       (mips_receive_header): Write printable characters to gdb_stdtarg
+       instead of gdb_stdlog.  Only count non-printables as invalid.
+       (mips_syn_garbage): Reduce to 10.
+
 Sat Jun 17 15:39:28 2000  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * mips-tdep.c (mips_gdbarch_init): When the object file header
index 0b75e4c..7954f9e 100644 (file)
@@ -36,6 +36,8 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
+#include <ctype.h>
+
 /* Microsoft C's stat.h doesn't define all the POSIX file modes.  */
 #ifndef S_IROTH
 #define S_IROTH S_IREAD
@@ -356,7 +358,7 @@ static int mips_send_retries = 10;
 
 /* The number of garbage characters to accept when looking for an
    SYN for the next packet.  */
-static int mips_syn_garbage = 1050;
+static int mips_syn_garbage = 10;
 
 /* The time to wait for a packet, in seconds.  */
 static int mips_receive_wait = 5;
@@ -753,15 +755,26 @@ mips_receive_header (hdr, pgarbage, ch, timeout)
            {
              /* Printing the character here lets the user of gdb see
                 what the program is outputting, if the debugging is
-                being done on the console port.  Don't use _filtered;
-                we can't deal with a QUIT out of target_wait.  */
-             if (!mips_initializing || remote_debug > 0)
-               {
-                 fputc_readable (ch, gdb_stdlog);
-                 gdb_flush (gdb_stdlog);
-               }
+                being done on the console port.  Don't use _filtered:
+                we can't deal with a QUIT out of target_wait and
+                buffered target output confuses the user. */
+             if (!mips_initializing || remote_debug > 0)
+               {
+                 if (isprint (ch) || isspace (ch))
+                   {
+                     fputc_unfiltered (ch, gdb_stdtarg);
+                   }
+                 else
+                   {
+                     fputc_readable (ch, gdb_stdtarg);
+                   }
+                 gdb_flush (gdb_stdtarg);
+               }
+             
+             /* Only count unprintable characters. */
+             if (! (isprint (ch) || isspace (ch)))
+               (*pgarbage) += 1;
 
-             ++*pgarbage;
              if (mips_syn_garbage > 0
                  && *pgarbage > mips_syn_garbage)
                mips_error ("Debug protocol failure:  more than %d characters before a sync.",