Chromium Code Reviews| 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 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1799 } | 1799 } |
| 1800 | 1800 |
| 1801 | 1801 |
| 1802 void Debugger::CollectLibraryFields(const GrowableObjectArray& field_list, | 1802 void Debugger::CollectLibraryFields(const GrowableObjectArray& field_list, |
| 1803 const Library& lib, | 1803 const Library& lib, |
| 1804 const String& prefix, | 1804 const String& prefix, |
| 1805 bool include_private_fields) { | 1805 bool include_private_fields) { |
| 1806 DictionaryIterator it(lib); | 1806 DictionaryIterator it(lib); |
| 1807 Object& entry = Object::Handle(isolate_); | 1807 Object& entry = Object::Handle(isolate_); |
| 1808 Field& field = Field::Handle(isolate_); | 1808 Field& field = Field::Handle(isolate_); |
| 1809 Class& cls = Class::Handle(isolate_); | |
| 1810 String& field_name = String::Handle(isolate_); | 1809 String& field_name = String::Handle(isolate_); |
| 1811 Object& field_value = Object::Handle(isolate_); | 1810 Object& field_value = Object::Handle(isolate_); |
| 1812 while (it.HasNext()) { | 1811 while (it.HasNext()) { |
| 1813 entry = it.GetNext(); | 1812 entry = it.GetNext(); |
| 1814 if (entry.IsField()) { | 1813 if (entry.IsField()) { |
| 1815 field ^= entry.raw(); | 1814 field ^= entry.raw(); |
| 1816 cls = field.owner(); | |
| 1817 ASSERT(field.is_static()); | 1815 ASSERT(field.is_static()); |
| 1818 field_name = field.name(); | 1816 field_name = field.name(); |
| 1819 if ((field_name.CharAt(0) == '_') && !include_private_fields) { | 1817 if ((field_name.CharAt(0) == '_') && !include_private_fields) { |
| 1820 // Skip library-private field. | 1818 // Skip library-private field. |
| 1821 continue; | 1819 continue; |
| 1822 } | 1820 } |
| 1823 field_value = GetStaticField(cls, field_name); | 1821 // If the field is not initialized yet, just report the value |
|
Jacob
2014/01/09 17:51:12
At what times will this occur?
It seems confusing
| |
| 1822 // to be null. We don't want to execute the implicit getter | |
| 1823 // since it may have side effects. | |
| 1824 if (field.value() == Object::sentinel().raw()) { | |
| 1825 field_value = Object::null(); | |
|
srdjan
2014/01/09 18:15:32
Can we use a value like 'optimized out', or in thi
| |
| 1826 } else { | |
| 1827 field_value = field.value(); | |
| 1828 } | |
| 1824 if (!prefix.IsNull()) { | 1829 if (!prefix.IsNull()) { |
| 1825 field_name = String::Concat(prefix, field_name); | 1830 field_name = String::Concat(prefix, field_name); |
| 1826 } | 1831 } |
| 1827 field_list.Add(field_name); | 1832 field_list.Add(field_name); |
| 1828 field_list.Add(field_value); | 1833 field_list.Add(field_value); |
| 1829 } | 1834 } |
| 1830 } | 1835 } |
| 1831 } | 1836 } |
| 1832 | 1837 |
| 1833 | 1838 |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2281 } | 2286 } |
| 2282 | 2287 |
| 2283 | 2288 |
| 2284 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 2289 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 2285 ASSERT(bpt->next() == NULL); | 2290 ASSERT(bpt->next() == NULL); |
| 2286 bpt->set_next(code_breakpoints_); | 2291 bpt->set_next(code_breakpoints_); |
| 2287 code_breakpoints_ = bpt; | 2292 code_breakpoints_ = bpt; |
| 2288 } | 2293 } |
| 2289 | 2294 |
| 2290 } // namespace dart | 2295 } // namespace dart |
| OLD | NEW |