Use ui_out_redirect_pop in more places

This changes ui_out_redirect_pop to also perform the redirection, and
then updates several sites to use this, rather than explicit
redirects.
This commit is contained in:
Tom Tromey 2022-08-11 10:07:18 -06:00
parent 55a6603404
commit 992aeed80b
7 changed files with 18 additions and 43 deletions

View file

@ -548,19 +548,17 @@ bppy_get_commands (PyObject *self, void *closure)
string_file stb;
current_uiout->redirect (&stb);
try
{
ui_out_redirect_pop redir (current_uiout, &stb);
print_command_lines (current_uiout, breakpoint_commands (bp), 0);
}
catch (const gdb_exception &except)
{
current_uiout->redirect (NULL);
gdbpy_convert_exception (except);
return NULL;
}
current_uiout->redirect (NULL);
return host_string_to_python_string (stb.c_str ()).release ();
}