]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.hp/gdb.base-hp/hwwatchbus.exp
run copyright.sh for 2011.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.hp / gdb.base-hp / hwwatchbus.exp
CommitLineData
7b6bb8da 1# Copyright (C) 1997, 1998, 2007, 2008, 2009, 2010, 2011
4c38e0a4 2# Free Software Foundation, Inc.
7be570e7
JM
3
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
e22f8b7c 6# the Free Software Foundation; either version 3 of the License, or
7be570e7 7# (at your option) any later version.
e22f8b7c 8#
7be570e7
JM
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
e22f8b7c 13#
7be570e7 14# You should have received a copy of the GNU General Public License
e22f8b7c 15# along with this program. If not, see <http://www.gnu.org/licenses/>. */
7be570e7 16
7be570e7
JM
17if $tracelevel then {
18 strace $tracelevel
19 }
20
7be570e7
JM
21
22if { [skip_hp_tests] } then { continue }
23
24if { ![istarget "hppa*-*-hpux11.*"] } {
25 verbose "HPUX h/w watch test ignored for non-hppa or pre-HP/UX-10.30 targets."
26 return 0
27}
28
29set testfile "hwwatchbus"
30set srcfile ${testfile}.c
31set binfile ${objdir}/${subdir}/${testfile}
32
33# build the first test case
34if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
b60f0898
JB
35 untested hwwatchbus.exp
36 return -1
7be570e7
JM
37}
38
39if [get_compiler_info ${binfile}] {
40 return -1
41}
42
43# Start with a fresh gdb
44
45gdb_exit
46remote_exec build "rm -f ${binfile}.bak"
47gdb_start
48gdb_reinitialize_dir $srcdir/$subdir
49gdb_load ${binfile}
50
51
52# We ought to be able to set a hardware watchpoint, step, and
db521deb 53# get a SIGBUS or SIGSEGV signal reported.
7be570e7
JM
54#
55if ![runto_main] then {
56 fail "can't run to main"
57 return 0
58}
59
60send_gdb "watch bogus_p\n"
61gdb_expect {
62 -re "Hardware watchpoint \[0-9\]*: bogus_p.*$gdb_prompt $"\
63 {pass "set h/w watchpoint"}
64 -re "$gdb_prompt $"\
65 {fail "set h/w watchpoint"}
66 timeout {fail "(timeout) set h/w watchpoint"}
67}
68
69send_gdb "step\n"
70gdb_expect {
db521deb
JL
71 -re "Program received signal (SIGBUS|SIGSEGV), (Bus error|Segmentation fault).* in main .*${srcfile}:8.*$gdb_prompt $"\
72 {pass "see real signal when h/w watchpoint set"}
7be570e7 73 -re "$gdb_prompt $"\
db521deb
JL
74 {fail "see real signal when h/w watchpoint set"}
75 timeout {fail "(timeout) see real signal when h/w watchpoint set"}
7be570e7
JM
76}
77
78remote_exec build "mv ${binfile} ${binfile}.bak"
79return 0