aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/mi-cmd-env.c24
-rw-r--r--gdb/mi/mi-cmds.c2
-rw-r--r--gdb/mi/mi-cmds.h2
3 files changed, 28 insertions, 0 deletions
diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c
index 61fa7f8..b6e7fd7 100644
--- a/gdb/mi/mi-cmd-env.c
+++ b/gdb/mi/mi-cmd-env.c
@@ -244,6 +244,30 @@ mi_cmd_env_dir (char *command, char **argv, int argc)
return MI_CMD_DONE;
}
+/* Set the inferior terminal device name. */
+enum mi_cmd_result
+mi_cmd_inferior_tty_set (char *command, char **argv, int argc)
+{
+ set_inferior_io_terminal (argv[0]);
+
+ return MI_CMD_DONE;
+}
+
+/* Print the inferior terminal device name */
+enum mi_cmd_result
+mi_cmd_inferior_tty_show (char *command, char **argv, int argc)
+{
+ const char *inferior_io_terminal = get_inferior_io_terminal ();
+
+ if ( !mi_valid_noargs ("mi_cmd_inferior_tty_show", argc, argv))
+ error (_("mi_cmd_inferior_tty_show: Usage: No args"));
+
+ if (inferior_io_terminal)
+ ui_out_field_string (uiout, "inferior_tty_terminal", inferior_io_terminal);
+
+ return MI_CMD_DONE;
+}
+
void
_initialize_mi_cmd_env (void)
{
diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c
index 6655d05..c2a3eca 100644
--- a/gdb/mi/mi-cmds.c
+++ b/gdb/mi/mi-cmds.c
@@ -91,6 +91,8 @@ struct mi_cmd mi_cmds[] =
{ "gdb-show", { "show", 1 }, NULL, NULL },
{ "gdb-source", { NULL, 0 }, NULL, NULL },
{ "gdb-version", { "show version", 0 }, 0 },
+ { "inferior-tty-set", { NULL, 0 }, NULL, mi_cmd_inferior_tty_set},
+ { "inferior-tty-show", { NULL, 0 }, NULL, mi_cmd_inferior_tty_show},
{ "interpreter-exec", { NULL, 0 }, 0, mi_cmd_interpreter_exec},
{ "kod-info", { NULL, 0 }, NULL, NULL },
{ "kod-list", { NULL, 0 }, NULL, NULL },
diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h
index 560963c..0712608 100644
--- a/gdb/mi/mi-cmds.h
+++ b/gdb/mi/mi-cmds.h
@@ -85,6 +85,8 @@ extern mi_cmd_args_ftype mi_cmd_exec_interrupt;
extern mi_cmd_argv_ftype mi_cmd_file_list_exec_source_file;
extern mi_cmd_argv_ftype mi_cmd_file_list_exec_source_files;
extern mi_cmd_argv_ftype mi_cmd_gdb_exit;
+extern mi_cmd_argv_ftype mi_cmd_inferior_tty_set;
+extern mi_cmd_argv_ftype mi_cmd_inferior_tty_show;
extern mi_cmd_argv_ftype mi_cmd_interpreter_exec;
extern mi_cmd_argv_ftype mi_cmd_stack_info_depth;
extern mi_cmd_argv_ftype mi_cmd_stack_info_frame;