/* FIXME: cagney/1999-10-11: Don't enable this check until the ASYNC
code is finished. */
- if (0 && SERIAL_IS_ASYNC_P (scb) && timeout < 0)
+ if (0 && serial_is_async_p (scb) && timeout < 0)
internal_error (__FILE__, __LINE__,
"serial_readchar: blocking read in async mode");
in case we are getting ready to dump core or something. */
gdb_flush (serial_logfp);
}
- if (SERIAL_DEBUG_P (scb))
+ if (serial_debug_p (scb))
{
fprintf_unfiltered (gdb_stdlog, "[");
serial_logchar (gdb_stdlog, 'r', ch, timeout);
va_start (args, format);
xvasprintf (&buf, format, args);
- SERIAL_WRITE (desc, buf, strlen (buf));
+ serial_write (desc, buf, strlen (buf));
xfree (buf);
va_end (args);
cleanup_tty (serial_ttystate ttystate)
{
printf_unfiltered ("\r\n[Exiting connect mode]\r\n");
- SERIAL_SET_TTY_STATE (tty_desc, ttystate);
+ serial_set_tty_state (tty_desc, ttystate);
xfree (ttystate);
- SERIAL_CLOSE (tty_desc);
+ serial_close (tty_desc);
}
static void
printf_unfiltered ("[Entering connect mode. Use ~. or ~^D to escape]\n");
- tty_desc = SERIAL_FDOPEN (0);
+ tty_desc = serial_fdopen (0);
port_desc = last_serial_opened;
- ttystate = SERIAL_GET_TTY_STATE (tty_desc);
+ ttystate = serial_get_tty_state (tty_desc);
- SERIAL_RAW (tty_desc);
- SERIAL_RAW (port_desc);
+ serial_raw (tty_desc);
+ serial_raw (port_desc);
make_cleanup (cleanup_tty, ttystate);
{
int mask;
- mask = SERIAL_WAIT_2 (tty_desc, port_desc, -1);
+ mask = serial_wait_2 (tty_desc, port_desc, -1);
if (mask & 2)
{ /* tty input */
while (1)
{
- c = SERIAL_READCHAR (tty_desc, 0);
+ c = serial_readchar (tty_desc, 0);
if (c == SERIAL_TIMEOUT)
break;
perror_with_name ("connect");
cx = c;
- SERIAL_WRITE (port_desc, &cx, 1);
+ serial_write (port_desc, &cx, 1);
switch (cur_esc)
{
while (1)
{
- c = SERIAL_READCHAR (port_desc, 0);
+ c = serial_readchar (port_desc, 0);
if (c == SERIAL_TIMEOUT)
break;
cx = c;
- SERIAL_WRITE (tty_desc, &cx, 1);
+ serial_write (tty_desc, &cx, 1);
}
}
}
}
#endif /* 0 */
+/* Serial set/show framework. */
+
+static struct cmd_list_element *serial_set_cmdlist;
+static struct cmd_list_element *serial_show_cmdlist;
+
+static void
+serial_set_cmd (char *args, int from_tty)
+{
+ printf_unfiltered ("\"set serial\" must be followed by the name of a command.\n");
+ help_list (serial_set_cmdlist, "set serial ", -1, gdb_stdout);
+}
+
+static void
+serial_show_cmd (char *args, int from_tty)
+{
+ cmd_show_list (serial_show_cmdlist, from_tty, "");
+}
+
+
void
_initialize_serial (void)
{
Use <CR>~. or <CR>~^D to break out.");
#endif /* 0 */
+ add_prefix_cmd ("serial", class_maintenance, serial_set_cmd, "\
+Set default serial/parallel port configuration.",
+ &serial_set_cmdlist, "set serial ",
+ 0/*allow-unknown*/,
+ &setlist);
+
+ add_prefix_cmd ("serial", class_maintenance, serial_show_cmd, "\
+Show default serial/parallel port configuration.",
+ &serial_show_cmdlist, "show serial ",
+ 0/*allow-unknown*/,
+ &showlist);
+
add_show_from_set
(add_set_cmd ("remotelogfile", no_class,
var_filename, (char *) &serial_logfile,