aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorSergio Durigan Junior <sergiodj@redhat.com>2017-04-11 21:05:12 -0400
committerSergio Durigan Junior <sergiodj@redhat.com>2017-04-12 17:59:45 -0400
commitbe628ab814f1c90e185d7482d27aa8a991ab5837 (patch)
tree6a15d8e6ed4f8558c80cd6897eb28db60ab89dd0 /gdb/gdbserver
parent8e9e35b1808481735e2d1efbf70ed7396a845d8e (diff)
downloadgdb-be628ab814f1c90e185d7482d27aa8a991ab5837.zip
gdb-be628ab814f1c90e185d7482d27aa8a991ab5837.tar.gz
gdb-be628ab814f1c90e185d7482d27aa8a991ab5837.tar.bz2
Create gdb_termios.h (and cleanup gdb/{,gdbserver/}terminal.h)
As requested, I'm sending this as a separate patch because it is ready to be included as-is. The idea here is that both gdb/terminal.h and gdb/gdbserver/terminal.h share the same code, which is responsible for setting a bunch of defines on based on the presence of termios.h and a few other headers. This simple patch just moves this common code to common/gdb_termios.h and makes the necessary adjustments on both GDB and gdbserver so that they can use this new header. It also implements the some header checks on common/common.m4. As a bonus, gdb/gdbserver/terminal.h can be removed because it's now empty. Built on x86_64, no regressions found. gdb/ChangeLog: 2017-04-12 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (HFILES_NO_SRCDIR): Add "common/gdb_termios.h". * common/common.m4: Check headers 'termios.h', 'termio.h' and 'sgtty.h'. * common/gdb_termios.h: New file, with parts of "terminal.h". * inflow.c: Include "gdb_termios.h". * ser-unix.c: Include "gdb_termios.h". * terminal.h: Move terminal-related defines to "common/gdb_termios.h". gdb/gdbserver/ChangeLog: 2017-04-12 Sergio Durigan Junior <sergiodj@redhat.com> * remote-utils.c: Include "gdb_termios.h" instead of "terminal.h". * terminal.h: Delete file.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog6
-rw-r--r--gdb/gdbserver/remote-utils.c2
-rw-r--r--gdb/gdbserver/terminal.h51
3 files changed, 7 insertions, 52 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 1f8c593..2060d25 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,11 @@
2017-04-12 Sergio Durigan Junior <sergiodj@redhat.com>
+ * remote-utils.c: Include "gdb_termios.h" instead of
+ "terminal.h".
+ * terminal.h: Delete file.
+
+2017-04-12 Sergio Durigan Junior <sergiodj@redhat.com>
+
* server.c: Include <vector>.
<program_argv, wrapper_argv>: Convert to std::vector.
(start_inferior): Rewrite function to use C++.
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 37a6402..25b7e41 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "terminal.h"
+#include "gdb_termios.h"
#include "target.h"
#include "gdbthread.h"
#include "tdesc.h"
diff --git a/gdb/gdbserver/terminal.h b/gdb/gdbserver/terminal.h
deleted file mode 100644
index 3bdd5f5..0000000
--- a/gdb/gdbserver/terminal.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Terminal interface definitions for the GDB remote server.
- Copyright (C) 2002-2017 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#if !defined (TERMINAL_H)
-#define TERMINAL_H 1
-
-/* Autoconf will have defined HAVE_TERMIOS_H, HAVE_TERMIO_H,
- and HAVE_SGTTY_H for us as appropriate. */
-
-#if defined(HAVE_TERMIOS_H)
-#define HAVE_TERMIOS
-#include <termios.h>
-#else /* ! HAVE_TERMIOS_H */
-#if defined(HAVE_TERMIO_H)
-#define HAVE_TERMIO
-#include <termio.h>
-
-#undef TIOCGETP
-#define TIOCGETP TCGETA
-#undef TIOCSETN
-#define TIOCSETN TCSETA
-#undef TIOCSETP
-#define TIOCSETP TCSETAF
-#define TERMINAL struct termio
-#else /* ! HAVE_TERMIO_H */
-#ifdef HAVE_SGTTY_H
-#define HAVE_SGTTY
-#include <fcntl.h>
-#include <sgtty.h>
-#include <sys/ioctl.h>
-#define TERMINAL struct sgttyb
-#endif
-#endif
-#endif
-
-#endif /* !defined (TERMINAL_H) */