Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Side by Side Diff: runtime/vm/debugger.cc

Issue 126653003: Debugger no longer causes top level variable initialization (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/symbols.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
1822 // to be null. We don't want to execute the implicit getter
Jakob.Gruber 2014/01/09 21:46:38 The comment now refers to null while the value is
hausner 2014/01/09 21:50:05 Nice catch, thank you.
1823 // since it may have side effects.
1824 if ((field.value() == Object::sentinel().raw()) ||
1825 (field.value() == Object::transition_sentinel().raw())) {
1826 field_value = Symbols::Uninitialized().raw();
1827 } else {
1828 field_value = field.value();
1829 }
1824 if (!prefix.IsNull()) { 1830 if (!prefix.IsNull()) {
1825 field_name = String::Concat(prefix, field_name); 1831 field_name = String::Concat(prefix, field_name);
1826 } 1832 }
1827 field_list.Add(field_name); 1833 field_list.Add(field_name);
1828 field_list.Add(field_value); 1834 field_list.Add(field_value);
1829 } 1835 }
1830 } 1836 }
1831 } 1837 }
1832 1838
1833 1839
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
2281 } 2287 }
2282 2288
2283 2289
2284 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { 2290 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) {
2285 ASSERT(bpt->next() == NULL); 2291 ASSERT(bpt->next() == NULL);
2286 bpt->set_next(code_breakpoints_); 2292 bpt->set_next(code_breakpoints_);
2287 code_breakpoints_ = bpt; 2293 code_breakpoints_ = bpt;
2288 } 2294 }
2289 2295
2290 } // namespace dart 2296 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698