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 2120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2131 ignore_breakpoints_ = saved_ignore_flag; | 2131 ignore_breakpoints_ = saved_ignore_flag; |
2132 return result.raw(); | 2132 return result.raw(); |
2133 } | 2133 } |
2134 | 2134 |
2135 | 2135 |
2136 RawObject* Debugger::GetStaticField(const Class& cls, | 2136 RawObject* Debugger::GetStaticField(const Class& cls, |
2137 const String& field_name) { | 2137 const String& field_name) { |
2138 const Field& fld = Field::Handle(cls.LookupStaticField(field_name)); | 2138 const Field& fld = Field::Handle(cls.LookupStaticField(field_name)); |
2139 if (!fld.IsNull()) { | 2139 if (!fld.IsNull()) { |
2140 // Return the value in the field if it has been initialized already. | 2140 // Return the value in the field if it has been initialized already. |
2141 const Instance& value = Instance::Handle(fld.value()); | 2141 const Instance& value = Instance::Handle(fld.StaticValue()); |
2142 ASSERT(value.raw() != Object::transition_sentinel().raw()); | 2142 ASSERT(value.raw() != Object::transition_sentinel().raw()); |
2143 if (value.raw() != Object::sentinel().raw()) { | 2143 if (value.raw() != Object::sentinel().raw()) { |
2144 return value.raw(); | 2144 return value.raw(); |
2145 } | 2145 } |
2146 } | 2146 } |
2147 // There is no field or the field has not been initialized yet. | 2147 // There is no field or the field has not been initialized yet. |
2148 // We must have a getter. Run the getter. | 2148 // We must have a getter. Run the getter. |
2149 const Function& getter_func = | 2149 const Function& getter_func = |
2150 Function::Handle(cls.LookupGetterFunction(field_name)); | 2150 Function::Handle(cls.LookupGetterFunction(field_name)); |
2151 ASSERT(!getter_func.IsNull()); | 2151 ASSERT(!getter_func.IsNull()); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2228 field ^= entry.raw(); | 2228 field ^= entry.raw(); |
2229 ASSERT(field.is_static()); | 2229 ASSERT(field.is_static()); |
2230 field_name = field.name(); | 2230 field_name = field.name(); |
2231 if ((field_name.CharAt(0) == '_') && !include_private_fields) { | 2231 if ((field_name.CharAt(0) == '_') && !include_private_fields) { |
2232 // Skip library-private field. | 2232 // Skip library-private field. |
2233 continue; | 2233 continue; |
2234 } | 2234 } |
2235 // If the field is not initialized yet, report the value to be | 2235 // If the field is not initialized yet, report the value to be |
2236 // "<not initialized>". We don't want to execute the implicit getter | 2236 // "<not initialized>". We don't want to execute the implicit getter |
2237 // since it may have side effects. | 2237 // since it may have side effects. |
2238 if ((field.value() == Object::sentinel().raw()) || | 2238 if ((field.StaticValue() == Object::sentinel().raw()) || |
2239 (field.value() == Object::transition_sentinel().raw())) { | 2239 (field.StaticValue() == Object::transition_sentinel().raw())) { |
2240 field_value = Symbols::NotInitialized().raw(); | 2240 field_value = Symbols::NotInitialized().raw(); |
2241 } else { | 2241 } else { |
2242 field_value = field.value(); | 2242 field_value = field.StaticValue(); |
2243 } | 2243 } |
2244 if (!prefix.IsNull()) { | 2244 if (!prefix.IsNull()) { |
2245 field_name = String::Concat(prefix, field_name); | 2245 field_name = String::Concat(prefix, field_name); |
2246 } | 2246 } |
2247 field_list.Add(field_name); | 2247 field_list.Add(field_name); |
2248 field_list.Add(field_value); | 2248 field_list.Add(field_value); |
2249 } | 2249 } |
2250 } | 2250 } |
2251 } | 2251 } |
2252 | 2252 |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3024 } | 3024 } |
3025 | 3025 |
3026 | 3026 |
3027 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 3027 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
3028 ASSERT(bpt->next() == NULL); | 3028 ASSERT(bpt->next() == NULL); |
3029 bpt->set_next(code_breakpoints_); | 3029 bpt->set_next(code_breakpoints_); |
3030 code_breakpoints_ = bpt; | 3030 code_breakpoints_ = bpt; |
3031 } | 3031 } |
3032 | 3032 |
3033 } // namespace dart | 3033 } // namespace dart |
OLD | NEW |