summaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 2f7f317f40f..3e2b4d08fc2 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1302,20 +1302,10 @@ memory_xfer_partial (struct target_ops *ops, enum target_object object,
return res;
}
-static void
-restore_show_memory_breakpoints (void *arg)
-{
- show_memory_breakpoints = (uintptr_t) arg;
-}
-
-struct cleanup *
-make_show_memory_breakpoints_cleanup (int show)
+scoped_restore_tmpl<int>
+make_scoped_restore_show_memory_breakpoints (int show)
{
- int current = show_memory_breakpoints;
-
- show_memory_breakpoints = show;
- return make_cleanup (restore_show_memory_breakpoints,
- (void *) (uintptr_t) current);
+ return make_scoped_restore (&show_memory_breakpoints, show);
}
/* For docs see target.h, to_xfer_partial. */