gdb: Add process record and replay support for s390.
[external/binutils.git] / gdb / testsuite / gdb.reverse / s390-mvcle.exp
1 # Copyright (C) 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 #
17 # This test tests s390 MVCLE opcode for reverse execution.
18 #
19
20 if ![supports_reverse] {
21     return
22 }
23
24 if { ! [istarget "s390*-*-*"] } {
25     verbose "Skipping s390 MVCLE instruction recording tests."
26     return
27 }
28
29 standard_testfile
30
31 if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
32     return -1
33 }
34
35 runto main
36
37 if [supports_process_record] {
38     # Activate process record/replay
39     gdb_test_no_output "record" "Turn on process record"
40 }
41
42 gdb_test "break marker1" \
43     "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
44     "set breakpoint at marker1"
45
46 gdb_test "break marker2" \
47     "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
48     "set breakpoint at marker2"
49
50 gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
51
52 gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
53
54 gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
55
56 # If the variable was recorded properly on syscall, the old contents (0)
57 # will be remembered.  If not, new contents ([abcdefghi]) will be used, and
58 # the test will fail.
59
60 gdb_test "print (int)dst\[0]" ".* = 0" "check MVCLE record 1"
61 gdb_test "print (int)dst\[0x100000]" ".* = 0" "check MVCLE record 2"
62 gdb_test "print (int)dst\[0xffffff]" ".* = 0" "check MVCLE record 3"
63