#include "remote-utils.h"
struct _sr_settings sr_settings = {
- 0, /* debug */
- 9600, /* baud */
4, /* timeout:
remote-hms.c had 2
remote-bug.c had "with a timeout of 2, we time out waiting for
char *junk;
{
if (junk != NULL)
- fprintf(stderr, "Unrecognized arguments: `%s'.\n", junk);
+ fprintf_unfiltered(gdb_stderr, "Unrecognized arguments: `%s'.\n", junk);
/* FIXME-now: service@host? */
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);
error ("Timeout reading from remote system.");
if (sr_get_debug() > 0)
- printf ("%c", buf);
+ printf_unfiltered ("%c", buf);
return buf & 0x7f;
}
buf = 0;
if (sr_get_debug() > 0)
if (buf)
- printf ("%c", buf);
+ printf_unfiltered ("%c", buf);
else
- printf ("<empty character poll>");
+ printf_unfiltered ("<empty character poll>");
return buf & 0x7f;
}
if (sr_get_debug() > 0)
for (i = 0; i < l; i++)
- printf ("%c", a[i]);
+ printf_unfiltered ("%c", a[i]);
return;
}
swallowed_p = swallowed = alloca(max_length << 1);
/* and a list of pointers to current scan points. */
- plist = alloca(string_count * sizeof(*plist));
+ plist = (char **) alloca (string_count * sizeof(*plist));
/* and initialize */
for (i = 0; i < string_count; ++i)
if (passthrough)
{
for (p = swallowed; p < swallowed_p; ++p)
- putc (*p, stdout);
+ putc_unfiltered (*p, gdb_stdout);
- putc (ch, stdout);
+ putc_unfiltered (ch, gdb_stdout);
}
swallowed_p = swallowed;
}
}
-
+#if 0
+ /* Never reached. */
return(-1);
+#endif
}
/* Get ready to modify the registers array. On machines which store
void
_initialize_sr_support ()
{
- add_show_from_set (add_set_cmd ("remotedebug", no_class,
- var_zinteger, (char *)&sr_settings.debug,
- "Set debugging of remote serial I/O.\n\
-When non-zero, each packet sent or received with the remote target\n\
-is displayed. Higher numbers produce more debugging.", &setlist),
- &showlist);
-
-/* FIXME-now: if target is open when baud changes... */
- add_show_from_set (add_set_cmd ("remotebaud", no_class,
- var_zinteger, (char *)&sr_settings.baud_rate,
- "Set baud rate for remote serial I/O.\n\
-This value is used to set the speed of the serial port when debugging\n\
-using remote targets.", &setlist),
- &showlist);
-
/* FIXME-now: if target is open... */
add_show_from_set (add_set_cmd ("remotedevice", no_class,
var_filename, (char *)&sr_settings.device,