]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.base/inferior-died.exp
update copyright year range in GDB files
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / inferior-died.exp
CommitLineData
61baf725 1# Copyright 2012-2017 Free Software Foundation, Inc.
9addecb9
TT
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
16if { [is_remote target] || ![isnative] } then {
17 unsupported "inferior-died.exp"
18 continue
19}
20
21# Until "set follow-fork-mode" and "catch fork" are implemented on
22# other targets...
23#
3ca22649 24if { ![istarget "*-*-linux*"] } then {
9addecb9
TT
25 unsupported "inferior-died.exp"
26 continue
27}
28
29if { ![support_displaced_stepping] } {
30 unsupported "inferior-died.exp"
31 return -1
32}
33
f8b41b00 34standard_testfile .c
9addecb9 35
5b362f04 36if { [prepare_for_testing "failed to prepare" ${testfile} ${testfile}.c] } {
9addecb9
TT
37 return -1
38}
39
40gdb_test_no_output "set detach-on-fork off"
9addecb9
TT
41gdb_test_no_output "set non-stop on"
42
43if ![runto_main] {
44 return
45}
46
47set line [gdb_get_line_number "Break here"]
48gdb_breakpoint $srcfile:$line
49
50gdb_continue_to_breakpoint "breakpoint"
51
52gdb_test "inferior 2" "Switching to inferior 2.*"
35dc4a6b
JK
53
54# The inferior 1 exit may come unexpectedly in any moment.
55set test "continue"
56set seen 0
57gdb_test_multiple $test $test {
58 -re "($gdb_prompt |\\\[Inferior \[^\r\n\]* exited normally\\\])" {
59 incr seen
60 if {$seen < 3} {
61 exp_continue
62 }
63 pass $test
64 }
65}
66
67# Internal error may show up after all the messages above.
68gdb_test "p 1" " = 1"