Implement enough JDWP functionality that we can attach jdb.

You can also try "classes" and "classpath", though anything else
deadlocks because we're suspended but jdb thinks we aren't. I don't
think that's a new bug with this patch, though, so I'll look at that
next.

Change-Id: I54456b6a7fe72642be696c66aa485dc0c8a7f913
diff --git a/src/class_linker.cc b/src/class_linker.cc
index 505f86f..3e547e4 100644
--- a/src/class_linker.cc
+++ b/src/class_linker.cc
@@ -818,6 +818,21 @@
   visitor(array_iftable_, arg);
 }
 
+void ClassLinker::VisitClasses(ClassVisitor* visitor, void* arg) const {
+  MutexLock mu(classes_lock_);
+  typedef Table::const_iterator It;  // TODO: C++0x auto
+  for (It it = classes_.begin(), end = classes_.end(); it != end; ++it) {
+    if (!visitor(it->second, arg)) {
+      return;
+    }
+  }
+  for (It it = image_classes_.begin(), end = image_classes_.end(); it != end; ++it) {
+    if (!visitor(it->second, arg)) {
+      return;
+    }
+  }
+}
+
 ClassLinker::~ClassLinker() {
   String::ResetClass();
   Field::ResetClass();