| OLD | NEW |
| 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 handler.HandleNextMessage(); | 238 handler.HandleNextMessage(); |
| 239 EXPECT_SUBSTRING("\"error\"", handler.msg()); | 239 EXPECT_SUBSTRING("\"error\"", handler.msg()); |
| 240 | 240 |
| 241 // Request native code at address. Expect the null code object back. | 241 // Request native code at address. Expect the null code object back. |
| 242 address = last; | 242 address = last; |
| 243 service_msg = EvalF(lib, "[0, port, '0', 'getObject', " | 243 service_msg = EvalF(lib, "[0, port, '0', 'getObject', " |
| 244 "['objectId'], ['code/native-%" Px "']]", | 244 "['objectId'], ['code/native-%" Px "']]", |
| 245 address); | 245 address); |
| 246 Service::HandleIsolateMessage(isolate, service_msg); | 246 Service::HandleIsolateMessage(isolate, service_msg); |
| 247 handler.HandleNextMessage(); | 247 handler.HandleNextMessage(); |
| 248 EXPECT_SUBSTRING("{\"type\":\"null\",\"fixedId\":true," | 248 // TODO(turnidge): It is pretty broken to return an Instance here. Fix. |
| 249 "\"id\":\"objects\\/null\"," | 249 EXPECT_SUBSTRING("\"kind\":\"Null\"", |
| 250 "\"valueAsString\":\"null\"", | |
| 251 handler.msg()); | 250 handler.msg()); |
| 252 | 251 |
| 253 // Request malformed native code. | 252 // Request malformed native code. |
| 254 service_msg = EvalF(lib, "[0, port, '0', 'getObject', ['objectId'], " | 253 service_msg = EvalF(lib, "[0, port, '0', 'getObject', ['objectId'], " |
| 255 "['code/native%" Px "']]", | 254 "['code/native%" Px "']]", |
| 256 address); | 255 address); |
| 257 Service::HandleIsolateMessage(isolate, service_msg); | 256 Service::HandleIsolateMessage(isolate, service_msg); |
| 258 handler.HandleNextMessage(); | 257 handler.HandleNextMessage(); |
| 259 EXPECT_SUBSTRING("\"error\"", handler.msg()); | 258 EXPECT_SUBSTRING("\"error\"", handler.msg()); |
| 260 } | 259 } |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 OS::SNPrint(buf, sizeof(buf), | 459 OS::SNPrint(buf, sizeof(buf), |
| 461 (ref | 460 (ref |
| 462 ? "[0, port, '0', '_getObjectByAddress', " | 461 ? "[0, port, '0', '_getObjectByAddress', " |
| 463 "['address', 'ref'], ['%" Px "', 'true']]" | 462 "['address', 'ref'], ['%" Px "', 'true']]" |
| 464 : "[0, port, '0', '_getObjectByAddress', " | 463 : "[0, port, '0', '_getObjectByAddress', " |
| 465 "['address'], ['%" Px "']]"), | 464 "['address'], ['%" Px "']]"), |
| 466 addr); | 465 addr); |
| 467 service_msg = Eval(lib, buf); | 466 service_msg = Eval(lib, buf); |
| 468 Service::HandleIsolateMessage(isolate, service_msg); | 467 Service::HandleIsolateMessage(isolate, service_msg); |
| 469 handler.HandleNextMessage(); | 468 handler.HandleNextMessage(); |
| 470 EXPECT_SUBSTRING(ref ? "\"type\":\"@String\"" : | 469 EXPECT_SUBSTRING(ref ? "\"type\":\"@Instance\"" : |
| 471 "\"type\":\"String\"", | 470 "\"type\":\"Instance\"", |
| 472 handler.msg()); | 471 handler.msg()); |
| 472 EXPECT_SUBSTRING("\"kind\":\"String\"", handler.msg()); |
| 473 EXPECT_SUBSTRING("foobar", handler.msg()); | 473 EXPECT_SUBSTRING("foobar", handler.msg()); |
| 474 } | 474 } |
| 475 // Expect null when no object is found. | 475 // Expect null when no object is found. |
| 476 service_msg = Eval(lib, "[0, port, '0', '_getObjectByAddress', " | 476 service_msg = Eval(lib, "[0, port, '0', '_getObjectByAddress', " |
| 477 "['address'], ['7']]"); | 477 "['address'], ['7']]"); |
| 478 Service::HandleIsolateMessage(isolate, service_msg); | 478 Service::HandleIsolateMessage(isolate, service_msg); |
| 479 handler.HandleNextMessage(); | 479 handler.HandleNextMessage(); |
| 480 // TODO(turnidge): Should this be a ServiceException instead? | 480 // TODO(turnidge): Should this be a ServiceException instead? |
| 481 EXPECT_SUBSTRING("{\"type\":\"Sentinel\",\"kind\":\"Free\"," | 481 EXPECT_SUBSTRING("{\"type\":\"Sentinel\",\"kind\":\"Free\"," |
| 482 "\"valueAsString\":\"<free>\"", | 482 "\"valueAsString\":\"<free>\"", |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 Eval(lib, "[0, port, '0', '_getCpuProfile', ['tags'], ['Bogus']]"); | 628 Eval(lib, "[0, port, '0', '_getCpuProfile', ['tags'], ['Bogus']]"); |
| 629 Service::HandleIsolateMessage(isolate, service_msg); | 629 Service::HandleIsolateMessage(isolate, service_msg); |
| 630 handler.HandleNextMessage(); | 630 handler.HandleNextMessage(); |
| 631 // Expect error. | 631 // Expect error. |
| 632 EXPECT_SUBSTRING("\"error\"", handler.msg()); | 632 EXPECT_SUBSTRING("\"error\"", handler.msg()); |
| 633 } | 633 } |
| 634 | 634 |
| 635 #endif // !defined(TARGET_ARCH_ARM64) | 635 #endif // !defined(TARGET_ARCH_ARM64) |
| 636 | 636 |
| 637 } // namespace dart | 637 } // namespace dart |
| OLD | NEW |