This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[patch/mips] Remove remote-mips output limit
- To: GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- Subject: [patch/mips] Remove remote-mips output limit
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Sat, 17 Jun 2000 23:54:21 +1000
- Organization: Cygnus Solutions
FYI,
The attatched changes how remote-mips treates stray characters from
target. Instead of assuming that stray characters are bad or indicate a
problem, it instead assumes that they are normal output. Only when
unprintable characters start to be received does it take notice.
This, if nothing else, removes a somewhat arbitrary limit to the number
of characters that a remote pmon/mips/... target could print.
enjoy,
Andrew
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.
Index: remote-mips.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-mips.c,v
retrieving revision 1.4
diff -p -r1.4 remote-mips.c
*** remote-mips.c 2000/06/06 06:19:57 1.4
--- remote-mips.c 2000/06/17 13:49:49
***************
*** 36,41 ****
--- 36,43 ----
#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
*************** static int mips_send_retries = 10;
*** 356,362 ****
/* The number of garbage characters to accept when looking for an
SYN for the next packet. */
! static int mips_syn_garbage = 1050;
/* The time to wait for a packet, in seconds. */
static int mips_receive_wait = 5;
--- 358,364 ----
/* The number of garbage characters to accept when looking for an
SYN for the next packet. */
! static int mips_syn_garbage = 10;
/* The time to wait for a packet, in seconds. */
static int mips_receive_wait = 5;
*************** mips_receive_header (hdr, pgarbage, ch,
*** 753,767 ****
{
/* 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);
! }
- ++*pgarbage;
if (mips_syn_garbage > 0
&& *pgarbage > mips_syn_garbage)
mips_error ("Debug protocol failure: more than %d characters before a sync.",
--- 755,780 ----
{
/* 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 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;
if (mips_syn_garbage > 0
&& *pgarbage > mips_syn_garbage)
mips_error ("Debug protocol failure: more than %d characters before a sync.",