Update copyright year range in all GDB files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / valgrind-infcall.exp
CommitLineData
b811d2c2 1# Copyright 2012-2020 Free Software Foundation, Inc.
a14dd77e
JK
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
68b9ac18
TV
16load_lib valgrind.exp
17
a14dd77e
JK
18if [is_remote target] {
19 # The test always runs locally.
20 return 0
21}
22
62cef515
TT
23standard_testfile .c
24if {[build_executable $testfile.exp $testfile $srcfile {debug}] == -1} {
a14dd77e
JK
25 return -1
26}
27
68b9ac18 28if { [vgdb_start] == -1 } {
a14dd77e
JK
29 return -1
30}
a14dd77e
JK
31
32set continue_count 1
5888842d
JK
33set loop 1
34while {$loop && $continue_count < 100} {
a14dd77e
JK
35 set test "continue #$continue_count"
36 gdb_test_multiple "continue" "" {
37 -re "Invalid free\\(\\).*: main .*\r\n$gdb_prompt $" {
38 pass $test
5888842d 39 set loop 0
a14dd77e 40 }
0eae2cf4
EBM
41 -re "Remote connection closed.*\r\n$gdb_prompt $" {
42 fail "$test (remote connection closed)"
a09ae1c1 43 # Only if valgrind got stuck.
2c8c5d37 44 kill_wait_spawned_process $valgrind_spawn_id
0eae2cf4
EBM
45 return -1
46 }
5888842d
JK
47 -re "The program is not being run\\.\r\n$gdb_prompt $" {
48 fail "$test (valgrind vgdb has terminated)"
a09ae1c1 49 # Only if valgrind got stuck.
2c8c5d37 50 kill_wait_spawned_process $valgrind_spawn_id
5888842d
JK
51 return -1
52 }
a14dd77e
JK
53 -re "\r\n$gdb_prompt $" {
54 pass "$test (false warning)"
55 }
56 }
57 set continue_count [expr $continue_count + 1]
58}
59
60set test "p gdb_test_infcall ()"
61gdb_test_multiple $test $test {
62 -re "unhandled instruction bytes.*\r\n$gdb_prompt $" {
63 fail $test
64 }
65 -re "Continuing \\.\\.\\..*\r\n\\\$1 = 2\r\n$gdb_prompt $" {
66 pass $test
67 }
68}
6447023f 69
68b9ac18 70vgdb_stop
This page took 0.997705 seconds and 4 git commands to generate.