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.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'runtime/debugger.h') diff --git a/runtime/debugger.h b/runtime/debugger.h index eaab1f4d4f..131de2c0ac 100644 --- a/runtime/debugger.h +++ b/runtime/debugger.h @@ -246,7 +246,9 @@ class Dbg { */ static int64_t LastDebuggerActivity(); - static void UndoDebuggerSuspensions(); + static void UndoDebuggerSuspensions() + LOCKS_EXCLUDED(Locks::thread_list_lock_, + Locks::thread_suspend_count_lock_); /* * Class, Object, Array @@ -459,7 +461,9 @@ class Dbg { static void SuspendVM() LOCKS_EXCLUDED(Locks::thread_list_lock_, Locks::thread_suspend_count_lock_); - static void ResumeVM(); + static void ResumeVM() + LOCKS_EXCLUDED(Locks::thread_list_lock_, + Locks::thread_suspend_count_lock_); static JDWP::JdwpError SuspendThread(JDWP::ObjectId thread_id, bool request_suspension = true) LOCKS_EXCLUDED(Locks::mutator_lock_, Locks::thread_list_lock_, -- cgit v1.2.3-59-g8ed1b