aboutsummaryrefslogtreecommitdiff
path: root/gdb/regcache.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2008-10-30 20:35:31 +0000
committerTom Tromey <tromey@redhat.com>2008-10-30 20:35:31 +0000
commit724b958c4168d40f59a35112c36ebf9e02c43d56 (patch)
treef2cd63b030da519b513a58be98a7c010e9464dcb /gdb/regcache.c
parenta05016c09e47a026bdbf05d02101c4eb40ac52f5 (diff)
downloadfsf-binutils-gdb-724b958c4168d40f59a35112c36ebf9e02c43d56.zip
fsf-binutils-gdb-724b958c4168d40f59a35112c36ebf9e02c43d56.tar.gz
fsf-binutils-gdb-724b958c4168d40f59a35112c36ebf9e02c43d56.tar.bz2
* cli/cli-logging.c (handle_redirections): Make a cleanup.
* reggroups.c (maintenance_print_reggroups): Make a cleanup. * regcache.c (regcache_print): Make a cleanup. * maint.c (maintenance_print_architecture): Make a cleanup. * dummy-frame.c (maintenance_print_dummy_frames): Make a cleanup.
Diffstat (limited to 'gdb/regcache.c')
-rw-r--r--gdb/regcache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 616a6f7..74ca6f0 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -1104,11 +1104,13 @@ regcache_print (char *args, enum regcache_dump_what what_to_dump)
regcache_dump (get_current_regcache (), gdb_stdout, what_to_dump);
else
{
+ struct cleanup *cleanups;
struct ui_file *file = gdb_fopen (args, "w");
if (file == NULL)
perror_with_name (_("maintenance print architecture"));
+ cleanups = make_cleanup_ui_file_delete (file);
regcache_dump (get_current_regcache (), file, what_to_dump);
- ui_file_delete (file);
+ do_cleanups (cleanups);
}
}