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

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

Issue 812123002: Add option to get only reference. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/service_test.cc » ('j') | 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 "platform/globals.h" 8 #include "platform/globals.h"
9 9
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 2339 matching lines...) Expand 10 before | Expand all | Expand 10 after
2350 2350
2351 2351
2352 static bool HandleAddress(Isolate* isolate, JSONStream* js) { 2352 static bool HandleAddress(Isolate* isolate, JSONStream* js) {
2353 uword addr = 0; 2353 uword addr = 0;
2354 if (js->num_arguments() != 2 || 2354 if (js->num_arguments() != 2 ||
2355 !GetUnsignedIntegerId(js->GetArgument(1), &addr, 16)) { 2355 !GetUnsignedIntegerId(js->GetArgument(1), &addr, 16)) {
2356 static const uword kExampleAddr = static_cast<uword>(kIntptrMax / 7); 2356 static const uword kExampleAddr = static_cast<uword>(kIntptrMax / 7);
2357 PrintError(js, "Must specify address: address/" Px ".", kExampleAddr); 2357 PrintError(js, "Must specify address: address/" Px ".", kExampleAddr);
2358 return true; 2358 return true;
2359 } 2359 }
2360 bool ref = js->HasOption("ref") && js->OptionIs("ref", "true");
2360 Object& object = Object::Handle(isolate); 2361 Object& object = Object::Handle(isolate);
2361 { 2362 {
2362 NoGCScope no_gc; 2363 NoGCScope no_gc;
2363 ContainsAddressVisitor visitor(isolate, addr); 2364 ContainsAddressVisitor visitor(isolate, addr);
2364 object = isolate->heap()->FindObject(&visitor); 2365 object = isolate->heap()->FindObject(&visitor);
2365 } 2366 }
2366 object.PrintJSON(js, false); 2367 object.PrintJSON(js, ref);
2367 return true; 2368 return true;
2368 } 2369 }
2369 2370
2370 2371
2371 static bool HandleMalformedJson(Isolate* isolate, JSONStream* js) { 2372 static bool HandleMalformedJson(Isolate* isolate, JSONStream* js) {
2372 JSONObject jsobj(js); 2373 JSONObject jsobj(js);
2373 jsobj.AddProperty("a", "a"); 2374 jsobj.AddProperty("a", "a");
2374 JSONObject jsobj1(js); 2375 JSONObject jsobj1(js);
2375 jsobj1.AddProperty("a", "a"); 2376 jsobj1.AddProperty("a", "a");
2376 JSONObject jsobj2(js); 2377 JSONObject jsobj2(js);
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
2779 while (current != NULL) { 2780 while (current != NULL) {
2780 if (strcmp(name, current->name()) == 0) { 2781 if (strcmp(name, current->name()) == 0) {
2781 return current; 2782 return current;
2782 } 2783 }
2783 current = current->next(); 2784 current = current->next();
2784 } 2785 }
2785 return NULL; 2786 return NULL;
2786 } 2787 }
2787 2788
2788 } // namespace dart 2789 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/service_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698