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 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 TokenPosition ignore; | 965 TokenPosition ignore; |
966 VariableAt(i, &var_name, &ignore, &ignore, &value); | 966 VariableAt(i, &var_name, &ignore, &ignore, &value); |
967 if (var_name.Equals(Symbols::This())) { | 967 if (var_name.Equals(Symbols::This())) { |
968 return value.raw(); | 968 return value.raw(); |
969 } | 969 } |
970 } | 970 } |
971 return Symbols::OptimizedOut().raw(); | 971 return Symbols::OptimizedOut().raw(); |
972 } | 972 } |
973 | 973 |
974 | 974 |
975 bool IsPrivateVariableName(const String& var_name) { | 975 static bool IsSyntheticVariableName(const String& var_name) { |
| 976 return (var_name.Length() >= 1) && (var_name.CharAt(0) == ':'); |
| 977 } |
| 978 |
| 979 |
| 980 static bool IsPrivateVariableName(const String& var_name) { |
976 return (var_name.Length() >= 1) && (var_name.CharAt(0) == '_'); | 981 return (var_name.Length() >= 1) && (var_name.CharAt(0) == '_'); |
977 } | 982 } |
978 | 983 |
979 | 984 |
980 RawObject* ActivationFrame::Evaluate(const String& expr) { | 985 RawObject* ActivationFrame::Evaluate(const String& expr) { |
981 GetDescIndices(); | 986 GetDescIndices(); |
982 const GrowableObjectArray& param_names = | 987 const GrowableObjectArray& param_names = |
983 GrowableObjectArray::Handle(GrowableObjectArray::New()); | 988 GrowableObjectArray::Handle(GrowableObjectArray::New()); |
984 const GrowableObjectArray& param_values = | 989 const GrowableObjectArray& param_values = |
985 GrowableObjectArray::Handle(GrowableObjectArray::New()); | 990 GrowableObjectArray::Handle(GrowableObjectArray::New()); |
986 String& name = String::Handle(); | 991 String& name = String::Handle(); |
987 Object& value = Instance::Handle(); | 992 Object& value = Instance::Handle(); |
988 intptr_t num_variables = desc_indices_.length(); | 993 intptr_t num_variables = desc_indices_.length(); |
989 for (intptr_t i = 0; i < num_variables; i++) { | 994 for (intptr_t i = 0; i < num_variables; i++) { |
990 TokenPosition ignore; | 995 TokenPosition ignore; |
991 VariableAt(i, &name, &ignore, &ignore, &value); | 996 VariableAt(i, &name, &ignore, &ignore, &value); |
992 if (!name.Equals(Symbols::This())) { | 997 if (!name.Equals(Symbols::This()) && !IsSyntheticVariableName(name)) { |
993 if (IsPrivateVariableName(name)) { | 998 if (IsPrivateVariableName(name)) { |
994 name = String::ScrubName(name); | 999 name = String::ScrubName(name); |
995 } | 1000 } |
996 param_names.Add(name); | 1001 param_names.Add(name); |
997 param_values.Add(value); | 1002 param_values.Add(value); |
998 } | 1003 } |
999 } | 1004 } |
1000 | 1005 |
1001 if (function().is_static()) { | 1006 if (function().is_static()) { |
1002 const Class& cls = Class::Handle(function().Owner()); | 1007 const Class& cls = Class::Handle(function().Owner()); |
(...skipping 2314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3317 | 3322 |
3318 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 3323 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
3319 ASSERT(bpt->next() == NULL); | 3324 ASSERT(bpt->next() == NULL); |
3320 bpt->set_next(code_breakpoints_); | 3325 bpt->set_next(code_breakpoints_); |
3321 code_breakpoints_ = bpt; | 3326 code_breakpoints_ = bpt; |
3322 } | 3327 } |
3323 | 3328 |
3324 #endif // !PRODUCT | 3329 #endif // !PRODUCT |
3325 | 3330 |
3326 } // namespace dart | 3331 } // namespace dart |
OLD | NEW |