Fix JDWP class-only modifier.

Fix Dbg::MatchType which is used for class-only and exception-only modifiers.

Also fix crash happening when notifying an exception. A debugger may walk the
stack of the current thread so we need to keep the instrumentation stack frame
synced with the native stack.

Bug: 11856587
Change-Id: Ibf95f8a83ce9ee640abf945e498b42cc88ea92a0
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index 52a2141..e4b8a8a 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -452,6 +452,7 @@
 
 void Dbg::StopJdwp() {
   delete gJdwpState;
+  gJdwpState = NULL;
   delete gRegistry;
   gRegistry = NULL;
 }
@@ -1113,7 +1114,7 @@
   CHECK(c1 != NULL);
   mirror::Class* c2 = DecodeClass(class_id, status);
   CHECK(c2 != NULL);
-  return c1->IsAssignableFrom(c2);
+  return c2->IsAssignableFrom(c1);
 }
 
 static JDWP::FieldId ToFieldId(const mirror::ArtField* f)