Fix AttachCurrentThread to use the right thread group.

Change-Id: I9818845c005563d894a571edc4f9be9862312380
diff --git a/src/debugger.cc b/src/debugger.cc
index 1f7b0de..71776ae 100644
--- a/src/debugger.cc
+++ b/src/debugger.cc
@@ -1355,22 +1355,12 @@
   return gRegistry->Add(parent);
 }
 
-static Object* GetStaticThreadGroup(const char* field_name) {
-  Class* c = Runtime::Current()->GetClassLinker()->FindSystemClass("Ljava/lang/ThreadGroup;");
-  CHECK(c != NULL);
-  Field* f = c->FindStaticField(field_name, "Ljava/lang/ThreadGroup;");
-  CHECK(f != NULL);
-  Object* group = f->GetObject(NULL);
-  CHECK(group != NULL);
-  return group;
-}
-
 JDWP::ObjectId Dbg::GetSystemThreadGroupId() {
-  return gRegistry->Add(GetStaticThreadGroup("mSystem"));
+  return gRegistry->Add(Thread::GetSystemThreadGroup());
 }
 
 JDWP::ObjectId Dbg::GetMainThreadGroupId() {
-  return gRegistry->Add(GetStaticThreadGroup("mMain"));
+  return gRegistry->Add(Thread::GetMainThreadGroup());
 }
 
 bool Dbg::GetThreadStatus(JDWP::ObjectId threadId, JDWP::JdwpThreadStatus* pThreadStatus, JDWP::JdwpSuspendStatus* pSuspendStatus) {