Make stack visitor location for bad roots more verbose.
Change-Id: Ib2f3f48ccf1f5b2f3a4d1a61df553ad1a5c29d38
diff --git a/src/stack.cc b/src/stack.cc
index f712652..be737ac 100644
--- a/src/stack.cc
+++ b/src/stack.cc
@@ -149,6 +149,16 @@
return visitor.frames;
}
+std::string StackVisitor::DescribeLocation() const {
+ std::string result("Visiting method '");
+ result += PrettyMethod(GetMethod());
+ result += StringPrintf("' at dex PC 0x%04zx", GetDexPc());
+ if (!IsShadowFrame()) {
+ result += StringPrintf(" (native PC %p)", reinterpret_cast<void*>(GetCurrentQuickFramePc()));
+ }
+ return result;
+}
+
void StackVisitor::SanityCheckFrame() const {
#ifndef NDEBUG
AbstractMethod* method = GetMethod();