| 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 2142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 OS::SNPrint(buf, sizeof(buf), | 2158 OS::SNPrint(buf, sizeof(buf), |
| 2159 "[0, port, ['address', '%" Px "'], [], []]", addr); | 2159 "[0, port, ['address', '%" Px "'], [], []]", addr); |
| 2160 service_msg = Eval(lib, buf); | 2160 service_msg = Eval(lib, buf); |
| 2161 Service::HandleIsolateMessage(isolate, service_msg); | 2161 Service::HandleIsolateMessage(isolate, service_msg); |
| 2162 handler.HandleNextMessage(); | 2162 handler.HandleNextMessage(); |
| 2163 EXPECT_SUBSTRING("\"type\":\"@String\"", handler.msg()); | 2163 EXPECT_SUBSTRING("\"type\":\"String\"", handler.msg()); |
| 2164 EXPECT_SUBSTRING("foobar", handler.msg()); | 2164 EXPECT_SUBSTRING("foobar", handler.msg()); |
| 2165 } | 2165 } |
| 2166 // Expect null when no object is found. | 2166 // Expect null when no object is found. |
| 2167 service_msg = Eval(lib, "[0, port, ['address', '7'], [], []]"); | 2167 service_msg = Eval(lib, "[0, port, ['address', '7'], [], []]"); |
| 2168 Service::HandleIsolateMessage(isolate, service_msg); | 2168 Service::HandleIsolateMessage(isolate, service_msg); |
| 2169 handler.HandleNextMessage(); | 2169 handler.HandleNextMessage(); |
| 2170 // TODO(turnidge): Should this be a ServiceException instead? | 2170 // TODO(turnidge): Should this be a ServiceException instead? |
| 2171 EXPECT_STREQ("{\"type\":\"@null\",\"id\":\"objects\\/null\"," | 2171 EXPECT_SUBSTRING("{\"type\":\"null\",\"id\":\"objects\\/null\"," |
| 2172 "\"valueAsString\":\"null\"}", | 2172 "\"valueAsString\":\"null\"", |
| 2173 handler.msg()); | 2173 handler.msg()); |
| 2174 } | 2174 } |
| 2175 | 2175 |
| 2176 | 2176 |
| 2177 static const char* alpha_callback( | 2177 static const char* alpha_callback( |
| 2178 const char* name, | 2178 const char* name, |
| 2179 const char** arguments, | 2179 const char** arguments, |
| 2180 intptr_t num_arguments, | 2180 intptr_t num_arguments, |
| 2181 const char** option_keys, | 2181 const char** option_keys, |
| 2182 const char** option_values, | 2182 const char** option_values, |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2316 service_msg = Eval(lib, "[0, port, ['profile'], ['tags'], ['hidden']]"); | 2316 service_msg = Eval(lib, "[0, port, ['profile'], ['tags'], ['hidden']]"); |
| 2317 Service::HandleIsolateMessage(isolate, service_msg); | 2317 Service::HandleIsolateMessage(isolate, service_msg); |
| 2318 handler.HandleNextMessage(); | 2318 handler.HandleNextMessage(); |
| 2319 // Expect error. | 2319 // Expect error. |
| 2320 EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg()); | 2320 EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg()); |
| 2321 } | 2321 } |
| 2322 | 2322 |
| 2323 #endif // !defined(TARGET_ARCH_ARM64) | 2323 #endif // !defined(TARGET_ARCH_ARM64) |
| 2324 | 2324 |
| 2325 } // namespace dart | 2325 } // namespace dart |
| OLD | NEW |