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

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

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

Powered by Google App Engine
This is Rietveld 408576698