]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.reverse / recvmsg-reverse.exp
CommitLineData
1d506c26 1# Copyright 2015-2024 Free Software Foundation, Inc.
452b4ba5
MK
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#
19# This test tests socketpair and recvmsg syscalls for reverse execution.
20#
21
5954db83 22require supports_reverse
452b4ba5
MK
23
24standard_testfile
25
5b362f04 26if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
452b4ba5
MK
27 return -1
28}
29
50441f0f 30runto_main
452b4ba5
MK
31
32if [supports_process_record] {
33 # Activate process record/replay
9f058c10 34 gdb_test_no_output "record" "turn on process record"
452b4ba5
MK
35}
36
452b4ba5
MK
37gdb_test "break marker2" \
38 "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
39 "set breakpoint at marker2"
40
41gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
42
7ad8b86c
MK
43gdb_test "break marker1" \
44 "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
45 "set breakpoint at marker1"
46
452b4ba5
MK
47gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
48
49# If the variables were recorded properly on syscall, the old contents will
50# be remembered. If not, new contents will be used, and the test will fail.
51
52# rdata should be "xxxx", not "cdab"
53gdb_test "print rdata" ".* = \"xxxx\"" "check recvmsg record - rdata"
54
55# rmsg.msg_flags should be zeros, not MSG_TRUNC | MSG_CTRUNC
4d421147
AB
56gdb_test "print rmsg.msg_flags" ".* = 0" \
57 "check recvmsg record - rmsg.msg_flags"
452b4ba5
MK
58
59# rmsg.msg_controllen should be sizeof rc, not actual size of control data
60# (7 bytes less)
4d421147
AB
61gdb_test "print rmsg.msg_controllen - sizeof rc" ".* = 0" \
62 "check recvmsg record - rmsg.msg_controllen"
452b4ba5
MK
63
64# rc should be zeros, not received cmsg
65gdb_test "print ((struct cmsghdr *)rc)->cmsg_len" ".* = 0" "check recvmsg record - cmsg"