From 4eec026ec4d86869baa27ad0afd9564cca8856c9 Mon Sep 17 00:00:00 2001 From: Sebastien Hertz Date: Tue, 14 Oct 2014 17:27:15 +0200 Subject: Fix JDWP Virtualmachine.Resume command We used to call ThreadList::UndoDebuggerSuspensions but this is not correct. Indeed Virtualmachine.Resume command should be performed as many times as all threads have been suspended (either by the Virtualmachine.Suspend command or the application of suspend policy ALL for event). This CL fixes this issue by adding ThreadList::ResumeAllForDebugger. It decrements suspend count and debug suspend count by 1 (globally and for each thread). It also handles the case where Virtualmachine.Resume is called while threads have not been suspended (global debug suspend count is 0). In this case we just print a warning and do nothing. Bug: 17974047 (cherry picked from commit 253fa555d9424a56c52879449eabe73d5c96cf61) Change-Id: I38b38240f84f141670506e88fa5c2480f856fdd6 --- runtime/debugger.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/debugger.cc') diff --git a/runtime/debugger.cc b/runtime/debugger.cc index dc845c7171..1f52c467f8 100644 --- a/runtime/debugger.cc +++ b/runtime/debugger.cc @@ -2364,7 +2364,7 @@ void Dbg::SuspendVM() { } void Dbg::ResumeVM() { - Runtime::Current()->GetThreadList()->UndoDebuggerSuspensions(); + Runtime::Current()->GetThreadList()->ResumeAllForDebugger(); } JDWP::JdwpError Dbg::SuspendThread(JDWP::ObjectId thread_id, bool request_suspension) { -- cgit v1.2.3-59-g8ed1b