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

Unified Diff: runtime/vm/debugger.cc

Issue 2686813006: Reapply "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
« no previous file with comments | « runtime/vm/code_descriptors.cc ('k') | runtime/vm/disassembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index 1c3121a27dc20c8a4f3fcf9e579f04685560da1c..f98a2e8f58ee5863ec721e4bc77daa229debb85c 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -1767,35 +1767,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);
}
}
}
« no previous file with comments | « runtime/vm/code_descriptors.cc ('k') | runtime/vm/disassembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698