summaryrefslogtreecommitdiff
path: root/runtime/mirror/throwable.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/mirror/throwable.cc')
-rw-r--r--runtime/mirror/throwable.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/mirror/throwable.cc b/runtime/mirror/throwable.cc
index 61d85e2fe2..fdfeb47da0 100644
--- a/runtime/mirror/throwable.cc
+++ b/runtime/mirror/throwable.cc
@@ -69,6 +69,13 @@ bool Throwable::IsCheckedException() {
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 += ": ";