S390: Restructure s390_push_dummy_call
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.reverse / break-reverse.exp
1 # Copyright 2008-2015 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. It tests reverse debugging
17 # with breakpoints.
18
19 if ![supports_reverse] {
20 return
21 }
22
23 standard_testfile
24
25 if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
26 return -1
27 }
28
29 set foo_location [gdb_get_line_number "break in foo" ]
30 set bar_location [gdb_get_line_number "break in bar" ]
31 set main_location [gdb_get_line_number "break in main"]
32 set end_location [gdb_get_line_number "end of main" ]
33
34 runto main
35
36 if [supports_process_record] {
37 # Activate process record/replay
38 gdb_test_no_output "record" "Turn on process record"
39 }
40
41 gdb_test "break foo" \
42 "Breakpoint $decimal at .* line $foo_location\." \
43 "set breakpoint on foo"
44
45 gdb_test "break bar" \
46 "Breakpoint $decimal at .* line $bar_location\." \
47 "set breakpoint on bar"
48
49 gdb_test "break $end_location" \
50 "Breakpoint $decimal at .* line $end_location\." \
51 set breakpoint at end of main"
52
53 gdb_continue_to_breakpoint "foo" ".*$srcfile:$foo_location.*"
54 gdb_continue_to_breakpoint "bar" ".*$srcfile:$bar_location.*"
55 gdb_continue_to_breakpoint "end" ".*$srcfile:$end_location.*"
56
57 gdb_test_no_output "set exec-direction reverse" "set reverse"
58
59 gdb_continue_to_breakpoint "bar backward" ".*$srcfile:$bar_location.*"
60 gdb_continue_to_breakpoint "foo backward" ".*$srcfile:$foo_location.*"
61
62 gdb_test_multiple "continue" "main backward" {
63 -re ".*Breakpoint $decimal,.*$srcfile:$main_location.*$gdb_prompt $" {
64 pass "main backward"
65 }
66 -re "No more reverse-execution history.* break in main .*$gdb_prompt $" {
67 pass "main backward"
68 }
69 }
70
71 gdb_test_no_output "set exec-direction forward" "set forward"
72
73 gdb_continue_to_breakpoint "foo" ".*$srcfile:$foo_location.*"
74 gdb_continue_to_breakpoint "bar" ".*$srcfile:$bar_location.*"
75
76 gdb_test_multiple "continue" "end of record log" {
77 -re ".*Breakpoint $decimal,.*$srcfile:$end_location.*$gdb_prompt $" {
78 pass "end of record log"
79 }
80 -re "No more reverse-execution history.* end of main .*$gdb_prompt $" {
81 pass "end of record log"
82 }
83 }
This page took 0.032596 seconds and 4 git commands to generate.