aboutsummaryrefslogtreecommitdiff
path: root/gdb/nto-procfs.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2020-06-27 14:56:05 +0100
committerPedro Alves <palves@redhat.com>2020-06-27 14:56:05 +0100
commit05779d57f9f4e7cbb6d4c79d8851d35a422bdd0d (patch)
tree08fc108bb88e458292ed728fd5ea5cb3e97dcf84 /gdb/nto-procfs.c
parentcfc16775b7678e1ad8f9fce048652defd78e3787 (diff)
downloadgdb-05779d57f9f4e7cbb6d4c79d8851d35a422bdd0d.zip
gdb-05779d57f9f4e7cbb6d4c79d8851d35a422bdd0d.tar.gz
gdb-05779d57f9f4e7cbb6d4c79d8851d35a422bdd0d.tar.bz2
Make {get,set}_inferior_io_terminal inferior methods
This converts the get_inferior_io_terminal and set_inferior_io_terminal free functions to inferior methods. Since the related commands are called "tty", "{set,show} inferior-tty", and MI's "-inferior-tty-{set,show}", to make the connection between the commands and the code more obvious, the methods are named set_tty/tty instead of set_io_terminal/io_terminal. gdb/ChangeLog: * fork-child.c (prefork_hook): Adjust. * infcmd.c (set_inferior_io_terminal, get_inferior_io_terminal): Delete. (set_inferior_tty_command, show_inferior_tty_command): Adjust. * inferior.c (inferior::set_tty, inferior::tty): New methods. * inferior.h (set_inferior_io_terminal, get_inferior_io_terminal): Remove declarations. (struct inferior) <set_tty, tty>: New methods. (struct inferior) <terminal>: Rename to ... (struct inferior) <m_terminal>: ... this and make private. * main.c (captured_main_1): Adjust. * mi/mi-cmd-env.c (mi_cmd_inferior_tty_set): Adjust. (mi_cmd_inferior_tty_show): Adjust. * nto-procfs.c (nto_procfs_target::create_inferior): Adjust. * windows-nat.c (windows_nat_target::create_inferior): Adjust.
Diffstat (limited to 'gdb/nto-procfs.c')
-rw-r--r--gdb/nto-procfs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c
index f649b6c..91d2cc5 100644
--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -1208,7 +1208,6 @@ nto_procfs_target::create_inferior (const char *exec_file,
const char *in = "", *out = "", *err = "";
int fd, fds[3];
sigset_t set;
- const char *inferior_io_terminal = get_inferior_io_terminal ();
struct inferior *inf;
argv = xmalloc ((allargs.size () / (unsigned) 2 + 2) *
@@ -1233,14 +1232,15 @@ nto_procfs_target::create_inferior (const char *exec_file,
/* If the user specified I/O via gdb's --tty= arg, use it, but only
if the i/o is not also being specified via redirection. */
- if (inferior_io_terminal)
+ const char *inferior_tty = current_inferior ()->tty ();
+ if (inferior_tty != nullptr)
{
if (!in[0])
- in = inferior_io_terminal;
+ in = inferior_tty;
if (!out[0])
- out = inferior_io_terminal;
+ out = inferior_tty;
if (!err[0])
- err = inferior_io_terminal;
+ err = inferior_tty;
}
if (in[0])