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 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 VariableAt(v, &var_name, &unused, &unused, &var_value); | 899 VariableAt(v, &var_name, &unused, &unused, &var_value); |
900 jsvar.AddProperty("name", var_name.ToCString()); | 900 jsvar.AddProperty("name", var_name.ToCString()); |
901 jsvar.AddProperty("value", var_value); | 901 jsvar.AddProperty("value", var_value); |
902 } | 902 } |
903 } | 903 } |
904 } | 904 } |
905 | 905 |
906 | 906 |
907 | 907 |
908 void DebuggerStackTrace::AddActivation(ActivationFrame* frame) { | 908 void DebuggerStackTrace::AddActivation(ActivationFrame* frame) { |
909 if (FLAG_show_invisible_frames || frame->function().is_visible()) { | 909 if (FLAG_show_invisible_frames || frame->function().is_debuggable()) { |
910 trace_.Add(frame); | 910 trace_.Add(frame); |
911 } | 911 } |
912 } | 912 } |
913 | 913 |
914 | 914 |
915 const uint8_t kSafepointKind = | 915 const uint8_t kSafepointKind = |
916 RawPcDescriptors::kIcCall | RawPcDescriptors::kOptStaticCall | | 916 RawPcDescriptors::kIcCall | RawPcDescriptors::kOptStaticCall | |
917 RawPcDescriptors::kUnoptStaticCall | RawPcDescriptors::kClosureCall | | 917 RawPcDescriptors::kUnoptStaticCall | RawPcDescriptors::kClosureCall | |
918 RawPcDescriptors::kRuntimeCall; | 918 RawPcDescriptors::kRuntimeCall; |
919 | 919 |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1317 const Array& deopt_frame = Array::Handle(); | 1317 const Array& deopt_frame = Array::Handle(); |
1318 const intptr_t deopt_frame_offset = -1; | 1318 const intptr_t deopt_frame_offset = -1; |
1319 | 1319 |
1320 for (intptr_t i = 0; i < ex_trace.Length(); i++) { | 1320 for (intptr_t i = 0; i < ex_trace.Length(); i++) { |
1321 function = ex_trace.FunctionAtFrame(i); | 1321 function = ex_trace.FunctionAtFrame(i); |
1322 // Pre-allocated Stacktraces may include empty slots, either (a) to indicate | 1322 // Pre-allocated Stacktraces may include empty slots, either (a) to indicate |
1323 // where frames were omitted in the case a stack has more frames than the | 1323 // where frames were omitted in the case a stack has more frames than the |
1324 // pre-allocated trace (such as a stack overflow) or (b) because a stack has | 1324 // pre-allocated trace (such as a stack overflow) or (b) because a stack has |
1325 // fewer frames that the pre-allocated trace (such as memory exhaustion with | 1325 // fewer frames that the pre-allocated trace (such as memory exhaustion with |
1326 // a shallow stack). | 1326 // a shallow stack). |
1327 if (!function.IsNull() && function.is_visible()) { | 1327 if (!function.IsNull() && function.is_debuggable()) { |
1328 code = ex_trace.CodeAtFrame(i); | 1328 code = ex_trace.CodeAtFrame(i); |
1329 ASSERT(function.raw() == code.function()); | 1329 ASSERT(function.raw() == code.function()); |
1330 uword pc = code.EntryPoint() + Smi::Value(ex_trace.PcOffsetAtFrame(i)); | 1330 uword pc = code.EntryPoint() + Smi::Value(ex_trace.PcOffsetAtFrame(i)); |
1331 if (code.is_optimized() && ex_trace.expand_inlined()) { | 1331 if (code.is_optimized() && ex_trace.expand_inlined()) { |
1332 // Traverse inlined frames. | 1332 // Traverse inlined frames. |
1333 for (InlinedFunctionsIterator it(code, pc); !it.Done(); it.Advance()) { | 1333 for (InlinedFunctionsIterator it(code, pc); !it.Done(); it.Advance()) { |
1334 function = it.function(); | 1334 function = it.function(); |
1335 code = it.code(); | 1335 code = it.code(); |
1336 ASSERT(function.raw() == code.function()); | 1336 ASSERT(function.raw() == code.function()); |
1337 uword pc = it.pc(); | 1337 uword pc = it.pc(); |
(...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2624 } | 2624 } |
2625 | 2625 |
2626 | 2626 |
2627 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 2627 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
2628 ASSERT(bpt->next() == NULL); | 2628 ASSERT(bpt->next() == NULL); |
2629 bpt->set_next(code_breakpoints_); | 2629 bpt->set_next(code_breakpoints_); |
2630 code_breakpoints_ = bpt; | 2630 code_breakpoints_ = bpt; |
2631 } | 2631 } |
2632 | 2632 |
2633 } // namespace dart | 2633 } // namespace dart |
OLD | NEW |