| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/debugger.h" | 5 #include "vm/debugger.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 | 8 |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
| (...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1293 Function& function = Function::Handle(); | 1293 Function& function = Function::Handle(); |
| 1294 Code& code = Code::Handle(); | 1294 Code& code = Code::Handle(); |
| 1295 | 1295 |
| 1296 const uword fp = 0; | 1296 const uword fp = 0; |
| 1297 const uword sp = 0; | 1297 const uword sp = 0; |
| 1298 const Array& deopt_frame = Array::Handle(); | 1298 const Array& deopt_frame = Array::Handle(); |
| 1299 const intptr_t deopt_frame_offset = -1; | 1299 const intptr_t deopt_frame_offset = -1; |
| 1300 | 1300 |
| 1301 for (intptr_t i = 0; i < ex_trace.Length(); i++) { | 1301 for (intptr_t i = 0; i < ex_trace.Length(); i++) { |
| 1302 function = ex_trace.FunctionAtFrame(i); | 1302 function = ex_trace.FunctionAtFrame(i); |
| 1303 if (function.IsNull()) { | 1303 // Pre-allocated Stacktraces may include empty slots, either (a) to indicate |
| 1304 // Check if null function object indicates a stack trace overflow. | 1304 // where frames were omitted in the case a stack has more frames than the |
| 1305 // Preallocated stacktraces like StackOverflow or OutOfMemory make skip | 1305 // pre-allocated trace (such as a stack overflow) or (b) because a stack has |
| 1306 // frames. | 1306 // fewer frames that the pre-allocated trace (such as memory exhaustion with |
| 1307 ASSERT((i < (ex_trace.Length() - 1)) && | 1307 // a shallow stack). |
| 1308 (ex_trace.FunctionAtFrame(i + 1) != Function::null())); | 1308 if (!function.IsNull() && function.is_visible()) { |
| 1309 } else if (function.is_visible()) { | |
| 1310 code = ex_trace.CodeAtFrame(i); | 1309 code = ex_trace.CodeAtFrame(i); |
| 1311 ASSERT(function.raw() == code.function()); | 1310 ASSERT(function.raw() == code.function()); |
| 1312 uword pc = code.EntryPoint() + Smi::Value(ex_trace.PcOffsetAtFrame(i)); | 1311 uword pc = code.EntryPoint() + Smi::Value(ex_trace.PcOffsetAtFrame(i)); |
| 1313 if (code.is_optimized() && ex_trace.expand_inlined()) { | 1312 if (code.is_optimized() && ex_trace.expand_inlined()) { |
| 1314 // Traverse inlined frames. | 1313 // Traverse inlined frames. |
| 1315 for (InlinedFunctionsIterator it(code, pc); !it.Done(); it.Advance()) { | 1314 for (InlinedFunctionsIterator it(code, pc); !it.Done(); it.Advance()) { |
| 1316 function = it.function(); | 1315 function = it.function(); |
| 1317 code = it.code(); | 1316 code = it.code(); |
| 1318 ASSERT(function.raw() == code.function()); | 1317 ASSERT(function.raw() == code.function()); |
| 1319 uword pc = it.pc(); | 1318 uword pc = it.pc(); |
| (...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2227 } | 2226 } |
| 2228 | 2227 |
| 2229 | 2228 |
| 2230 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 2229 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 2231 ASSERT(bpt->next() == NULL); | 2230 ASSERT(bpt->next() == NULL); |
| 2232 bpt->set_next(code_breakpoints_); | 2231 bpt->set_next(code_breakpoints_); |
| 2233 code_breakpoints_ = bpt; | 2232 code_breakpoints_ = bpt; |
| 2234 } | 2233 } |
| 2235 | 2234 |
| 2236 } // namespace dart | 2235 } // namespace dart |
| OLD | NEW |