aboutsummaryrefslogtreecommitdiff
path: root/gdb/inferior.c
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/inferior.c
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/inferior.c')
-rw-r--r--gdb/inferior.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/gdb/inferior.c b/gdb/inferior.c
index 74b1c65..40ab3e7 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -111,18 +111,15 @@ inferior::unpush_target (struct target_ops *t)
}
void
-inferior::set_tty (const char *terminal_name)
+inferior::set_tty (std::string terminal_name)
{
- if (terminal_name != nullptr && *terminal_name != '\0')
- m_terminal = make_unique_xstrdup (terminal_name);
- else
- m_terminal = NULL;
+ m_terminal = std::move (terminal_name);
}
-const char *
+const std::string &
inferior::tty ()
{
- return m_terminal.get ();
+ return m_terminal;
}
void