OLD | NEW |
1 # Copyright 2008-2012 Free Software Foundation, Inc. | 1 # Copyright 2008-2012 Free Software Foundation, Inc. |
2 | 2 |
3 # This program is free software; you can redistribute it and/or modify | 3 # This program is free software; you can redistribute it and/or modify |
4 # it under the terms of the GNU General Public License as published by | 4 # it under the terms of the GNU General Public License as published by |
5 # the Free Software Foundation; either version 3 of the License, or | 5 # the Free Software Foundation; either version 3 of the License, or |
6 # (at your option) any later version. | 6 # (at your option) any later version. |
7 # | 7 # |
8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
12 # | 12 # |
13 # You should have received a copy of the GNU General Public License | 13 # You should have received a copy of the GNU General Public License |
14 # along with this program. If not, see <http://www.gnu.org/licenses/>. */ | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
15 | 15 |
16 # This file is part of the GDB testsuite. It tests reverse stepping. | 16 # This file is part of the GDB testsuite. It tests reverse stepping. |
17 # Lots of code borrowed from "step-test.exp". | 17 # Lots of code borrowed from "step-test.exp". |
18 | 18 |
19 # | 19 # |
20 # reverse-next over a function call sets a step-resume breakpoint at | 20 # reverse-next over a function call sets a step-resume breakpoint at |
21 # callee's entry point, runs to it, and then does an extra single-step | 21 # callee's entry point, runs to it, and then does an extra single-step |
22 # to get at the callee's caller. Test that a user breakpoint set at | 22 # to get at the callee's caller. Test that a user breakpoint set at |
23 # the same location as the step-resume breakpoint isn't ignored. | 23 # the same location as the step-resume breakpoint isn't ignored. |
24 # | 24 # |
25 | 25 |
26 if ![supports_reverse] { | 26 if ![supports_reverse] { |
27 return | 27 return |
28 } | 28 } |
29 | 29 |
30 set testfile "next-reverse-bkpt-over-sr" | 30 standard_testfile step-reverse.c |
31 set srcfile step-reverse.c | |
32 | 31 |
33 if { [prepare_for_testing $testfile.exp $testfile $srcfile] } { | 32 if { [prepare_for_testing $testfile.exp $testfile $srcfile] } { |
34 return -1 | 33 return -1 |
35 } | 34 } |
36 | 35 |
37 if ![runto_main] then { | 36 if ![runto_main] then { |
38 fail "Can't run to main" | 37 fail "Can't run to main" |
39 return 0 | 38 return 0 |
40 } | 39 } |
41 | 40 |
42 if [supports_process_record] { | 41 if [supports_process_record] { |
43 # Activate process record/replay | 42 # Activate process record/replay |
44 gdb_test_no_output "record" "Turn on process record" | 43 gdb_test_no_output "record" "Turn on process record" |
45 } | 44 } |
46 | 45 |
47 set lineno [gdb_get_line_number "STEP INTO THIS CALL"] | 46 set lineno [gdb_get_line_number "STEP INTO THIS CALL"] |
48 gdb_test "advance $lineno" ".*STEP INTO THIS CALL.*" "get past callee call" | 47 gdb_test "advance $lineno" ".*STEP INTO THIS CALL.*" "get past callee call" |
49 | 48 |
50 gdb_test "b \*callee" "" "set breakpoint at callee's entry" | 49 gdb_test "b \*callee" "" "set breakpoint at callee's entry" |
51 | 50 |
52 gdb_test "reverse-next" \ | 51 gdb_test "reverse-next" \ |
53 "Breakpoint.*, callee.*ENTER CALLEE.*" \ | 52 "Breakpoint.*, callee.*ENTER CALLEE.*" \ |
54 "reverse-next over call trips user breakpoint at function entry" | 53 "reverse-next over call trips user breakpoint at function entry" |
55 | 54 |
56 gdb_test "up" \ | 55 gdb_test "up" \ |
57 ".*NEXT OVER THIS CALL.*" \ | 56 ".*NEXT OVER THIS CALL.*" \ |
58 "stopped at the right callee call" | 57 "stopped at the right callee call" |
OLD | NEW |