aboutsummaryrefslogtreecommitdiff
path: root/gdb/serial.h
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1998-03-06 20:38:45 +0000
committerFred Fish <fnf@specifix.com>1998-03-06 20:38:45 +0000
commit3ffbdf15324b373b8a941dc58e421d1420b80ffc (patch)
treef0d22634fc0a49fcefa896ac1cc2a44742917dbe /gdb/serial.h
parentd030671bfc3affe14cd56137f4f343290942fbb7 (diff)
downloadgdb-3ffbdf15324b373b8a941dc58e421d1420b80ffc.zip
gdb-3ffbdf15324b373b8a941dc58e421d1420b80ffc.tar.gz
gdb-3ffbdf15324b373b8a941dc58e421d1420b80ffc.tar.bz2
PR 15068
* utils.c (quit): Call SERIAL_DRAIN_OUTPUT rather than SERIAL_FLUSH_OUTPUT. * serial.h (struct serial_ops): Add drain_output, pointer to function that waits for output to drain. (SERIAL_DRAIN_OUTPUT): Macro to wait for output to drain. * ser-unix.c (hardwire_drain_output): New function and prototype. * ser-unix.c (hardwire_ops): Add entry for drain_output function. * ser-tcp.c (tcp_ops): Ditto. * ser-ocd.c (ocd_ops): Ditto. * ser-mac.c (mac_ops): Ditto. * ser-go32.c (dos_ops): Ditto. * ser-e7kpc.c (e7000pc_ops): Ditto.
Diffstat (limited to 'gdb/serial.h')
-rw-r--r--gdb/serial.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/serial.h b/gdb/serial.h
index f1963d0..04332bc 100644
--- a/gdb/serial.h
+++ b/gdb/serial.h
@@ -50,7 +50,9 @@ struct serial_ops {
void (*close) PARAMS ((serial_t));
int (*readchar) PARAMS ((serial_t, int timeout));
int (*write) PARAMS ((serial_t, const char *str, int len));
+ /* Discard pending output */
int (*flush_output) PARAMS ((serial_t));
+ /* Discard pending input */
int (*flush_input) PARAMS ((serial_t));
int (*send_break) PARAMS ((serial_t));
void (*go_raw) PARAMS ((serial_t));
@@ -61,6 +63,8 @@ struct serial_ops {
PARAMS ((serial_t, serial_ttystate, serial_ttystate));
int (*setbaudrate) PARAMS ((serial_t, int rate));
int (*setstopbits) PARAMS ((serial_t, int num));
+ /* Wait for output to drain */
+ int (*drain_output) PARAMS ((serial_t));
};
/* Add a new serial interface to the interface list */
@@ -83,7 +87,12 @@ serial_t serial_fdopen PARAMS ((const int fd));
#define SERIAL_FDOPEN(FD) serial_fdopen(FD)
-/* Flush pending output. Might also flush input (if this system can't flush
+/* Allow pending output to drain. */
+
+#define SERIAL_DRAIN_OUTPUT(SERIAL_T) \
+ ((SERIAL_T)->ops->drain_output((SERIAL_T)))
+
+/* Flush (discard) pending output. Might also flush input (if this system can't flush
only output). */
#define SERIAL_FLUSH_OUTPUT(SERIAL_T) \