]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp
Update copyright year range in all GDB files.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.reverse / next-reverse-bkpt-over-sr.exp
CommitLineData
42a4f53d 1# Copyright 2008-2019 Free Software Foundation, Inc.
2c03e5be
PA
2
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
5# the Free Software Foundation; either version 3 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
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/>. */
15
16# This file is part of the GDB testsuite. It tests reverse stepping.
17# Lots of code borrowed from "step-test.exp".
18
19#
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
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.
24#
25
d3895d7d 26if ![supports_reverse] {
2c03e5be
PA
27 return
28}
29
7686c074 30standard_testfile step-reverse.c
2c03e5be 31
5b362f04 32if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
2c03e5be
PA
33 return -1
34}
35
36if ![runto_main] then {
bc6c7af4 37 fail "can't run to main"
2c03e5be
PA
38 return 0
39}
40
d3895d7d 41if [supports_process_record] {
2c03e5be 42 # Activate process record/replay
9f058c10 43 gdb_test_no_output "record" "turn on process record"
2c03e5be
PA
44}
45
46set lineno [gdb_get_line_number "STEP INTO THIS CALL"]
47gdb_test "advance $lineno" ".*STEP INTO THIS CALL.*" "get past callee call"
48
49gdb_test "b \*callee" "" "set breakpoint at callee's entry"
50
bde47561 51set bpnum [get_integer_valueof "\$bpnum" 0]
2c03e5be 52gdb_test "reverse-next" \
bde47561 53 "Breakpoint $bpnum, callee.*" \
2c03e5be
PA
54 "reverse-next over call trips user breakpoint at function entry"
55
56gdb_test "up" \
57 ".*NEXT OVER THIS CALL.*" \
58 "stopped at the right callee call"