]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.base/valgrind-infcall.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / valgrind-infcall.exp
1 # Copyright 2012-2023 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 # Valgrind gdbserver requires gdb with xml support.
17 require gdb_skip_xml_test 0
18
19 load_lib valgrind.exp
20
21 if [is_remote target] {
22 # The test always runs locally.
23 return 0
24 }
25
26 standard_testfile .c
27 if {[build_executable $testfile.exp $testfile $srcfile {debug}] == -1} {
28 return -1
29 }
30
31 if { [vgdb_start] == -1 } {
32 return -1
33 }
34
35 set continue_count 1
36 set loop 1
37 while {$loop && $continue_count < 100} {
38 set test "continue #$continue_count"
39 gdb_test_multiple "continue" "" {
40 -re "Invalid free\\(\\).*: main .*\r\n$gdb_prompt $" {
41 pass $test
42 set loop 0
43 }
44 -re "Remote connection closed.*\r\n$gdb_prompt $" {
45 fail "$test (remote connection closed)"
46 # Only if valgrind got stuck.
47 kill_wait_spawned_process $valgrind_spawn_id
48 return -1
49 }
50 -re "The program is not being run\\.\r\n$gdb_prompt $" {
51 fail "$test (valgrind vgdb has terminated)"
52 # Only if valgrind got stuck.
53 kill_wait_spawned_process $valgrind_spawn_id
54 return -1
55 }
56 -re "\r\n$gdb_prompt $" {
57 pass "$test (false warning)"
58 }
59 }
60 set continue_count [expr $continue_count + 1]
61 }
62
63 set test "p gdb_test_infcall ()"
64 gdb_test_multiple $test $test {
65 -re "unhandled instruction bytes.*\r\n$gdb_prompt $" {
66 fail $test
67 }
68 -re "Continuing \\.\\.\\..*\r\n\\\$1 = 2\r\n$gdb_prompt $" {
69 pass $test
70 }
71 }
72
73 vgdb_stop