aboutsummaryrefslogtreecommitdiff
path: root/gdb/serial.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2017-11-06 15:36:46 +0000
committerPedro Alves <palves@redhat.com>2017-11-06 15:36:46 +0000
commit726e13564b615e5d8e9540b509623e58dfce2012 (patch)
tree9d7e98916b531f20dfff8612343211342d00d1ec /gdb/serial.h
parent1cfb73dbb7503d1cfb088c14d1125a5030a1f386 (diff)
downloadgdb-726e13564b615e5d8e9540b509623e58dfce2012.zip
gdb-726e13564b615e5d8e9540b509623e58dfce2012.tar.gz
gdb-726e13564b615e5d8e9540b509623e58dfce2012.tar.bz2
Assume termios is available, remove support for termio and sgtty
This commit garbage collects the termio and sgtty support. GDB's terminal handling code still has support for the old termio and sgtty interfaces in addition to termios. However, I think it's pretty safe to assume that for a long, long time, Unix-like systems provide termios. GNU/Linux, Solaris, Cygwin, AIX, DJGPP, macOS and the BSDs all have had termios.h for many years. Looking around the web, I found discussions about FreeBSD folks trying to get rid of old sgtty.h a decade ago: https://lists.freebsd.org/pipermail/freebsd-hackers/2007-March/019983.html So I think support for termio and sgtty in GDB is just dead code that is never compiled anywhere and is just getting in the way. For example, serial_noflush_set_tty_state and the raw<->cooked concerns mentioned in inflow.c only exist because of sgtty (see hardwire_noflush_set_tty_state). Regtested on GNU/Linux. Confirmed that I can still build Solaris, DJGPP and AIX GDB and that the resulting GDBs still include the termios.h-guarded code. Confirmed mingw-w64 GDB still builds and skips the termios.h-guarded code. gdb/ChangeLog: 2017-11-06 Pedro Alves <palves@redhat.com> * Makefile.in (SER_HARDWIRE): Update comment. (HFILES_NO_SRCDIR): Remove gdb_termios.h. * common/gdb_termios.h: Delete file. * common/job-control.c: Include termios.h and unistd.h instead of gdb_termios.h. (gdb_setpgid): Remove HAVE_TERMIOS || TIOCGPGRP preprocessor check. (have_job_control): Check HAVE_TERMIOS_H instead of HAVE_TERMIOS. Remove sgtty code. * configure.ac: No longer check for termio.h and sgtty.h. * configure: Regenerate. * inflow.c: Include termios.h instead of gdb_termios.h. Replace PROCESS_GROUP_TYPE checks with HAVE_TERMIOS_H checks throughout. Replace PROCESS_GROUP_TYPE references with pid_t references throughout. (gdb_getpgrp): Delete. (set_initial_gdb_ttystate): Use tcgetpgrp instead of gdb_getpgrp. (child_terminal_inferior): Remove comment. Remove sgtty code. (child_terminal_ours_1): Use tcgetpgrp directly instead of gdb_getpgrp. Use serial_set_tty_state instead aof serial_noflush_set_tty_state. Remove sgtty code. * inflow.h: Include unistd.h instead of gdb_termios.h. Replace PROCESS_GROUP_TYPE check with HAVE_TERMIOS_H check. (inferior_process_group): Now returns pid_t. * ser-base.c (ser_base_noflush_set_tty_state): Delete. * ser-base.h (ser_base_noflush_set_tty_state): Delete. * ser-event.c (serial_event_ops): Update. * ser-go32.c (dos_noflush_set_tty_state): Delete. (dos_ops): Update. * ser-mingw.c (hardwire_ops, tty_ops, pipe_ops, tcp_ops): Update. * ser-pipe.c (pipe_ops): Update. * ser-tcp.c (tcp_ops): Update. * ser-unix.c: Include termios.h instead of gdb_termios.h. Remove HAVE_TERMIOS checks. [HAVE_TERMIO] (struct hardwire_ttystate): Delete. [HAVE_SGTTY] (struct hardwire_ttystate): Delete. (get_tty_state, set_tty_state): Drop termio and sgtty code, and assume termios. (hardwire_noflush_set_tty_state): Delete. (hardwire_print_tty_state, hardwire_drain_output) (hardwire_flush_output, hardwire_flush_input) (hardwire_send_break, hardwire_raw, hardwire_setbaudrate) (hardwire_setstopbits, hardwire_setparity): Drop termio and sgtty code, and assume termios. (hardwire_ops): Update. (_initialize_ser_hardwire): Remove HAVE_TERMIOS check. * serial.c (serial_noflush_set_tty_state): Delete. * serial.h (serial_noflush_set_tty_state): Delete. (serial_ops::noflush_set_tty_state): Delete. gdb/gdbserver/ChangeLog: 2017-11-06 Pedro Alves <palves@redhat.com> * configure.ac: No longer check for termio.h and sgtty.h. * configure: Regenerate. * remote-utils.c: Include termios.h instead of gdb_termios.h. (remote_open): Check HAVE_TERMIOS_H instead of HAVE_TERMIOS. Remove termio and sgtty code.
Diffstat (limited to 'gdb/serial.h')
-rw-r--r--gdb/serial.h12
1 files changed, 0 insertions, 12 deletions
diff --git a/gdb/serial.h b/gdb/serial.h
index c76ddbe..647eab3 100644
--- a/gdb/serial.h
+++ b/gdb/serial.h
@@ -169,16 +169,6 @@ extern void serial_print_tty_state (struct serial *scb,
serial_ttystate ttystate,
struct ui_file *);
-/* Set the tty state to NEW_TTYSTATE, where OLD_TTYSTATE is the
- current state (generally obtained from a recent call to
- serial_get_tty_state()), but be careful not to discard any input.
- This means that we never switch in or out of raw mode, even if
- NEW_TTYSTATE specifies a switch. */
-
-extern int serial_noflush_set_tty_state (struct serial *scb,
- serial_ttystate new_ttystate,
- serial_ttystate old_ttystate);
-
/* Set the baudrate to the decimal value supplied. Returns 0 for
success, -1 for failure. */
@@ -276,8 +266,6 @@ struct serial_ops
int (*set_tty_state) (struct serial *, serial_ttystate);
void (*print_tty_state) (struct serial *, serial_ttystate,
struct ui_file *);
- int (*noflush_set_tty_state) (struct serial *, serial_ttystate,
- serial_ttystate);
int (*setbaudrate) (struct serial *, int rate);
int (*setstopbits) (struct serial *, int num);
/* Set the value PARITY as parity setting for serial object.