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/locks.cc b/src/locks.cc
index 312b021..0422aff 100644
--- a/src/locks.cc
+++ b/src/locks.cc
@@ -21,6 +21,7 @@
namespace art {
Mutex* Locks::abort_lock_ = NULL;
+Mutex* Locks::breakpoint_lock_ = NULL;
Mutex* Locks::classlinker_classes_lock_ = NULL;
ReaderWriterMutex* Locks::heap_bitmap_lock_ = NULL;
Mutex* Locks::logging_lock_ = NULL;
@@ -34,6 +35,7 @@
if (logging_lock_ != NULL) {
// Already initialized.
DCHECK(abort_lock_ != NULL);
+ DCHECK(breakpoint_lock_ != NULL);
DCHECK(classlinker_classes_lock_ != NULL);
DCHECK(heap_bitmap_lock_ != NULL);
DCHECK(logging_lock_ != NULL);
@@ -45,6 +47,8 @@
logging_lock_ = new Mutex("logging lock", kLoggingLock, true);
abort_lock_ = new Mutex("abort lock", kAbortLock, true);
+ DCHECK(breakpoint_lock_ == NULL);
+ breakpoint_lock_ = new Mutex("breakpoint lock", kBreakpointLock);
DCHECK(classlinker_classes_lock_ == NULL);
classlinker_classes_lock_ = new Mutex("ClassLinker classes lock", kClassLinkerClassesLock);
DCHECK(heap_bitmap_lock_ == NULL);