Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: runtime/vm/debugger_api_impl_test.cc

Issue 1237203002: Insert debug step check at the beginning of a function. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_mirrors_api.h" 5 #include "include/dart_mirrors_api.h"
6 #include "include/dart_tools_api.h" 6 #include "include/dart_tools_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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 breakpoint_hit_counter = 0; 651 breakpoint_hit_counter = 0;
652 Dart_Handle retval = Invoke("main"); 652 Dart_Handle retval = Invoke("main");
653 EXPECT_VALID(retval); 653 EXPECT_VALID(retval);
654 EXPECT(Dart_IsInteger(retval)); 654 EXPECT(Dart_IsInteger(retval));
655 int64_t int_value = ToInt64(retval); 655 int64_t int_value = ToInt64(retval);
656 EXPECT_EQ(2, int_value); 656 EXPECT_EQ(2, int_value);
657 EXPECT(breakpoint_hit == true); 657 EXPECT(breakpoint_hit == true);
658 } 658 }
659 659
660 static const char* step_into_expected_bpts[] = { 660 static const char* step_into_expected_bpts[] = {
661 "main", 661 "main", // entry
662 "foo", 662 "main", // call foo
663 "f1", 663 "foo", // entry
664 "foo", 664 "foo", // call f1
665 "foo", 665 "f1", // entry
666 "X.kvmk", 666 "foo", // call initializer
667 "f2", 667 "foo", // call kvmk
668 "X.kvmk", 668 "X.kvmk", // entry
669 "X.kvmk", 669 "X.kvmk", // call
670 "foo", 670 "f2", // entry
671 "main" 671 "f2", // return
672 "X.kvmk", // call +
673 "X.kvmk", // return
674 "foo", // return
675 "main" // return
672 }; 676 };
673 677
674 void TestStepIntoHandler(Dart_IsolateId isolate_id, 678 void TestStepIntoHandler(Dart_IsolateId isolate_id,
675 intptr_t bp_id, 679 intptr_t bp_id,
676 const Dart_CodeLocation& location) { 680 const Dart_CodeLocation& location) {
677 Dart_StackTrace trace; 681 Dart_StackTrace trace;
678 Dart_GetStackTrace(&trace); 682 Dart_GetStackTrace(&trace);
679 const intptr_t expected_bpts_length = ARRAY_SIZE(step_into_expected_bpts); 683 const intptr_t expected_bpts_length = ARRAY_SIZE(step_into_expected_bpts);
680 intptr_t trace_len; 684 intptr_t trace_len;
681 Dart_Handle res = Dart_StackTraceLength(trace, &trace_len); 685 Dart_Handle res = Dart_StackTraceLength(trace, &trace_len);
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after
2309 " null, 3, 7, 1, 8, 6, 9, 10, 10, 11, 11, 13," 2313 " null, 3, 7, 1, 8, 6, 9, 10, 10, 11, 11, 13,"
2310 " null, 4, 13, 3, 14, 10," 2314 " null, 4, 13, 3, 14, 10,"
2311 " null, 5, 17, 5, 18, 9, 19, 12," 2315 " null, 5, 17, 5, 18, 9, 19, 12,"
2312 " null, 6, 21, 1," 2316 " null, 6, 21, 1,"
2313 " null, 8, 24, 1, 25, 5, 26, 6, 27, 8," 2317 " null, 8, 24, 1, 25, 5, 26, 6, 27, 8,"
2314 " null, 9, 29, 1]", 2318 " null, 9, 29, 1]",
2315 tokens_cstr); 2319 tokens_cstr);
2316 } 2320 }
2317 2321
2318 } // namespace dart 2322 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698