Skip to content

Commit 58c09c2

Browse files
alexmarkovCommit Queue
authored andcommitted
[vm,dyn_modules] Fix Dart stack dump for crashes in the interpreter
When crash happens in the interpreter while running Dart code, Dart stack dump should start with the interpreter frame instead of using crash sp/fp/pc. (Native stack dump still uses crash sp/fp/pc.) TEST=manual Change-Id: I8748d3f9c683fcc0cbda949ff7619981c9f3f134 Cq-Include-Trybots: luci.dart.try:vm-aot-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try,vm-dyn-linux-debug-x64-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/441821 Reviewed-by: Ryan Macnak <[email protected]> Commit-Queue: Alexander Markov <[email protected]>
1 parent 200f10e commit 58c09c2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

runtime/vm/profiler.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,14 @@ void Profiler::DumpStackTrace(uword sp, uword fp, uword pc, bool for_crash) {
570570
StackFrame::DumpCurrentTrace();
571571
} else if (thread->execution_state() == Thread::kThreadInGenerated) {
572572
// No exit frame, walk from the crash's registers.
573+
#if defined(DART_DYNAMIC_MODULES)
574+
if (thread->vm_tag() == VMTag::kDartInterpretedTagId) {
575+
Interpreter* interpreter = thread->interpreter();
576+
sp = interpreter->get_sp();
577+
fp = interpreter->get_fp();
578+
pc = interpreter->get_pc();
579+
}
580+
#endif // defined(DART_DYNAMIC_MODULES)
573581
StackFrame::DumpCurrentTrace(sp, fp, pc);
574582
}
575583
}

0 commit comments

Comments
 (0)