Remove 'saved_output' global

CLI redirect uses a global variable, 'saved_output'.  However, globals
are generally bad, and there is no need for this one -- it can be a
member of cli_interp_base.  This patch makes this change.
This commit is contained in:
Tom Tromey
2022-11-17 08:16:44 -07:00
parent e1df90510a
commit 19622df10d
2 changed files with 33 additions and 30 deletions

View File

@ -32,6 +32,22 @@ public:
bool debug_redirect) override;
void pre_command_loop () override;
bool supports_command_editing () override;
private:
struct saved_output_files
{
ui_file *out;
ui_file *err;
ui_file *log;
ui_file *targ;
ui_file *targerr;
ui_file_up file_to_delete;
ui_file_up log_to_delete;
};
/* These hold the pushed copies of the gdb output files. If NULL
then nothing has yet been pushed. */
std::unique_ptr<saved_output_files> m_saved_output;
};
/* Returns true if the current stop should be printed to