aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-06-28 16:32:00 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-07-23 15:38:54 -0400
commit4e93ea6e67fd7260ef842b9eeb20f071648c056e (patch)
treec7644fe22a2d10f95ee5abb9d461be96d34cc23a /gdb/mi
parent11bd012ed256688f43d71dcc531c2f105a9c55dd (diff)
downloadgdb-4e93ea6e67fd7260ef842b9eeb20f071648c056e.zip
gdb-4e93ea6e67fd7260ef842b9eeb20f071648c056e.tar.gz
gdb-4e93ea6e67fd7260ef842b9eeb20f071648c056e.tar.bz2
gdb: make inferior::m_terminal an std::string
Same idea as the previous patch, but for m_terminal. Change-Id: If9367d5db8c976a4336680adca4ea5bc31ab64d2
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/mi-cmd-env.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c
index f7ee1e1..703c632 100644
--- a/gdb/mi/mi-cmd-env.c
+++ b/gdb/mi/mi-cmd-env.c
@@ -244,7 +244,10 @@ mi_cmd_env_dir (const char *command, char **argv, int argc)
void
mi_cmd_inferior_tty_set (const char *command, char **argv, int argc)
{
- current_inferior ()->set_tty (argv[0]);
+ if (argc > 0)
+ current_inferior ()->set_tty (argv[0]);
+ else
+ current_inferior ()->set_tty ("");
}
/* Print the inferior terminal device name. */
@@ -255,8 +258,8 @@ mi_cmd_inferior_tty_show (const char *command, char **argv, int argc)
if ( !mi_valid_noargs ("-inferior-tty-show", argc, argv))
error (_("-inferior-tty-show: Usage: No args"));
- const char *inferior_tty = current_inferior ()->tty ();
- if (inferior_tty != NULL)
+ const std::string &inferior_tty = current_inferior ()->tty ();
+ if (!inferior_tty.empty ())
current_uiout->field_string ("inferior_tty_terminal", inferior_tty);
}