]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp
Update copyright year range in all GDB files.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.reverse / finish-reverse-bkpt.exp
CommitLineData
42a4f53d 1# Copyright 2008-2019 Free Software Foundation, Inc.
9da8c2a0
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.
17#
18# 'reverse-finish' used to have a bug where user breakpoints set at
19# the functions entry would be ignored. Make sure the bug doesn't
20# reappear.
21
d3895d7d 22if ![supports_reverse] {
9da8c2a0
PA
23 return
24}
25
7686c074 26standard_testfile finish-reverse.c
9da8c2a0 27
5b362f04 28if { [prepare_for_testing "failed to prepare" "$testfile" $srcfile] } {
9da8c2a0
PA
29 return -1
30}
31
32if ![runto_main] then {
bc6c7af4 33 fail "can't run to main"
9da8c2a0
PA
34 return 0
35}
36
d3895d7d 37if [supports_process_record] {
9da8c2a0 38 # Activate process record/replay
9f058c10 39 gdb_test_no_output "record" "turn on process record"
9da8c2a0
PA
40}
41
42set breakloc [gdb_get_line_number "VOID FUNC" "$srcfile"]
c8064e7e
YQ
43gdb_test "tbreak void_func" \
44 "Temporary breakpoint $decimal at .*$srcfile, line $breakloc\." \
9da8c2a0 45 "set breakpoint on void_func"
a80db015 46gdb_continue_to_breakpoint "void_func" ".*$srcfile:$breakloc.*"
9da8c2a0 47
c8064e7e
YQ
48# We stop at the brekapoint on void_func, but breakpoint on
49# *void_func will be set at the same place if function void_func doesn't
50# have prologue. One step forward to avoid this.
51gdb_test "si"
52
9da8c2a0
PA
53gdb_test "break \*void_func" \
54 "Breakpoint $decimal at .*" \
55 "set breakpoint at void_func's entry"
56
57gdb_test "reverse-finish" \
58 ".*Breakpoint .*, void_func.*" \
59 "reverse-finish from void_func trips breakpoint at entry"
60
61gdb_test "frame" "#0 void_func.*" "no spurious proceed after breakpoint stop"