Add more debugging info around ResolveField.
To better diagnose the DCHECK that we have hit here:
https://android-build.googleplex.com/builds/git_master-art-host-linux-art-jit/6325844/logs/build.log
Test: test.py
Change-Id: If160b74055c27cd02bde27e29c7e7f731c458f4d
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index 1e7b48e..fe4a86e 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -1651,7 +1651,11 @@
dex_compilation_unit_->GetDexCache(),
class_loader,
is_static);
- DCHECK_EQ(resolved_field == nullptr, soa.Self()->IsExceptionPending());
+ DCHECK_EQ(resolved_field == nullptr, soa.Self()->IsExceptionPending())
+ << "field="
+ << ((resolved_field == nullptr) ? "null" : resolved_field->PrettyField())
+ << ", exception="
+ << (soa.Self()->IsExceptionPending() ? soa.Self()->GetException()->Dump() : "null");
if (UNLIKELY(resolved_field == nullptr)) {
// Clean up any exception left by field resolution.
soa.Self()->ClearException();
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index c3e630f..d46f93d 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -8875,6 +8875,7 @@
Handle<mirror::ClassLoader> class_loader,
bool is_static) {
DCHECK(dex_cache != nullptr);
+ DCHECK(!Thread::Current()->IsExceptionPending()) << Thread::Current()->GetException()->Dump();
ArtField* resolved = dex_cache->GetResolvedField(field_idx, image_pointer_size_);
Thread::PoisonObjectPointersIfDebug();
if (resolved != nullptr) {