Some fixes for JDWP with the interpreter.
- GetStackDepth checks if the thread is suspended, unless the thread is
itself.
- Scoped the breakpoints lock during UpdateDebugger to prevent it being
held during PostLocationEvent.
- Removed locking of breakpoints lock in DebugCallbackContext since it's
already holding it.
- Added level for breakpoints lock to prevent lock level violations.
Change-Id: I3588c9696bb57ada3c8c64dc1d95ae23cdf2b107
diff --git a/src/debugger.h b/src/debugger.h
index f9d00d1..d7d2800 100644
--- a/src/debugger.h
+++ b/src/debugger.h
@@ -94,7 +94,7 @@
* when the debugger attaches.
*/
static void Connected();
- static void GoActive();
+ static void GoActive() LOCKS_EXCLUDED(Locks::breakpoint_lock_);
static void Disconnected();
static void Disposed();
@@ -295,17 +295,20 @@
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
static void UpdateDebugger(int32_t dex_pc, Thread* self)
+ LOCKS_EXCLUDED(Locks::breakpoint_lock_)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
static void WatchLocation(const JDWP::JdwpLocation* pLoc)
+ LOCKS_EXCLUDED(Locks::breakpoint_lock_)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
static void UnwatchLocation(const JDWP::JdwpLocation* pLoc)
+ LOCKS_EXCLUDED(Locks::breakpoint_lock_)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
static JDWP::JdwpError ConfigureStep(JDWP::ObjectId threadId, JDWP::JdwpStepSize size,
JDWP::JdwpStepDepth depth)
- LOCKS_EXCLUDED(gBreakpointsLock)
+ LOCKS_EXCLUDED(Locks::breakpoint_lock_)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- static void UnconfigureStep(JDWP::ObjectId threadId);
+ static void UnconfigureStep(JDWP::ObjectId threadId) LOCKS_EXCLUDED(Locks::breakpoint_lock_);
static JDWP::JdwpError InvokeMethod(JDWP::ObjectId threadId, JDWP::ObjectId objectId,
JDWP::RefTypeId classId, JDWP::MethodId methodId,