xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/testsuite/gdb.python/py-evsignal.exp (revision 901e7e84758515fbf39dfc064cb0b45ab146d8b0)
1# Copyright (C) 2010-2020 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
16if {[target_info gdb_protocol] == "remote"
17    || [target_info gdb_protocol] == "extended-remote"} {
18    # RuntimeError: Could not find event thread
19    kfail "python/12966" "Signal Thread 3"
20    return -1
21}
22
23load_lib gdb-python.exp
24
25standard_testfile py-evthreads.c
26
27if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
28    return -1
29}
30clean_restart $testfile
31
32if { [skip_python_tests] } { continue }
33
34set pyfile [gdb_remote_download host ${srcdir}/${subdir}/py-events.py]
35gdb_test_no_output "source ${pyfile}" "load python file"
36
37gdb_test "test-events" "Event testers registered."
38gdb_test_no_output "set non-stop on"
39
40gdb_run_cmd
41gdb_test_multiple "" "signal Thread 3"  {
42    -re "event type: stop\r\nstop reason: signal\r\nstop signal: SIGUSR1\r\nthread num: 3\r\nevent type: stop\r\n.*$gdb_prompt $" {
43        pass "thread 3 was signaled"
44    }
45    -re "The target does not support running in non-stop mode"  {
46        unsupported "non-stop mode is unsupported"
47    }
48}
49