Debug support for verifier rewriting.
Full instruction dumps can be enabled by setting gDebugVerify in the
file.
Change-Id: I0dca1c09f0fc1ee51e0084758f7ee041b0778c4f
diff --git a/src/dex_instruction.cc b/src/dex_instruction.cc
index a4f1bfc..029c68b 100644
--- a/src/dex_instruction.cc
+++ b/src/dex_instruction.cc
@@ -213,6 +213,7 @@
case k11x:
case k10t:
return 1;
+ case k20bc:
case k20t:
case k22x:
case k21t:
diff --git a/src/dex_verifier.cc b/src/dex_verifier.cc
index 85c4182..72c1da5 100644
--- a/src/dex_verifier.cc
+++ b/src/dex_verifier.cc
@@ -3502,6 +3502,12 @@
insns[work_insn_idx_] = new_instruction;
// The 2nd code unit (higher in memory) with the reference in, comes from the instruction we
// rewrote, so nothing to do here.
+ LOG(INFO) << "Verification error, replacing instructions in " << PrettyMethod(method_) << " "
+ << fail_messages_.str();
+ if (gDebugVerify) {
+ std::cout << std::endl << info_messages_.str();
+ Dump(std::cout);
+ }
}
bool DexVerifier::UpdateRegisters(uint32_t next_insn, const RegisterLine* merge_line) {