starts. */
serial_t remote_desc = NULL;
-#define PBUFSIZ 1024
+/* Having this larger than 400 causes us to be incompatible with m68k-stub.c
+ and i386-stub.c. Normally, no one would notice because it only matters
+ for writing large chunks of memory (e.g. in downloads). Also, this needs
+ to be more than 400 if required to hold the registers (see below, where
+ we round it up based on REGISTER_BYTES). */
+#define PBUFSIZ 400
/* Maximum number of bytes to read/write at once. The value here
is chosen to fill up a packet (the headers account for the 32). */
signal (signo, remote_interrupt_twice);
if (remote_debug)
- printf ("remote_interrupt called\n");
+ printf_unfiltered ("remote_interrupt called\n");
SERIAL_WRITE (remote_desc, "\003", 1); /* Send a ^C */
}
stuff. (Just what does "text" as seen by the stub
mean, anyway?). */
- /* FIXME: Why don't the various symfile_offsets routines
- in the sym_fns vectors set this?
- (no good reason -kingdon). */
- if (symfile_objfile->num_sections == 0)
- symfile_objfile->num_sections = SECT_OFF_MAX;
-
offs = ((struct section_offsets *)
alloca (sizeof (struct section_offsets)
+ (symfile_objfile->num_sections
&& (buf[0] < 'a' || buf[0] > 'f'))
{
if (remote_debug)
- printf ("Bad register packet; fetching a new packet\n");
+ printf_unfiltered ("Bad register packet; fetching a new packet\n");
getpkt (buf, 0);
}
int i;
char *p;
- if (len > PBUFSIZ / 2 - 20)
- abort ();
-
sprintf (buf, "M%x,%x:", memaddr, len);
/* We send target system values byte by byte, in increasing byte addresses,
if (remote_debug)
{
*p = '\0';
- printf ("Sending packet: %s...", buf2); fflush(stdout);
+ printf_unfiltered ("Sending packet: %s...", buf2); gdb_flush(gdb_stdout);
}
if (SERIAL_WRITE (remote_desc, buf2, p - buf2))
perror_with_name ("putpkt: write failed");
{
case '+':
if (remote_debug)
- printf("Ack\n");
+ printf_unfiltered("Ack\n");
return;
case SERIAL_TIMEOUT:
break; /* Retransmit buffer */
error ("putpkt: EOF while trying to read ACK");
default:
if (remote_debug)
- printf ("%02X %c ", ch&0xFF, ch);
+ printf_unfiltered ("%02X %c ", ch&0xFF, ch);
continue;
}
break; /* Here to retransmit */
}
else
{
- printf ("Ignoring packet error, continuing...\n");
+ printf_unfiltered ("Ignoring packet error, continuing...\n");
break;
}
}
SERIAL_WRITE (remote_desc, "+", 1);
if (remote_debug)
- fprintf (stderr,"Packet received: %s\n", buf);
+ fprintf_unfiltered (gdb_stderr,"Packet received: %s\n", buf);
}
\f
static void