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

Unified Diff: runtime/vm/debugger.cc

Issue 1391953003: Fix evaluation in frames with _private variable names. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | « runtime/observatory/tests/service/evaluate_in_frame_rpc_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index 5e4dfd9d575c9aab0549c9309dc7182d2cc99e73..231ea4c61ae4714eaf36c36fa9e9a2d0e5ed3048 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -1028,6 +1028,11 @@ RawObject* ActivationFrame::GetReceiver() {
}
+bool IsPrivateVariableName(const String& var_name) {
rmacnak 2015/10/07 18:06:21 Library::IsPrivate already exists and handles more
+ return (var_name.Length() >= 1) && (var_name.CharAt(0) == '_');
+}
+
+
RawObject* ActivationFrame::Evaluate(const String& expr) {
GetDescIndices();
const GrowableObjectArray& param_names =
@@ -1041,6 +1046,9 @@ RawObject* ActivationFrame::Evaluate(const String& expr) {
intptr_t ignore;
VariableAt(i, &name, &ignore, &ignore, &value);
if (!name.Equals(Symbols::This())) {
+ if (IsPrivateVariableName(name)) {
+ name = String::IdentifierPrettyName(name);
+ }
param_names.Add(name);
param_values.Add(value);
}
« no previous file with comments | « runtime/observatory/tests/service/evaluate_in_frame_rpc_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698