gdb: make inferior::m_terminal an std::string

Same idea as the previous patch, but for m_terminal.

Change-Id: If9367d5db8c976a4336680adca4ea5bc31ab64d2
This commit is contained in:
Simon Marchi
2021-06-28 16:32:00 -04:00
parent 11bd012ed2
commit 4e93ea6e67
6 changed files with 41 additions and 51 deletions

View File

@ -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