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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/symbols.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
===================================================================
--- runtime/vm/debugger.cc (revision 31677)
+++ runtime/vm/debugger.cc (working copy)
@@ -1806,21 +1806,27 @@
DictionaryIterator it(lib);
Object& entry = Object::Handle(isolate_);
Field& field = Field::Handle(isolate_);
- Class& cls = Class::Handle(isolate_);
String& field_name = String::Handle(isolate_);
Object& field_value = Object::Handle(isolate_);
while (it.HasNext()) {
entry = it.GetNext();
if (entry.IsField()) {
field ^= entry.raw();
- cls = field.owner();
ASSERT(field.is_static());
field_name = field.name();
if ((field_name.CharAt(0) == '_') && !include_private_fields) {
// Skip library-private field.
continue;
}
- field_value = GetStaticField(cls, field_name);
+ // If the field is not initialized yet, just report the value
+ // 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.
+ // since it may have side effects.
+ if ((field.value() == Object::sentinel().raw()) ||
+ (field.value() == Object::transition_sentinel().raw())) {
+ field_value = Symbols::Uninitialized().raw();
+ } else {
+ field_value = field.value();
+ }
if (!prefix.IsNull()) {
field_name = String::Concat(prefix, field_name);
}
« 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