Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / inferior-died.exp
CommitLineData
88b9d363 1# Copyright 2012-2022 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
9addecb9
TT
16# Until "set follow-fork-mode" and "catch fork" are implemented on
17# other targets...
18#
3ca22649 19if { ![istarget "*-*-linux*"] } then {
9addecb9
TT
20 unsupported "inferior-died.exp"
21 continue
22}
23
24if { ![support_displaced_stepping] } {
25 unsupported "inferior-died.exp"
26 return -1
27}
28
f8b41b00 29standard_testfile .c
9addecb9 30
4e04f045 31if { [build_executable "failed to build" ${testfile} ${testfile}.c] } {
9addecb9
TT
32 return -1
33}
34
4e04f045
PA
35save_vars { GDBFLAGS } {
36 append GDBFLAGS " -ex \"set non-stop on\""
37 clean_restart ${binfile}
38}
39
9addecb9 40gdb_test_no_output "set detach-on-fork off"
9addecb9
TT
41
42if ![runto_main] {
43 return
44}
45
46set line [gdb_get_line_number "Break here"]
47gdb_breakpoint $srcfile:$line
48
49gdb_continue_to_breakpoint "breakpoint"
50
51gdb_test "inferior 2" "Switching to inferior 2.*"
35dc4a6b
JK
52
53# The inferior 1 exit may come unexpectedly in any moment.
54set test "continue"
55set seen 0
56gdb_test_multiple $test $test {
57 -re "($gdb_prompt |\\\[Inferior \[^\r\n\]* exited normally\\\])" {
58 incr seen
59 if {$seen < 3} {
60 exp_continue
61 }
62 pass $test
63 }
64}
65
66# Internal error may show up after all the messages above.
67gdb_test "p 1" " = 1"
This page took 1.18183 seconds and 4 git commands to generate.