| 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 12 matching lines...) Expand all Loading... |
| 23 #include "vm/stub_code.h" | 23 #include "vm/stub_code.h" |
| 24 #include "vm/symbols.h" | 24 #include "vm/symbols.h" |
| 25 #include "vm/visitor.h" | 25 #include "vm/visitor.h" |
| 26 | 26 |
| 27 | 27 |
| 28 namespace dart { | 28 namespace dart { |
| 29 | 29 |
| 30 DEFINE_FLAG(bool, verbose_debug, false, "Verbose debugger messages"); | 30 DEFINE_FLAG(bool, verbose_debug, false, "Verbose debugger messages"); |
| 31 DEFINE_FLAG(bool, trace_debugger_stacktrace, false, | 31 DEFINE_FLAG(bool, trace_debugger_stacktrace, false, |
| 32 "Trace debugger stacktrace collection"); | 32 "Trace debugger stacktrace collection"); |
| 33 DEFINE_FLAG(bool, show_invisible_frames, false, |
| 34 "Show invisible frames in debugger stack traces"); |
| 33 | 35 |
| 34 | 36 |
| 35 Debugger::EventHandler* Debugger::event_handler_ = NULL; | 37 Debugger::EventHandler* Debugger::event_handler_ = NULL; |
| 36 | 38 |
| 37 | 39 |
| 38 class RemoteObjectCache : public ZoneAllocated { | 40 class RemoteObjectCache : public ZoneAllocated { |
| 39 public: | 41 public: |
| 40 explicit RemoteObjectCache(intptr_t initial_size); | 42 explicit RemoteObjectCache(intptr_t initial_size); |
| 41 intptr_t AddObject(const Object& obj); | 43 intptr_t AddObject(const Object& obj); |
| 42 RawObject* GetObj(intptr_t obj_id) const; | 44 RawObject* GetObj(intptr_t obj_id) const; |
| (...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 VariableAt(v, &var_name, &unused, &unused, &var_value); | 859 VariableAt(v, &var_name, &unused, &unused, &var_value); |
| 858 jsvar.AddProperty("name", var_name.ToCString()); | 860 jsvar.AddProperty("name", var_name.ToCString()); |
| 859 jsvar.AddProperty("value", var_value); | 861 jsvar.AddProperty("value", var_value); |
| 860 } | 862 } |
| 861 } | 863 } |
| 862 } | 864 } |
| 863 | 865 |
| 864 | 866 |
| 865 | 867 |
| 866 void DebuggerStackTrace::AddActivation(ActivationFrame* frame) { | 868 void DebuggerStackTrace::AddActivation(ActivationFrame* frame) { |
| 867 if (frame->function().is_visible()) { | 869 if (FLAG_show_invisible_frames || frame->function().is_visible()) { |
| 868 trace_.Add(frame); | 870 trace_.Add(frame); |
| 869 } | 871 } |
| 870 } | 872 } |
| 871 | 873 |
| 872 | 874 |
| 873 static bool IsSafeDescKind(PcDescriptors::Kind kind) { | 875 static bool IsSafeDescKind(PcDescriptors::Kind kind) { |
| 874 return ((kind == PcDescriptors::kIcCall) || | 876 return ((kind == PcDescriptors::kIcCall) || |
| 875 (kind == PcDescriptors::kOptStaticCall) || | 877 (kind == PcDescriptors::kOptStaticCall) || |
| 876 (kind == PcDescriptors::kUnoptStaticCall) || | 878 (kind == PcDescriptors::kUnoptStaticCall) || |
| 877 (kind == PcDescriptors::kClosureCall) || | 879 (kind == PcDescriptors::kClosureCall) || |
| (...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2526 } | 2528 } |
| 2527 | 2529 |
| 2528 | 2530 |
| 2529 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 2531 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 2530 ASSERT(bpt->next() == NULL); | 2532 ASSERT(bpt->next() == NULL); |
| 2531 bpt->set_next(code_breakpoints_); | 2533 bpt->set_next(code_breakpoints_); |
| 2532 code_breakpoints_ = bpt; | 2534 code_breakpoints_ = bpt; |
| 2533 } | 2535 } |
| 2534 | 2536 |
| 2535 } // namespace dart | 2537 } // namespace dart |
| OLD | NEW |