aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-08-11 10:07:18 -0600
committerTom Tromey <tromey@adacore.com>2022-08-31 11:03:39 -0600
commit992aeed80b0a6ef1d60ce01df52f3397c3274f35 (patch)
tree1a7af982504b79000f29ccf44ef52e739b7e1a97 /gdb/python
parent55a6603404099c0b61a5e4613712d3935c2e2bb6 (diff)
downloadbinutils-992aeed80b0a6ef1d60ce01df52f3397c3274f35.zip
binutils-992aeed80b0a6ef1d60ce01df52f3397c3274f35.tar.gz
binutils-992aeed80b0a6ef1d60ce01df52f3397c3274f35.tar.bz2
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.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-breakpoint.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index 48ec86c..dd4519a 100644
--- a/gdb/python/py-breakpoint.c
+++ b/gdb/python/py-breakpoint.c
@@ -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 ();
}