aboutsummaryrefslogtreecommitdiff
path: root/gdb/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/exec.c')
-rw-r--r--gdb/exec.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/gdb/exec.c b/gdb/exec.c
index 2c9a74b..05ecb1b 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -113,17 +113,14 @@ static void
exec_close_1 (struct target_ops *self)
{
struct program_space *ss;
- struct cleanup *old_chain;
+ scoped_restore_current_program_space restore_pspace;
- old_chain = save_current_program_space ();
ALL_PSPACES (ss)
- {
- set_current_program_space (ss);
- clear_section_table (current_target_sections);
- exec_close ();
- }
-
- do_cleanups (old_chain);
+ {
+ set_current_program_space (ss);
+ clear_section_table (current_target_sections);
+ exec_close ();
+ }
}
void