diff options
author | 2022-05-27 17:41:40 +0100 | |
---|---|---|
committer | 2022-06-07 13:42:02 +0000 | |
commit | 72d34953e401937306bf9b282f677824949dfa8f (patch) | |
tree | b4328b1e5d0d38fd3fcb1aa8e60b6402b90c83c8 | |
parent | 7a47626d10c4ba236147c402b766d580977bae05 (diff) |
Remove debugging code.
The bugs have been fixed, and the debugging code is hitting a crash
trying to print the dex file of an array class (array classes do not
have dex files).
Test: m
Bug: 233701923
Bug: 77342775
Change-Id: Id6edfeec26139b93a624de925421f110fe218c88
-rw-r--r-- | runtime/common_throws.cc | 2 | ||||
-rw-r--r-- | runtime/debug_print.cc | 56 | ||||
-rw-r--r-- | runtime/debug_print.h | 3 | ||||
-rw-r--r-- | runtime/verifier/register_line-inl.h | 9 |
4 files changed, 0 insertions, 70 deletions
diff --git a/runtime/common_throws.cc b/runtime/common_throws.cc index 17a0a8a714..3a33f2a3aa 100644 --- a/runtime/common_throws.cc +++ b/runtime/common_throws.cc @@ -152,7 +152,6 @@ void ThrowWrappedBootstrapMethodError(const char* fmt, ...) { // ClassCastException void ThrowClassCastException(ObjPtr<mirror::Class> dest_type, ObjPtr<mirror::Class> src_type) { - DumpB77342775DebugData(dest_type, src_type); ThrowException("Ljava/lang/ClassCastException;", nullptr, StringPrintf("%s cannot be cast to %s", mirror::Class::PrettyDescriptor(src_type).c_str(), @@ -281,7 +280,6 @@ void ThrowIncompatibleClassChangeErrorClassForInterfaceDispatch(ArtMethod* inter << "' does not implement interface '" << mirror::Class::PrettyDescriptor(interface_method->GetDeclaringClass()) << "' in call to '" << ArtMethod::PrettyMethod(interface_method) << "'"; - DumpB77342775DebugData(interface_method->GetDeclaringClass(), this_object->GetClass()); ThrowException("Ljava/lang/IncompatibleClassChangeError;", referrer != nullptr ? referrer->GetDeclaringClass() : nullptr, msg.str().c_str()); diff --git a/runtime/debug_print.cc b/runtime/debug_print.cc index cde4d868cb..9c38cce77a 100644 --- a/runtime/debug_print.cc +++ b/runtime/debug_print.cc @@ -129,60 +129,4 @@ std::string DescribeLoaders(ObjPtr<mirror::ClassLoader> loader, const char* clas return oss.str(); } -void DumpB77342775DebugData(ObjPtr<mirror::Class> target_class, ObjPtr<mirror::Class> src_class) { - std::string target_descriptor_storage; - const char* target_descriptor = target_class->GetDescriptor(&target_descriptor_storage); - const char kCheckedPrefix[] = "Lorg/apache/http/"; - // Avoid spam for other packages. (That spam would break some ART run-tests for example.) - if (strncmp(target_descriptor, kCheckedPrefix, sizeof(kCheckedPrefix) - 1) != 0) { - return; - } - auto matcher = [target_descriptor, target_class](ObjPtr<mirror::Class> klass) - REQUIRES_SHARED(Locks::mutator_lock_) { - if (klass->DescriptorEquals(target_descriptor)) { - LOG(ERROR) << " descriptor match in " - << DescribeLoaders(klass->GetClassLoader(), target_descriptor) - << " match? " << std::boolalpha << (klass == target_class); - } - }; - - std::string source_descriptor_storage; - const char* source_descriptor = src_class->GetDescriptor(&source_descriptor_storage); - - LOG(ERROR) << "Maybe bug 77342775, looking for " << 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 - << " " << 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); - LOG(ERROR) << " iface #" << i << ": " << iface->PrettyDescriptor(); - matcher(iface); - } - } else { - LOG(ERROR) << " in superclass chain for " << 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()) { - LOG(ERROR) << " - " << klass->PrettyDescriptor(); - matcher(klass); - } - } -} - } // namespace art diff --git a/runtime/debug_print.h b/runtime/debug_print.h index e2990d4c2d..7c6840284d 100644 --- a/runtime/debug_print.h +++ b/runtime/debug_print.h @@ -29,9 +29,6 @@ std::string DescribeSpace(ObjPtr<mirror::Class> klass) std::string DescribeLoaders(ObjPtr<mirror::ClassLoader> loader, const char* class_descriptor) REQUIRES_SHARED(Locks::mutator_lock_) COLD_ATTR; -void DumpB77342775DebugData(ObjPtr<mirror::Class> target_class, ObjPtr<mirror::Class> src_class) - REQUIRES_SHARED(Locks::mutator_lock_) COLD_ATTR; - } // namespace art #endif // ART_RUNTIME_DEBUG_PRINT_H_ diff --git a/runtime/verifier/register_line-inl.h b/runtime/verifier/register_line-inl.h index 6b53687c0c..7b5a4960d1 100644 --- a/runtime/verifier/register_line-inl.h +++ b/runtime/verifier/register_line-inl.h @@ -20,7 +20,6 @@ #include "register_line.h" #include "base/logging.h" // For VLOG. -#include "debug_print.h" #include "method_verifier.h" #include "reg_type_cache-inl.h" @@ -139,14 +138,6 @@ inline bool RegisterLine::VerifyRegisterType(MethodVerifier* verifier, uint32_t } verifier->Fail(fail_type) << "register v" << vsrc << " has type " << src_type << " but expected " << check_type; - if (check_type.IsNonZeroReferenceTypes() && - !check_type.IsUnresolvedTypes() && - check_type.HasClass() && - src_type.IsNonZeroReferenceTypes() && - !src_type.IsUnresolvedTypes() && - src_type.HasClass()) { - DumpB77342775DebugData(check_type.GetClass(), src_type.GetClass()); - } return false; } if (check_type.IsLowHalf()) { |