OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "include/dart_debugger_api.h" | 5 #include "include/dart_debugger_api.h" |
| 6 #include "include/dart_mirrors_api.h" |
6 #include "platform/assert.h" | 7 #include "platform/assert.h" |
7 #include "vm/dart_api_impl.h" | 8 #include "vm/dart_api_impl.h" |
8 #include "vm/thread.h" | 9 #include "vm/thread.h" |
9 #include "vm/unit_test.h" | 10 #include "vm/unit_test.h" |
10 | 11 |
11 namespace dart { | 12 namespace dart { |
12 | 13 |
13 static bool breakpoint_hit = false; | 14 static bool breakpoint_hit = false; |
14 static int breakpoint_hit_counter = 0; | 15 static int breakpoint_hit_counter = 0; |
15 static Dart_Handle script_lib = NULL; | 16 static Dart_Handle script_lib = NULL; |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 EXPECT(equals || (Dart_IsNull(expected_elem) && skip_null_expects)); | 229 EXPECT(equals || (Dart_IsNull(expected_elem) && skip_null_expects)); |
229 } | 230 } |
230 } | 231 } |
231 | 232 |
232 | 233 |
233 static void VerifyStackFrame(Dart_ActivationFrame frame, | 234 static void VerifyStackFrame(Dart_ActivationFrame frame, |
234 const char* expected_name, | 235 const char* expected_name, |
235 Dart_Handle expected_locals, | 236 Dart_Handle expected_locals, |
236 bool skip_null_expects) { | 237 bool skip_null_expects) { |
237 Dart_Handle func_name; | 238 Dart_Handle func_name; |
| 239 Dart_Handle func; |
238 Dart_Handle res; | 240 Dart_Handle res; |
239 res = Dart_ActivationFrameInfo(frame, &func_name, NULL, NULL, NULL); | 241 res = Dart_ActivationFrameGetLocation(frame, &func_name, &func, NULL); |
240 EXPECT_TRUE(res); | 242 EXPECT_TRUE(res); |
241 EXPECT(Dart_IsString(func_name)); | 243 EXPECT(Dart_IsString(func_name)); |
242 const char* func_name_chars; | 244 const char* func_name_chars; |
243 Dart_StringToCString(func_name, &func_name_chars); | 245 Dart_StringToCString(func_name, &func_name_chars); |
244 if (expected_name != NULL) { | 246 if (expected_name != NULL) { |
245 EXPECT_SUBSTRING(expected_name, func_name_chars); | 247 EXPECT_SUBSTRING(expected_name, func_name_chars); |
246 } | 248 } |
| 249 EXPECT(Dart_IsFunction(func)); |
| 250 const char* func_name_chars_from_func_handle; |
| 251 Dart_StringToCString(Dart_FunctionName(func), |
| 252 &func_name_chars_from_func_handle); |
| 253 EXPECT_STREQ(func_name_chars, func_name_chars_from_func_handle); |
247 | 254 |
248 if (!Dart_IsNull(expected_locals)) { | 255 if (!Dart_IsNull(expected_locals)) { |
249 Dart_Handle locals = Dart_GetLocalVariables(frame); | 256 Dart_Handle locals = Dart_GetLocalVariables(frame); |
250 EXPECT_VALID(locals); | 257 EXPECT_VALID(locals); |
251 VerifyListEquals(expected_locals, locals, skip_null_expects); | 258 VerifyListEquals(expected_locals, locals, skip_null_expects); |
252 } | 259 } |
253 } | 260 } |
254 | 261 |
255 | 262 |
256 static void VerifyStackTrace(Dart_StackTrace trace, | 263 static void VerifyStackTrace(Dart_StackTrace trace, |
(...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1752 | 1759 |
1753 Dart_Handle list_type = Dart_InstanceGetType(list_access_test_obj); | 1760 Dart_Handle list_type = Dart_InstanceGetType(list_access_test_obj); |
1754 Dart_Handle super_type = Dart_GetSupertype(list_type); | 1761 Dart_Handle super_type = Dart_GetSupertype(list_type); |
1755 EXPECT(!Dart_IsError(super_type)); | 1762 EXPECT(!Dart_IsError(super_type)); |
1756 super_type = Dart_GetSupertype(super_type); | 1763 super_type = Dart_GetSupertype(super_type); |
1757 EXPECT(!Dart_IsError(super_type)); | 1764 EXPECT(!Dart_IsError(super_type)); |
1758 EXPECT(super_type == Dart_Null()); | 1765 EXPECT(super_type == Dart_Null()); |
1759 } | 1766 } |
1760 | 1767 |
1761 } // namespace dart | 1768 } // namespace dart |
OLD | NEW |