diff options
author | Tom Tromey <tom@tromey.com> | 2017-09-29 21:49:04 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2017-10-03 05:33:44 -0600 |
commit | 070365117b5727394e271399c5738a27bf9716d5 (patch) | |
tree | af3df612d0b512560ff052a22a64f59939936315 /gdb/infrun.c | |
parent | 9194f82dc372d5045ae06c617a49a5a9b17c1d24 (diff) | |
download | gdb-070365117b5727394e271399c5738a27bf9716d5.zip gdb-070365117b5727394e271399c5738a27bf9716d5.tar.gz gdb-070365117b5727394e271399c5738a27bf9716d5.tar.bz2 |
Change record_full_gdb_operation_disable_set not to return a cleanup
This changes record_full_gdb_operation_disable_set to return a
scoped_restore rather than a cleanup, and fixes all the users.
ChangeLog
2017-10-03 Tom Tromey <tom@tromey.com>
* record-full.h (record_full_gdb_operation_disable_set): Return
scoped_restore_tmpl<int>.
* infrun.c (adjust_pc_after_break): Update.
(handle_signal_stop): Update.
* record-full.c (record_full_gdb_operation_disable_set): Return
scoped_restore_tmpl<int>.
(record_full_wait_1, record_full_insert_breakpoint)
(record_full_remove_breakpoint, record_full_save)
(record_full_goto_insn): Update.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r-- | gdb/infrun.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c index fba0079..e82f61f 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -4178,10 +4178,11 @@ adjust_pc_after_break (struct thread_info *thread, || (target_is_non_stop_p () && moribund_breakpoint_here_p (aspace, breakpoint_pc))) { - struct cleanup *old_cleanups = make_cleanup (null_cleanup, NULL); + gdb::optional<scoped_restore_tmpl<int>> restore_operation_disable; if (record_full_is_used ()) - record_full_gdb_operation_disable_set (); + restore_operation_disable.emplace + (record_full_gdb_operation_disable_set ()); /* When using hardware single-step, a SIGTRAP is reported for both a completed single-step and a software breakpoint. Need to @@ -4205,8 +4206,6 @@ adjust_pc_after_break (struct thread_info *thread, || (thread->stepped_breakpoint && thread->prev_pc == breakpoint_pc)) regcache_write_pc (regcache, breakpoint_pc); - - do_cleanups (old_cleanups); } } @@ -6008,14 +6007,14 @@ handle_signal_stop (struct execution_control_state *ecs) decr_pc = gdbarch_decr_pc_after_break (gdbarch); if (decr_pc != 0) { - struct cleanup *old_cleanups = make_cleanup (null_cleanup, NULL); + gdb::optional<scoped_restore_tmpl<int>> + restore_operation_disable; if (record_full_is_used ()) - record_full_gdb_operation_disable_set (); + restore_operation_disable.emplace + (record_full_gdb_operation_disable_set ()); regcache_write_pc (regcache, stop_pc + decr_pc); - - do_cleanups (old_cleanups); } } else |