If we have a Class object in the "monitors held:" output, show which class.
Bug: 2187020
diff --git a/vm/Thread.c b/vm/Thread.c
index 55e27f6..71f6324 100644
--- a/vm/Thread.c
+++ b/vm/Thread.c
@@ -3322,8 +3322,16 @@
else
dvmPrintDebugMessage(target, " | monitors held: <none>\n");
while (lod != NULL) {
- dvmPrintDebugMessage(target, " > %p[%d] (%s)\n",
- lod->obj, lod->recursionCount, lod->obj->clazz->descriptor);
+ Object* obj = lod->obj;
+ if (obj->clazz == gDvm.classJavaLangClass) {
+ ClassObject* clazz = (ClassObject*) obj;
+ dvmPrintDebugMessage(target, " > %p[%d] (%s object for class %s)\n",
+ obj, lod->recursionCount, obj->clazz->descriptor,
+ clazz->descriptor);
+ } else {
+ dvmPrintDebugMessage(target, " > %p[%d] (%s)\n",
+ obj, lod->recursionCount, obj->clazz->descriptor);
+ }
lod = lod->next;
}
}
diff --git a/vm/oo/Object.h b/vm/oo/Object.h
index e467fe9..788ec13 100644
--- a/vm/oo/Object.h
+++ b/vm/oo/Object.h
@@ -288,7 +288,7 @@
*
* We don't currently store the size of each element. Usually it's implied
* by the instruction. If necessary, the width can be derived from
- * the first char of obj->clazz->name.
+ * the first char of obj->clazz->descriptor.
*/
struct ArrayObject {
Object obj; /* MUST be first item */