summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2018-04-24 12:35:32 +0100
committer Vladimir Marko <vmarko@google.com> 2018-04-24 15:45:07 +0100
commit31d7a57b70c2b68aa19a58d4177dcbde06914441 (patch)
treec18d8d59d285ccabc3843e17929fa3c54f112559
parent3896e437d1964fda0120aa249de264de6ef91143 (diff)
Improve debug logging of classes for 77342775.
Log the reference, space and defining dex file of the source and target class. Log the start of image space and replace image space file name with '+' if it's the same as the image name. Test: Manual; change 108-check-cast to multi-dex and disable the Lorg/apache/http/ filtering, check error message. Repeat with a profile to put LB; and LD; into app image. Bug: 77342775 (cherry picked from commit cbb7bd2795b9afe242efe658b4e5736cbe378921) Change-Id: Iee935c463816fff50510371c4d8acb1807980039
-rw-r--r--runtime/debug_print.cc24
1 files changed, 19 insertions, 5 deletions
diff --git a/runtime/debug_print.cc b/runtime/debug_print.cc
index 7e075ce352..c5bb4d57e6 100644
--- a/runtime/debug_print.cc
+++ b/runtime/debug_print.cc
@@ -40,7 +40,11 @@ std::string DescribeSpace(ObjPtr<mirror::Class> klass) {
heap->FindContinuousSpaceFromObject(klass.Ptr(), /* fail_ok */ true);
if (cs != nullptr) {
if (cs->IsImageSpace()) {
- oss << "image;" << cs->GetName() << ";" << cs->AsImageSpace()->GetImageFilename();
+ gc::space::ImageSpace* ispace = cs->AsImageSpace();
+ oss << "image;" << ispace->GetName() << ";"
+ // If the file name is the same as the name, output "+" instead to shorten the output.
+ << (ispace->GetImageFilename() == cs->GetName() ? "+" : ispace->GetImageFilename())
+ << ";" << static_cast<const void*>(ispace->Begin());
} else {
oss << "continuous;" << cs->GetName();
}
@@ -146,13 +150,20 @@ void DumpB77342775DebugData(ObjPtr<mirror::Class> target_class, ObjPtr<mirror::C
const char* source_descriptor = src_class->GetDescriptor(&source_descriptor_storage);
LOG(ERROR) << "Maybe bug 77342775, looking for " << target_descriptor
- << " with loader " << DescribeLoaders(target_class->GetClassLoader(), target_descriptor);
+ << " " << target_class.Ptr() << "[" << DescribeSpace(target_class) << "]"
+ << " defined in " << target_class->GetDexFile().GetLocation()
+ << "/" << static_cast<const void*>(&target_class->GetDexFile())
+ << "\n with loader: " << DescribeLoaders(target_class->GetClassLoader(), target_descriptor);
if (target_class->IsInterface()) {
ObjPtr<mirror::IfTable> iftable = src_class->GetIfTable();
CHECK(iftable != nullptr);
size_t ifcount = iftable->Count();
- LOG(ERROR) << " in interface table for " << source_descriptor << " ifcount=" << ifcount
- << " with loader " << DescribeLoaders(src_class->GetClassLoader(), source_descriptor);
+ LOG(ERROR) << " in interface table for " << source_descriptor
+ << " " << src_class.Ptr() << "[" << DescribeSpace(src_class) << "]"
+ << " defined in " << src_class->GetDexFile().GetLocation()
+ << "/" << static_cast<const void*>(&src_class->GetDexFile())
+ << " ifcount=" << ifcount
+ << "\n with loader " << DescribeLoaders(src_class->GetClassLoader(), source_descriptor);
for (size_t i = 0; i != ifcount; ++i) {
ObjPtr<mirror::Class> iface = iftable->GetInterface(i);
CHECK(iface != nullptr);
@@ -161,7 +172,10 @@ void DumpB77342775DebugData(ObjPtr<mirror::Class> target_class, ObjPtr<mirror::C
}
} else {
LOG(ERROR) << " in superclass chain for " << source_descriptor
- << " with loader " << DescribeLoaders(src_class->GetClassLoader(), source_descriptor);
+ << " " << src_class.Ptr() << "[" << DescribeSpace(src_class) << "]"
+ << " defined in " << src_class->GetDexFile().GetLocation()
+ << "/" << static_cast<const void*>(&src_class->GetDexFile())
+ << "\n with loader " << DescribeLoaders(src_class->GetClassLoader(), source_descriptor);
for (ObjPtr<mirror::Class> klass = src_class;
klass != nullptr;
klass = klass->GetSuperClass()) {