| 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 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2148 EXPECT_VALID(Dart_SetField(lib, NewString("port"), port)); | 2148 EXPECT_VALID(Dart_SetField(lib, NewString("port"), port)); |
| 2149 | 2149 |
| 2150 const String& str = String::Handle(String::New("foobar", Heap::kOld)); | 2150 const String& str = String::Handle(String::New("foobar", Heap::kOld)); |
| 2151 Array& service_msg = Array::Handle(); | 2151 Array& service_msg = Array::Handle(); |
| 2152 // Note: If we ever introduce old space compaction, this test might fail. | 2152 // Note: If we ever introduce old space compaction, this test might fail. |
| 2153 uword start_addr = RawObject::ToAddr(str.raw()); | 2153 uword start_addr = RawObject::ToAddr(str.raw()); |
| 2154 // Expect to find 'str', also from internal addresses. | 2154 // Expect to find 'str', also from internal addresses. |
| 2155 for (int offset = 0; offset < kObjectAlignment; ++offset) { | 2155 for (int offset = 0; offset < kObjectAlignment; ++offset) { |
| 2156 uword addr = start_addr + offset; | 2156 uword addr = start_addr + offset; |
| 2157 char buf[1024]; | 2157 char buf[1024]; |
| 2158 bool ref = offset % 2 == 0; |
| 2158 OS::SNPrint(buf, sizeof(buf), | 2159 OS::SNPrint(buf, sizeof(buf), |
| 2159 "[0, port, ['address', '%" Px "'], [], []]", addr); | 2160 ref ? "[0, port, ['address', '%" Px "'], ['ref'], ['true']]" : |
| 2161 "[0, port, ['address', '%" Px "', ], [], []]", |
| 2162 addr); |
| 2160 service_msg = Eval(lib, buf); | 2163 service_msg = Eval(lib, buf); |
| 2161 Service::HandleIsolateMessage(isolate, service_msg); | 2164 Service::HandleIsolateMessage(isolate, service_msg); |
| 2162 handler.HandleNextMessage(); | 2165 handler.HandleNextMessage(); |
| 2163 EXPECT_SUBSTRING("\"type\":\"String\"", handler.msg()); | 2166 EXPECT_SUBSTRING(ref ? "\"type\":\"@String\"" : |
| 2167 "\"type\":\"String\"", |
| 2168 handler.msg()); |
| 2164 EXPECT_SUBSTRING("foobar", handler.msg()); | 2169 EXPECT_SUBSTRING("foobar", handler.msg()); |
| 2165 } | 2170 } |
| 2166 // Expect null when no object is found. | 2171 // Expect null when no object is found. |
| 2167 service_msg = Eval(lib, "[0, port, ['address', '7'], [], []]"); | 2172 service_msg = Eval(lib, "[0, port, ['address', '7'], [], []]"); |
| 2168 Service::HandleIsolateMessage(isolate, service_msg); | 2173 Service::HandleIsolateMessage(isolate, service_msg); |
| 2169 handler.HandleNextMessage(); | 2174 handler.HandleNextMessage(); |
| 2170 // TODO(turnidge): Should this be a ServiceException instead? | 2175 // TODO(turnidge): Should this be a ServiceException instead? |
| 2171 EXPECT_SUBSTRING("{\"type\":\"null\",\"id\":\"objects\\/null\"," | 2176 EXPECT_SUBSTRING("{\"type\":\"null\",\"id\":\"objects\\/null\"," |
| 2172 "\"valueAsString\":\"null\"", | 2177 "\"valueAsString\":\"null\"", |
| 2173 handler.msg()); | 2178 handler.msg()); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2316 service_msg = Eval(lib, "[0, port, ['profile'], ['tags'], ['hidden']]"); | 2321 service_msg = Eval(lib, "[0, port, ['profile'], ['tags'], ['hidden']]"); |
| 2317 Service::HandleIsolateMessage(isolate, service_msg); | 2322 Service::HandleIsolateMessage(isolate, service_msg); |
| 2318 handler.HandleNextMessage(); | 2323 handler.HandleNextMessage(); |
| 2319 // Expect error. | 2324 // Expect error. |
| 2320 EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg()); | 2325 EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg()); |
| 2321 } | 2326 } |
| 2322 | 2327 |
| 2323 #endif // !defined(TARGET_ARCH_ARM64) | 2328 #endif // !defined(TARGET_ARCH_ARM64) |
| 2324 | 2329 |
| 2325 } // namespace dart | 2330 } // namespace dart |
| OLD | NEW |