]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.threads/killed-outside.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.threads / killed-outside.exp
CommitLineData
1d506c26 1# Copyright (C) 2020-2024 Free Software Foundation, Inc.
4778a5f8
TV
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 test-case tests that continuing an inferior that has been killed
17# using an external sigkill does not make gdb misbehave.
18
19standard_testfile
20
21if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
22 {pthreads debug}] == -1} {
23 return -1
24}
25
26if { ![runto "all_started"] } {
27 return -1
28}
29delete_breakpoints
30
31set testpid [get_valueof "" "pid" -1 "get pid of inferior"]
32if { $testpid == -1 } {
33 return -1
34}
35remote_exec target "kill -9 ${testpid}"
36
37# Give it some time to die.
38sleep 2
39
b245c595
TV
40set regs_msg "(Couldn't get registers|Unable to fetch general registers)"
41set no_such_process_msg "$regs_msg: No such process\."
4778a5f8
TV
42set killed_msg "Program terminated with signal SIGKILL, Killed\."
43set no_longer_exists_msg "The program no longer exists\."
44set not_being_run_msg "The program is not being run\."
45
46gdb_test_multiple "continue" "prompt after first continue" {
e69d64d2 47 -re "Continuing\.\r\n$no_such_process_msg\r\n$gdb_prompt " {
4778a5f8 48 pass $gdb_test_name
e69d64d2 49 # Saw $no_such_process_msg. The bug condition was triggered, go
4778a5f8
TV
50 # check for it.
51 gdb_test_multiple "" "messages" {
52 -re ".*$killed_msg.*$no_longer_exists_msg\r\n" {
53 pass $gdb_test_name
54 gdb_test "continue" $not_being_run_msg "second continue"
55 }
56 }
57 }
4ca40594
TV
58 -re -wrap ".*$killed_msg.*$no_longer_exists_msg" {
59 pass $gdb_test_name
60 }
4778a5f8 61}