305a519bbc95ac09d075d4cdf8d76f82756cc2a1
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / siginfo-addr.exp
1 # Copyright 2004-2016 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
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
24 if [target_info exists gdb,nosignals] {
25 verbose "Skipping siginfo-addr.exp because of nosignals."
26 continue
27 }
28
29 standard_testfile
30 if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
31 untested "Couldn't compile ${srcfile}.c"
32 return -1
33 }
34
35 gdb_test "display/i \$pc"
36
37 # Advance to main
38 if { ![runto_main] } then {
39 gdb_suppress_tests
40 }
41
42 # Run to the signal.
43 gdb_test "continue" ".*Program received signal SIGSEGV.*" "continue to signal"
44
45 gdb_breakpoint "pass"
46
47 # Check for correct si_addr.
48 gdb_test "continue" "Breakpoint .* pass .*" "correct si_addr"
This page took 0.030627 seconds and 3 git commands to generate.