From 46f9340f2a055a8fdfebbfbb739c697c20d83e7c Mon Sep 17 00:00:00 2001 From: Alex Light Date: Thu, 29 Jun 2017 11:59:50 -0700 Subject: Add SuspendReason enum and change Suspension functions. More self-documenting and more type safe. Bug: 62821960 Test: ./test.py Change-Id: Ic7a1ae6a25e687d65f5aa10c1aad54a7b80dd086 --- runtime/debugger.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'runtime/debugger.cc') diff --git a/runtime/debugger.cc b/runtime/debugger.cc index cc12439074..c94a8e0f3e 100644 --- a/runtime/debugger.cc +++ b/runtime/debugger.cc @@ -2446,7 +2446,7 @@ JDWP::JdwpError Dbg::SuspendThread(JDWP::ObjectId thread_id, bool request_suspen ThreadList* thread_list = Runtime::Current()->GetThreadList(); Thread* thread = thread_list->SuspendThreadByPeer(peer.get(), request_suspension, - /* debug_suspension */ true, + SuspendReason::kForDebugger, &timed_out); if (thread != nullptr) { return JDWP::ERR_NONE; @@ -2477,7 +2477,7 @@ void Dbg::ResumeThread(JDWP::ObjectId thread_id) { needs_resume = thread->GetDebugSuspendCount() > 0; } if (needs_resume) { - Runtime::Current()->GetThreadList()->Resume(thread, true); + Runtime::Current()->GetThreadList()->Resume(thread, SuspendReason::kForDebugger); } } @@ -3694,7 +3694,7 @@ class ScopedDebuggerThreadSuspension { ThreadList* const thread_list = Runtime::Current()->GetThreadList(); suspended_thread = thread_list->SuspendThreadByPeer(thread_peer, /* request_suspension */ true, - /* debug_suspension */ true, + SuspendReason::kForDebugger, &timed_out); } if (suspended_thread == nullptr) { @@ -3718,7 +3718,7 @@ class ScopedDebuggerThreadSuspension { ~ScopedDebuggerThreadSuspension() { if (other_suspend_) { - Runtime::Current()->GetThreadList()->Resume(thread_, true); + Runtime::Current()->GetThreadList()->Resume(thread_, SuspendReason::kForDebugger); } } @@ -4040,7 +4040,7 @@ JDWP::JdwpError Dbg::PrepareInvokeMethod(uint32_t request_id, JDWP::ObjectId thr thread_list->UndoDebuggerSuspensions(); } else { VLOG(jdwp) << " Resuming event thread only"; - thread_list->Resume(targetThread, true); + thread_list->Resume(targetThread, SuspendReason::kForDebugger); } return JDWP::ERR_NONE; -- cgit v1.2.3-59-g8ed1b