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

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

Issue 1835393002: Improve error message when attempting to evaluate against a VM-internal object (e.g., a Megamorphic… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « runtime/observatory/lib/src/elements/code_view.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/service.h" 5 #include "vm/service.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 #include "platform/globals.h" 9 #include "platform/globals.h"
10 10
(...skipping 2141 matching lines...) Expand 10 before | Expand all | Expand 10 after
2152 instance ^= obj.raw(); 2152 instance ^= obj.raw();
2153 const Object& result = 2153 const Object& result =
2154 Object::Handle(zone, instance.Evaluate(expr_str, 2154 Object::Handle(zone, instance.Evaluate(expr_str,
2155 Array::empty_array(), 2155 Array::empty_array(),
2156 Array::empty_array())); 2156 Array::empty_array()));
2157 result.PrintJSON(js, true); 2157 result.PrintJSON(js, true);
2158 return true; 2158 return true;
2159 } 2159 }
2160 js->PrintError(kInvalidParams, 2160 js->PrintError(kInvalidParams,
2161 "%s: invalid 'targetId' parameter: " 2161 "%s: invalid 'targetId' parameter: "
2162 "id '%s' does not correspond to a " 2162 "Cannot evaluate against a VM-internal object", js->method());
2163 "library, class, or instance", js->method(), target_id);
2164 return true; 2163 return true;
2165 } 2164 }
2166 2165
2167 2166
2168 static const MethodParameter* evaluate_in_frame_params[] = { 2167 static const MethodParameter* evaluate_in_frame_params[] = {
2169 RUNNABLE_ISOLATE_PARAMETER, 2168 RUNNABLE_ISOLATE_PARAMETER,
2170 new UIntParameter("frameIndex", true), 2169 new UIntParameter("frameIndex", true),
2171 new MethodParameter("expression", true), 2170 new MethodParameter("expression", true),
2172 NULL, 2171 NULL,
2173 }; 2172 };
(...skipping 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after
4108 if (strcmp(method_name, method.name) == 0) { 4107 if (strcmp(method_name, method.name) == 0) {
4109 return &method; 4108 return &method;
4110 } 4109 }
4111 } 4110 }
4112 return NULL; 4111 return NULL;
4113 } 4112 }
4114 4113
4115 #endif // !PRODUCT 4114 #endif // !PRODUCT
4116 4115
4117 } // namespace dart 4116 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/code_view.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698