Commit | Line | Data |
---|---|---|
b811d2c2 | 1 | # Copyright 2015-2020 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 waitpid syscall for reverse execution. | |
20 | # | |
01d3dedf PA |
21 | # Also serves as regression test for gdb/19187 (recording across a |
22 | # fork). | |
452b4ba5 MK |
23 | |
24 | if ![supports_reverse] { | |
25 | return | |
26 | } | |
27 | ||
28 | standard_testfile | |
29 | ||
5b362f04 | 30 | if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { |
452b4ba5 MK |
31 | return -1 |
32 | } | |
33 | ||
34 | runto main | |
35 | ||
36 | if [supports_process_record] { | |
37 | # Activate process record/replay | |
9f058c10 | 38 | gdb_test_no_output "record" "turn on process record" |
452b4ba5 MK |
39 | } |
40 | ||
452b4ba5 MK |
41 | gdb_test "break marker2" \ |
42 | "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \ | |
43 | "set breakpoint at marker2" | |
44 | ||
45 | gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*" | |
46 | ||
7ad8b86c MK |
47 | gdb_test "break marker1" \ |
48 | "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \ | |
49 | "set breakpoint at marker1" | |
50 | ||
452b4ba5 MK |
51 | gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1" |
52 | ||
53 | # If the variable was recorded properly on syscall, the old contents (-1) | |
54 | # will be remembered. If not, new contents (status) will be used, and | |
55 | # the test will fail. | |
56 | ||
57 | gdb_test "print status" ".* = -1" "check waitpid record" |