Change how we report exceptions to the debugger.
This is only a refactoring/cleanup. Bug fixes with respect
to catch location, and more cleanups will follow.
Change-Id: I30d3c6260b0c8f8115a811621397225b88f2063a
diff --git a/runtime/mirror/throwable.cc b/runtime/mirror/throwable.cc
index 61d85e2..fdfeb47 100644
--- a/runtime/mirror/throwable.cc
+++ b/runtime/mirror/throwable.cc
@@ -69,6 +69,13 @@
return !InstanceOf(WellKnownClasses::ToClass(WellKnownClasses::java_lang_RuntimeException));
}
+int32_t Throwable::GetStackDepth() {
+ Object* stack_state = GetStackState();
+ if (stack_state == nullptr || !stack_state->IsObjectArray()) return -1;
+ ObjectArray<Object>* method_trace = down_cast<ObjectArray<Object>*>(stack_state);
+ return method_trace->GetLength() - 1;
+}
+
std::string Throwable::Dump() {
std::string result(PrettyTypeOf(this));
result += ": ";