Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1235)

Unified Diff: runtime/vm/debugger.cc

Issue 2684763002: Use CodeSourceMap for stack traces (still JIT only). (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/debugger.cc
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index 4b145ad272440d11d2a50f55365e7996385eadfe..37ce72e952272414a22356e50cff06f04f6b66ff 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -1578,35 +1578,41 @@ DebuggerStackTrace* Debugger::StackTraceFrom(const class StackTrace& ex_trace) {
const intptr_t deopt_frame_offset = -1;
for (intptr_t i = 0; i < ex_trace.Length(); i++) {
- function = ex_trace.FunctionAtFrame(i);
+ code = ex_trace.CodeAtFrame(i);
// Pre-allocated StackTraces may include empty slots, either (a) to indicate
// where frames were omitted in the case a stack has more frames than the
// pre-allocated trace (such as a stack overflow) or (b) because a stack has
// fewer frames that the pre-allocated trace (such as memory exhaustion with
// a shallow stack).
- if (!function.IsNull() && function.is_visible()) {
- code = ex_trace.CodeAtFrame(i);
- ASSERT(function.raw() == code.function());
- uword pc = code.PayloadStart() + Smi::Value(ex_trace.PcOffsetAtFrame(i));
- if (code.is_optimized() && ex_trace.expand_inlined()) {
- // Traverse inlined frames.
- for (InlinedFunctionsIterator it(code, pc); !it.Done(); it.Advance()) {
- function = it.function();
- code = it.code();
- ASSERT(function.raw() == code.function());
- uword pc = it.pc();
- ASSERT(pc != 0);
- ASSERT(code.PayloadStart() <= pc);
- ASSERT(pc < (code.PayloadStart() + code.Size()));
-
+ if (!code.IsNull()) {
+ ASSERT(code.IsFunctionCode());
+ function = code.function();
+ if (function.is_visible()) {
+ code = ex_trace.CodeAtFrame(i);
+ ASSERT(function.raw() == code.function());
+ uword pc =
+ code.PayloadStart() + Smi::Value(ex_trace.PcOffsetAtFrame(i));
+ if (code.is_optimized() && ex_trace.expand_inlined()) {
+ // Traverse inlined frames.
+ for (InlinedFunctionsIterator it(code, pc); !it.Done();
+ it.Advance()) {
+ function = it.function();
+ code = it.code();
+ ASSERT(function.raw() == code.function());
+ uword pc = it.pc();
+ ASSERT(pc != 0);
+ ASSERT(code.PayloadStart() <= pc);
+ ASSERT(pc < (code.PayloadStart() + code.Size()));
+
+ ActivationFrame* activation = new ActivationFrame(
+ pc, fp, sp, code, deopt_frame, deopt_frame_offset);
+ stack_trace->AddActivation(activation);
+ }
+ } else {
ActivationFrame* activation = new ActivationFrame(
pc, fp, sp, code, deopt_frame, deopt_frame_offset);
stack_trace->AddActivation(activation);
}
- } else {
- ActivationFrame* activation = new ActivationFrame(
- pc, fp, sp, code, deopt_frame, deopt_frame_offset);
- stack_trace->AddActivation(activation);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698