]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.base/siginfo-addr.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / siginfo-addr.exp
CommitLineData
213516ef 1# Copyright 2004-2023 Free Software Foundation, Inc.
c162e8c9
JM
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
17# The program siginfo-addr.c arranges for a signal handler registered
18# using sigaction's sa_sigaction / SA_SIGINFO to be called with
19# si_addr filled in.
20
21# This test confirms that the si_addr value is correct rather than
22# having been corrupted when GDB passed the signal on to the handler.
23
24if [target_info exists gdb,nosignals] {
25 verbose "Skipping siginfo-addr.exp because of nosignals."
cdd42066 26 return
c162e8c9
JM
27}
28
0ab77f5f 29standard_testfile
5b362f04 30if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
c162e8c9
JM
31 return -1
32}
33
c162e8c9
JM
34gdb_test "display/i \$pc"
35
36# Advance to main
65a33d75 37if {![runto_main]} {
c8ee3f04 38 return 0
c162e8c9
JM
39}
40
41# Run to the signal.
42gdb_test "continue" ".*Program received signal SIGSEGV.*" "continue to signal"
43
65566918
PA
44gdb_breakpoint "pass"
45
c162e8c9 46# Check for correct si_addr.
65566918 47gdb_test "continue" "Breakpoint .* pass .*" "correct si_addr"