Avoid resolution for field types in image dumping.
Bug seen when dumping EMPTY_TABLE of java.util.HashMap as EMPTY_TABLE has type
java.util.Map$Entry[] which isn't in the boot image, but the value has type
java.util.HashMap$HashMapEntry[] which is.
Change-Id: Ia0bd445c6f5bb5837a92e6c2b2f4207e89b872f4
diff --git a/src/oatdump.cc b/src/oatdump.cc
index 538e1bb..a8a0e86 100644
--- a/src/oatdump.cc
+++ b/src/oatdump.cc
@@ -853,7 +853,13 @@
if (value == NULL) {
os << StringPrintf("null %s\n", PrettyDescriptor(descriptor).c_str());
} else {
- PrettyObjectValue(os, fh.GetType(), value);
+ // Grab the field type without causing resolution.
+ mirror::Class* field_type = fh.GetType(false);
+ if (field_type != NULL) {
+ PrettyObjectValue(os, field_type, value);
+ } else {
+ os << StringPrintf("%p %s\n", value, PrettyDescriptor(descriptor).c_str());
+ }
}
}
}