Store return address before performing a thread dump
Change-Id: Ifabe65cba60bb0d01b70346b923a09c48f90d9ba
diff --git a/src/thread.cc b/src/thread.cc
index dde0f66..3495438 100644
--- a/src/thread.cc
+++ b/src/thread.cc
@@ -147,6 +147,7 @@
// TODO: placeholder
void StackOverflowFromCode(Method* method) {
+ Thread::Current()->SetTopOfStackPC(reinterpret_cast<uintptr_t>(__builtin_return_address(0)));
Thread::Current()->Dump(std::cerr);
//NOTE: to save code space, this handler needs to look up its own Thread*
UNIMPLEMENTED(FATAL) << "Stack overflow: " << PrettyMethod(method);
@@ -154,6 +155,7 @@
// TODO: placeholder
void ThrowNullPointerFromCode() {
+ Thread::Current()->SetTopOfStackPC(reinterpret_cast<uintptr_t>(__builtin_return_address(0)));
Thread::Current()->Dump(std::cerr);
//NOTE: to save code space, this handler must look up caller's Method*
UNIMPLEMENTED(FATAL) << "Null pointer exception";