summaryrefslogtreecommitdiff
path: root/runtime/debugger.cc
diff options
context:
space:
mode:
authorAlex Light <allight@google.com>2017-06-29 11:59:50 -0700
committerAlex Light <allight@google.com>2017-06-30 14:24:56 +0000
commit46f9340f2a055a8fdfebbfbb739c697c20d83e7c (patch)
treeacb172f74723e4ea9ac7ded73b94c661217ec90d /runtime/debugger.cc
parentfe9a4f061841a3c597aac6817a47c799c54fcad7 (diff)
Add SuspendReason enum and change Suspension functions.
More self-documenting and more type safe. Bug: 62821960 Test: ./test.py Change-Id: Ic7a1ae6a25e687d65f5aa10c1aad54a7b80dd086
Diffstat (limited to 'runtime/debugger.cc')
-rw-r--r--runtime/debugger.cc10
1 files changed, 5 insertions, 5 deletions
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;