Implement a bit more debugger functionality.

This fixes the deadlock by making SuspendSelfForDebugger not take the thread
list lock, making it more like the equivalent code in dalvikvm.

There's also some code cleanup, and a few more of the JDWP calls jdb makes
on startup. By fixing the deadlock, attaching jdb now causes us to hit
unimplemented code relating to thread stacks. That's tomorrow's job...

Change-Id: I7eac1b95946228fa60666587ff8766bcabb28bb1
diff --git a/src/thread.h b/src/thread.h
index a4fd3bc..dca983f 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -178,6 +178,7 @@
     return reinterpret_cast<Thread*>(thread);
   }
 
+  static Thread* FromManagedThread(Object* thread_peer);
   static Thread* FromManagedThread(JNIEnv* env, jobject thread);
   static uint32_t LockOwnerFromThreadLock(Object* thread_lock);
 
@@ -190,6 +191,7 @@
   State SetState(State new_state);
 
   bool IsDaemon();
+  bool IsSuspended();
 
   void WaitUntilSuspended();