]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp
2011-05-26 Pedro Alves <pedro@codesourcery.com>
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.reverse / finish-reverse-bkpt.exp
1 # Copyright 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
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
22 if ![target_info exists gdb,can_reverse] {
23 return
24 }
25
26 set testfile "finish-reverse-bkpt"
27 set srcfile finish-reverse.c
28
29 if { [prepare_for_testing $testfile.exp "$testfile" $srcfile] } {
30 return -1
31 }
32
33 if ![runto_main] then {
34 fail "Can't run to main"
35 return 0
36 }
37
38 if [target_info exists gdb,use_precord] {
39 # Activate process record/replay
40 gdb_test_no_output "record" "Turn on process record"
41 }
42
43 set breakloc [gdb_get_line_number "VOID FUNC" "$srcfile"]
44 gdb_test "break void_func" \
45 "Breakpoint $decimal at .*/$srcfile, line $breakloc\." \
46 "set breakpoint on void_func"
47 gdb_continue_to_breakpoint "void_func" ".*/$srcfile:$breakloc.*"
48
49 gdb_test "break \*void_func" \
50 "Breakpoint $decimal at .*" \
51 "set breakpoint at void_func's entry"
52
53 gdb_test "reverse-finish" \
54 ".*Breakpoint .*, void_func.*" \
55 "reverse-finish from void_func trips breakpoint at entry"
56
57 gdb_test "frame" "#0 void_func.*" "no spurious proceed after breakpoint stop"