ART: Fix JDWP GetClassLoader command
The command is spec-ed to take a type, and return the type's
classloader. The input is thus already a Class, not a generic Object.
Fix the implementation to not always return null.
Bug: 26349019
Change-Id: I4aa075902f4a112624edc644d3540a59eea057c8
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index e0211f5..f009fe6 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -730,7 +730,8 @@
if (o == nullptr) {
return JDWP::ERR_INVALID_OBJECT;
}
- expandBufAddObjectId(pReply, gRegistry->Add(o->GetClass()->GetClassLoader()));
+ DCHECK(o->IsClass());
+ expandBufAddObjectId(pReply, gRegistry->Add(o->AsClass()->GetClassLoader()));
return JDWP::ERR_NONE;
}