Fix a bug in Dbg::GetClassDescriptor.
The callers were incorrectly assuming we always returned a descriptor, which
isn't true when handed bad input.
Change-Id: I5509d18d8c234d97fa5ec2e0a01d4cdb44acfc55
diff --git a/src/debugger.cc b/src/debugger.cc
index cd1081d..662757d 100644
--- a/src/debugger.cc
+++ b/src/debugger.cc
@@ -499,12 +499,12 @@
}
}
-std::string Dbg::GetClassDescriptor(JDWP::RefTypeId classId) {
+std::string Dbg::GetClassName(JDWP::RefTypeId classId) {
Object* o = gRegistry->Get<Object*>(classId);
if (o == NULL || !o->IsClass()) {
return StringPrintf("non-class %p", o); // This is only used for debugging output anyway.
}
- return ClassHelper(o->AsClass()).GetDescriptor();
+ return DescriptorToName(ClassHelper(o->AsClass()).GetDescriptor());
}
bool Dbg::GetClassObject(JDWP::RefTypeId id, JDWP::ObjectId& classObjectId) {