int icache;
#endif
-/* FIXME: This is a hack which lets this file compile. It should be getting
- this setting from remote-utils.c. */
-#define remote_debug (0)
-
/* Descriptor for I/O to remote machine. Initialize it to NULL so that
remote_open knows that we don't have a file open when the program
starts. */
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 ");
/* If this doesn't work, try more severe steps. */
signal (signo, remote_interrupt_twice);
- if (remote_debug)
+ if (sr_get_debug ())
printf ("remote_interrupt called\n");
SERIAL_WRITE (remote_desc, "\003", 1); /* Send a ^C */
{
struct section_offsets *offs;
+ /* FIXME: This code assumes gdb-stabs.h is being used;
+ it's broken for xcoff, dwarf, sdb-coff, etc. But
+ there is no simple canonical representation for this
+ 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? */
+ in the sym_fns vectors set this?
+ (no good reason -kingdon). */
if (symfile_objfile->num_sections == 0)
symfile_objfile->num_sections = SECT_OFF_MAX;
while (1)
{
- if (remote_debug)
+ if (sr_get_debug ())
{
*p = '\0';
printf ("Sending packet: %s...", buf2); fflush(stdout);
switch (ch)
{
case '+':
- if (remote_debug)
+ if (sr_get_debug ())
printf("Ack\n");
return;
case SERIAL_TIMEOUT:
case SERIAL_EOF:
error ("putpkt: EOF while trying to read ACK");
default:
- if (remote_debug)
+ if (sr_get_debug ())
printf ("%02X %c ", ch&0xFF, ch);
continue;
}
if (forever)
continue;
if (++retries >= MAX_RETRIES)
- if (remote_debug) puts_filtered ("Timed out.\n");
+ if (sr_get_debug ()) puts_filtered ("Timed out.\n");
goto out;
}
c = readchar ();
if (c == SERIAL_TIMEOUT)
{
- if (remote_debug)
+ if (sr_get_debug ())
puts_filtered ("Timeout in mid-packet, retrying\n");
goto whole; /* Start a new packet, count retries */
}
if (c == '$')
{
- if (remote_debug)
+ if (sr_get_debug ())
puts_filtered ("Saw new packet start in middle of old one\n");
goto whole; /* Start a new packet, count retries */
}
SERIAL_WRITE (remote_desc, "+", 1);
- if (remote_debug)
+ if (sr_get_debug ())
fprintf (stderr,"Packet received: %s\n", buf);
}
\f