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 "include/dart_mirrors_api.h" |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/dart_api_impl.h" | 8 #include "vm/dart_api_impl.h" |
9 #include "vm/lockers.h" | 9 #include "vm/lockers.h" |
10 #include "vm/unit_test.h" | 10 #include "vm/unit_test.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
264 | 264 |
265 | 265 |
266 static void VerifyStackTrace(Dart_StackTrace trace, | 266 static void VerifyStackTrace(Dart_StackTrace trace, |
267 const char* func_names[], | 267 const char* func_names[], |
268 Dart_Handle local_vars[], | 268 Dart_Handle local_vars[], |
269 int expected_frames, | 269 int expected_frames, |
270 bool skip_null_expects) { | 270 bool skip_null_expects) { |
271 intptr_t trace_len; | 271 intptr_t trace_len; |
272 Dart_Handle res = Dart_StackTraceLength(trace, &trace_len); | 272 Dart_Handle res = Dart_StackTraceLength(trace, &trace_len); |
273 EXPECT_TRUE(res); | 273 EXPECT_TRUE(res); |
274 uintptr_t last_frame_pointer = 0; | |
275 uintptr_t frame_pointer; | |
274 for (int i = 0; i < trace_len; i++) { | 276 for (int i = 0; i < trace_len; i++) { |
275 Dart_ActivationFrame frame; | 277 Dart_ActivationFrame frame; |
276 res = Dart_GetActivationFrame(trace, i, &frame); | 278 res = Dart_GetActivationFrame(trace, i, &frame); |
277 EXPECT_TRUE(res); | 279 EXPECT_TRUE(res); |
280 | |
281 res = Dart_ActivationFrameGetFramePointer(frame, &frame_pointer); | |
282 EXPECT_TRUE(res); | |
283 if (i > 0) { | |
284 EXPECT_GT(frame_pointer, last_frame_pointer); | |
hausner
2014/09/05 19:16:59
Maybe a one-line comment reminding us that we expe
Jacob
2014/09/05 20:12:25
done
| |
285 } | |
286 last_frame_pointer = frame_pointer; | |
278 if (i < expected_frames) { | 287 if (i < expected_frames) { |
279 VerifyStackFrame(frame, func_names[i], local_vars[i], skip_null_expects); | 288 VerifyStackFrame(frame, func_names[i], local_vars[i], skip_null_expects); |
280 } else { | 289 } else { |
281 VerifyStackFrame(frame, NULL, Dart_Null(), skip_null_expects); | 290 VerifyStackFrame(frame, NULL, Dart_Null(), skip_null_expects); |
282 } | 291 } |
283 } | 292 } |
284 } | 293 } |
285 | 294 |
286 | 295 |
287 // TODO(hausner): Convert this one remaining use of the legacy | 296 // TODO(hausner): Convert this one remaining use of the legacy |
(...skipping 2017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2305 " null, 3, 7, 1, 8, 6, 9, 10, 10, 11, 11, 13," | 2314 " null, 3, 7, 1, 8, 6, 9, 10, 10, 11, 11, 13," |
2306 " null, 4, 13, 3, 14, 10," | 2315 " null, 4, 13, 3, 14, 10," |
2307 " null, 5, 17, 5, 18, 9, 19, 12," | 2316 " null, 5, 17, 5, 18, 9, 19, 12," |
2308 " null, 6, 21, 1," | 2317 " null, 6, 21, 1," |
2309 " null, 8, 24, 1, 25, 5, 26, 6, 27, 8," | 2318 " null, 8, 24, 1, 25, 5, 26, 6, 27, 8," |
2310 " null, 9, 29, 1]", | 2319 " null, 9, 29, 1]", |
2311 tokens_cstr); | 2320 tokens_cstr); |
2312 } | 2321 } |
2313 | 2322 |
2314 } // namespace dart | 2323 } // namespace dart |
OLD | NEW |