Fix JDWP ObjectRegistry lock ordering.
Also make debugging lock ordering violations nicer by using our
LockLevel operator<<.
Change-Id: Ic15ebe70363a90a09f6491bd5c336a604e9d6c48
diff --git a/src/jdwp/jdwp_main.cc b/src/jdwp/jdwp_main.cc
index 4a18d48..4e738ff 100644
--- a/src/jdwp/jdwp_main.cc
+++ b/src/jdwp/jdwp_main.cc
@@ -416,13 +416,15 @@
thread_->TransitionFromRunnableToSuspended(kWaitingInMainDebuggerLoop);
}
- /* release session state, e.g. remove breakpoint instructions */
{
ScopedObjectAccess soa(thread_);
+
+ // Release session state, e.g. remove breakpoint instructions.
ResetState();
+
+ // Tell the rest of the runtime that the debugger is no longer around.
+ Dbg::Disconnected();
}
- /* tell the interpreter that the debugger is no longer around */
- Dbg::Disconnected();
/* if we had threads suspended, resume them now */
Dbg::UndoDebuggerSuspensions();