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

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

Issue 1157173005: Include 'fixedId' key when printing service ids (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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/vm/service/service.md ('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 "platform/globals.h" 5 #include "platform/globals.h"
6 6
7 #include "include/dart_debugger_api.h" 7 #include "include/dart_debugger_api.h"
8 #include "vm/dart_api_impl.h" 8 #include "vm/dart_api_impl.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/debugger.h" 10 #include "vm/debugger.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 "['objectId'], ['code/%" Px64"-%" Px "']]", 202 "['objectId'], ['code/%" Px64"-%" Px "']]",
203 compile_timestamp, 203 compile_timestamp,
204 entry); 204 entry);
205 Service::HandleIsolateMessage(isolate, service_msg); 205 Service::HandleIsolateMessage(isolate, service_msg);
206 handler.HandleNextMessage(); 206 handler.HandleNextMessage();
207 { 207 {
208 // Only perform a partial match. 208 // Only perform a partial match.
209 const intptr_t kBufferSize = 512; 209 const intptr_t kBufferSize = 512;
210 char buffer[kBufferSize]; 210 char buffer[kBufferSize];
211 OS::SNPrint(buffer, kBufferSize-1, 211 OS::SNPrint(buffer, kBufferSize-1,
212 "{\"type\":\"Code\",\"id\":\"code\\/%" Px64 "-%" Px "\",", 212 "{\"type\":\"Code\",\"fixedId\":true,"
213 "\"id\":\"code\\/%" Px64 "-%" Px "\",",
213 compile_timestamp, 214 compile_timestamp,
214 entry); 215 entry);
215 EXPECT_SUBSTRING(buffer, handler.msg()); 216 EXPECT_SUBSTRING(buffer, handler.msg());
216 } 217 }
217 218
218 // Request code object at compile_timestamp-code.EntryPoint() + 16 219 // Request code object at compile_timestamp-code.EntryPoint() + 16
219 // Expect this to fail because the address is not the entry point. 220 // Expect this to fail because the address is not the entry point.
220 uintptr_t address = entry + 16; 221 uintptr_t address = entry + 16;
221 service_msg = EvalF(lib, "[0, port, '0', 'getObject', " 222 service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
222 "['objectId'], ['code/%" Px64"-%" Px "']]", 223 "['objectId'], ['code/%" Px64"-%" Px "']]",
(...skipping 14 matching lines...) Expand all
237 handler.HandleNextMessage(); 238 handler.HandleNextMessage();
238 EXPECT_SUBSTRING("\"error\"", handler.msg()); 239 EXPECT_SUBSTRING("\"error\"", handler.msg());
239 240
240 // Request native code at address. Expect the null code object back. 241 // Request native code at address. Expect the null code object back.
241 address = last; 242 address = last;
242 service_msg = EvalF(lib, "[0, port, '0', 'getObject', " 243 service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
243 "['objectId'], ['code/native-%" Px "']]", 244 "['objectId'], ['code/native-%" Px "']]",
244 address); 245 address);
245 Service::HandleIsolateMessage(isolate, service_msg); 246 Service::HandleIsolateMessage(isolate, service_msg);
246 handler.HandleNextMessage(); 247 handler.HandleNextMessage();
247 EXPECT_SUBSTRING("{\"type\":\"null\",\"id\":\"objects\\/null\"," 248 EXPECT_SUBSTRING("{\"type\":\"null\",\"fixedId\":true,"
249 "\"id\":\"objects\\/null\","
248 "\"valueAsString\":\"null\"", 250 "\"valueAsString\":\"null\"",
249 handler.msg()); 251 handler.msg());
250 252
251 // Request malformed native code. 253 // Request malformed native code.
252 service_msg = EvalF(lib, "[0, port, '0', 'getObject', ['objectId'], " 254 service_msg = EvalF(lib, "[0, port, '0', 'getObject', ['objectId'], "
253 "['code/native%" Px "']]", 255 "['code/native%" Px "']]",
254 address); 256 address);
255 Service::HandleIsolateMessage(isolate, service_msg); 257 Service::HandleIsolateMessage(isolate, service_msg);
256 handler.HandleNextMessage(); 258 handler.HandleNextMessage();
257 EXPECT_SUBSTRING("\"error\"", handler.msg()); 259 EXPECT_SUBSTRING("\"error\"", handler.msg());
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 Eval(lib, "[0, port, '0', 'getCpuProfile', ['tags'], ['Bogus']]"); 624 Eval(lib, "[0, port, '0', 'getCpuProfile', ['tags'], ['Bogus']]");
623 Service::HandleIsolateMessage(isolate, service_msg); 625 Service::HandleIsolateMessage(isolate, service_msg);
624 handler.HandleNextMessage(); 626 handler.HandleNextMessage();
625 // Expect error. 627 // Expect error.
626 EXPECT_SUBSTRING("\"error\"", handler.msg()); 628 EXPECT_SUBSTRING("\"error\"", handler.msg());
627 } 629 }
628 630
629 #endif // !defined(TARGET_ARCH_ARM64) 631 #endif // !defined(TARGET_ARCH_ARM64)
630 632
631 } // namespace dart 633 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/service/service.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698