diff options
Diffstat (limited to 'gdb/target.c')
-rw-r--r-- | gdb/target.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/gdb/target.c b/gdb/target.c index 51832c5..0da035e 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -2597,6 +2597,9 @@ target_wait (ptid_t ptid, struct target_waitstatus *status, target_wait_flags options) { target_ops *target = current_inferior ()->top_target (); + process_stratum_target *proc_target = current_inferior ()->process_target (); + + gdb_assert (!proc_target->commit_resumed_state); if (!target->can_async_p ()) gdb_assert ((options & TARGET_WNOHANG) == 0); @@ -2653,6 +2656,7 @@ void target_resume (ptid_t ptid, int step, enum gdb_signal signal) { process_stratum_target *curr_target = current_inferior ()->process_target (); + gdb_assert (!curr_target->commit_resumed_state); target_dcache_invalidate (); @@ -2666,26 +2670,13 @@ target_resume (ptid_t ptid, int step, enum gdb_signal signal) clear_inline_frame_state (curr_target, ptid); } -/* If true, target_commit_resume is a nop. */ -static int defer_target_commit_resume; - /* See target.h. */ void -target_commit_resume (void) -{ - if (defer_target_commit_resume) - return; - - current_inferior ()->top_target ()->commit_resume (); -} - -/* See target.h. */ - -scoped_restore_tmpl<int> -make_scoped_defer_target_commit_resume () +target_commit_resumed () { - return make_scoped_restore (&defer_target_commit_resume, 1); + gdb_assert (current_inferior ()->process_target ()->commit_resumed_state); + current_inferior ()->top_target ()->commit_resumed (); } void @@ -3761,6 +3752,10 @@ target_update_thread_list (void) void target_stop (ptid_t ptid) { + process_stratum_target *proc_target = current_inferior ()->process_target (); + + gdb_assert (!proc_target->commit_resumed_state); + if (!may_stop) { warning (_("May not interrupt or stop the target, ignoring attempt")); |