| 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 2384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2395 } | 2395 } |
| 2396 return Array::MakeArray(field_list); | 2396 return Array::MakeArray(field_list); |
| 2397 } | 2397 } |
| 2398 | 2398 |
| 2399 | 2399 |
| 2400 void Debugger::CollectLibraryFields(const GrowableObjectArray& field_list, | 2400 void Debugger::CollectLibraryFields(const GrowableObjectArray& field_list, |
| 2401 const Library& lib, | 2401 const Library& lib, |
| 2402 const String& prefix, | 2402 const String& prefix, |
| 2403 bool include_private_fields) { | 2403 bool include_private_fields) { |
| 2404 DictionaryIterator it(lib); | 2404 DictionaryIterator it(lib); |
| 2405 Object& entry = Object::Handle(isolate_->current_zone()); | 2405 Object& entry = Object::Handle(zone()); |
| 2406 Field& field = Field::Handle(zone()); | 2406 Field& field = Field::Handle(zone()); |
| 2407 String& field_name = String::Handle(zone()); | 2407 String& field_name = String::Handle(zone()); |
| 2408 PassiveObject& field_value = PassiveObject::Handle(isolate_->current_zone()); | 2408 PassiveObject& field_value = PassiveObject::Handle(zone()); |
| 2409 while (it.HasNext()) { | 2409 while (it.HasNext()) { |
| 2410 entry = it.GetNext(); | 2410 entry = it.GetNext(); |
| 2411 if (entry.IsField()) { | 2411 if (entry.IsField()) { |
| 2412 field ^= entry.raw(); | 2412 field ^= entry.raw(); |
| 2413 ASSERT(field.is_static()); | 2413 ASSERT(field.is_static()); |
| 2414 field_name = field.name(); | 2414 field_name = field.name(); |
| 2415 if ((field_name.CharAt(0) == '_') && !include_private_fields) { | 2415 if ((field_name.CharAt(0) == '_') && !include_private_fields) { |
| 2416 // Skip library-private field. | 2416 // Skip library-private field. |
| 2417 continue; | 2417 continue; |
| 2418 } | 2418 } |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2782 | 2782 |
| 2783 stack_trace_ = NULL; | 2783 stack_trace_ = NULL; |
| 2784 } | 2784 } |
| 2785 | 2785 |
| 2786 | 2786 |
| 2787 void Debugger::Initialize(Isolate* isolate) { | 2787 void Debugger::Initialize(Isolate* isolate) { |
| 2788 if (initialized_) { | 2788 if (initialized_) { |
| 2789 return; | 2789 return; |
| 2790 } | 2790 } |
| 2791 isolate_ = isolate; | 2791 isolate_ = isolate; |
| 2792 | |
| 2793 // Use the isolate's control port as the isolate_id for debugging. | 2792 // Use the isolate's control port as the isolate_id for debugging. |
| 2794 // This port will be used as a unique ID to represent the isolate in the | 2793 // This port will be used as a unique ID to represent the isolate in the |
| 2795 // debugger wire protocol messages. | 2794 // debugger wire protocol messages. |
| 2796 isolate_id_ = isolate_->main_port(); | 2795 isolate_id_ = isolate_->main_port(); |
| 2797 initialized_ = true; | 2796 initialized_ = true; |
| 2798 } | 2797 } |
| 2799 | 2798 |
| 2800 | 2799 |
| 2801 void Debugger::NotifyIsolateCreated() { | 2800 void Debugger::NotifyIsolateCreated() { |
| 2802 // Signal isolate creation event. | 2801 // Signal isolate creation event. |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3239 } | 3238 } |
| 3240 | 3239 |
| 3241 | 3240 |
| 3242 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 3241 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 3243 ASSERT(bpt->next() == NULL); | 3242 ASSERT(bpt->next() == NULL); |
| 3244 bpt->set_next(code_breakpoints_); | 3243 bpt->set_next(code_breakpoints_); |
| 3245 code_breakpoints_ = bpt; | 3244 code_breakpoints_ = bpt; |
| 3246 } | 3245 } |
| 3247 | 3246 |
| 3248 } // namespace dart | 3247 } // namespace dart |
| OLD | NEW |