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 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 const GrowableObjectArray& param_values = | 1050 const GrowableObjectArray& param_values = |
1051 GrowableObjectArray::Handle(GrowableObjectArray::New()); | 1051 GrowableObjectArray::Handle(GrowableObjectArray::New()); |
1052 String& name = String::Handle(); | 1052 String& name = String::Handle(); |
1053 Object& value = Instance::Handle(); | 1053 Object& value = Instance::Handle(); |
1054 intptr_t num_variables = desc_indices_.length(); | 1054 intptr_t num_variables = desc_indices_.length(); |
1055 for (intptr_t i = 0; i < num_variables; i++) { | 1055 for (intptr_t i = 0; i < num_variables; i++) { |
1056 TokenPosition ignore; | 1056 TokenPosition ignore; |
1057 VariableAt(i, &name, &ignore, &ignore, &value); | 1057 VariableAt(i, &name, &ignore, &ignore, &value); |
1058 if (!name.Equals(Symbols::This())) { | 1058 if (!name.Equals(Symbols::This())) { |
1059 if (IsPrivateVariableName(name)) { | 1059 if (IsPrivateVariableName(name)) { |
1060 name = String::IdentifierPrettyName(name); | 1060 name = String::ScrubName(name); |
1061 } | 1061 } |
1062 param_names.Add(name); | 1062 param_names.Add(name); |
1063 param_values.Add(value); | 1063 param_values.Add(value); |
1064 } | 1064 } |
1065 } | 1065 } |
1066 | 1066 |
1067 if (function().is_static()) { | 1067 if (function().is_static()) { |
1068 const Class& cls = Class::Handle(function().Owner()); | 1068 const Class& cls = Class::Handle(function().Owner()); |
1069 return cls.Evaluate(expr, | 1069 return cls.Evaluate(expr, |
1070 Array::Handle(Array::MakeArray(param_names)), | 1070 Array::Handle(Array::MakeArray(param_names)), |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 const int num_vars = NumLocalVariables(); | 1123 const int num_vars = NumLocalVariables(); |
1124 for (intptr_t v = 0; v < num_vars; v++) { | 1124 for (intptr_t v = 0; v < num_vars; v++) { |
1125 String& var_name = String::Handle(); | 1125 String& var_name = String::Handle(); |
1126 Instance& var_value = Instance::Handle(); | 1126 Instance& var_value = Instance::Handle(); |
1127 TokenPosition token_pos; | 1127 TokenPosition token_pos; |
1128 TokenPosition end_token_pos; | 1128 TokenPosition end_token_pos; |
1129 VariableAt(v, &var_name, &token_pos, &end_token_pos, &var_value); | 1129 VariableAt(v, &var_name, &token_pos, &end_token_pos, &var_value); |
1130 if (var_name.raw() != Symbols::AsyncOperation().raw()) { | 1130 if (var_name.raw() != Symbols::AsyncOperation().raw()) { |
1131 JSONObject jsvar(&jsvars); | 1131 JSONObject jsvar(&jsvars); |
1132 jsvar.AddProperty("type", "BoundVariable"); | 1132 jsvar.AddProperty("type", "BoundVariable"); |
1133 var_name = String::IdentifierPrettyName(var_name); | 1133 var_name = String::ScrubName(var_name); |
1134 jsvar.AddProperty("name", var_name.ToCString()); | 1134 jsvar.AddProperty("name", var_name.ToCString()); |
1135 jsvar.AddProperty("value", var_value, !full); | 1135 jsvar.AddProperty("value", var_value, !full); |
1136 // TODO(turnidge): Do we really want to provide this on every | 1136 // TODO(turnidge): Do we really want to provide this on every |
1137 // stack dump? Should be associated with the function object, I | 1137 // stack dump? Should be associated with the function object, I |
1138 // think, and not the stack frame. | 1138 // think, and not the stack frame. |
1139 jsvar.AddProperty("_tokenPos", token_pos); | 1139 jsvar.AddProperty("_tokenPos", token_pos); |
1140 jsvar.AddProperty("_endTokenPos", end_token_pos); | 1140 jsvar.AddProperty("_endTokenPos", end_token_pos); |
1141 } | 1141 } |
1142 } | 1142 } |
1143 } | 1143 } |
(...skipping 2200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3344 | 3344 |
3345 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 3345 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
3346 ASSERT(bpt->next() == NULL); | 3346 ASSERT(bpt->next() == NULL); |
3347 bpt->set_next(code_breakpoints_); | 3347 bpt->set_next(code_breakpoints_); |
3348 code_breakpoints_ = bpt; | 3348 code_breakpoints_ = bpt; |
3349 } | 3349 } |
3350 | 3350 |
3351 #endif // !PRODUCT | 3351 #endif // !PRODUCT |
3352 | 3352 |
3353 } // namespace dart | 3353 } // namespace dart |
OLD | NEW |