Index: runtime/lib/stacktrace.cc |
diff --git a/runtime/lib/stacktrace.cc b/runtime/lib/stacktrace.cc |
index 9d9a3075d0df62820dc5eee8fb3c2336c647c738..a63d66dd805afdc02fbf18e3d71d3a6fdfaf569f 100644 |
--- a/runtime/lib/stacktrace.cc |
+++ b/runtime/lib/stacktrace.cc |
@@ -61,6 +61,16 @@ void _printCurrentStacktrace() { |
OS::PrintErr("=== Current Trace:\n%s===\n", stacktrace.ToCString()); |
} |
+// Like _printCurrentStacktrace, but works in a NoSafepointScope. |
+void _printCurrentStacktraceNoSafepoint() { |
+ StackFrameIterator frames(StackFrameIterator::kDontValidateFrames); |
+ StackFrame* frame = frames.NextFrame(); |
+ while (frame != NULL) { |
+ OS::Print("%s\n", frame->ToCString()); |
+ frame = frames.NextFrame(); |
+ } |
+} |
+ |
DEFINE_NATIVE_ENTRY(StackTrace_current, 0) { |
const Stacktrace& stacktrace = GetCurrentStacktrace(1); |
return stacktrace.raw(); |