1 # Copyright 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
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.
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.
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/>.
17 if {[skip_hw_watchpoint_tests]} {
21 set testfile watchpoint-hw
22 set srcfile ${testfile}.c
23 set binfile ${objdir}/${subdir}/${testfile}
24 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
25 untested "Couldn't compile test program"
31 gdb_reinitialize_dir $srcdir/$subdir
34 # Create the watchpoint before the inferior gets started. Now the native CPU
35 # target is still not active and its `to_can_use_hw_breakpoint' is not
36 # installed, therefore only a software watchpoint gets created.
38 gdb_test "watch watchee" "atchpoint 1: watchee"
40 # `runto_main' or `runto main' would delete the watchpoint created above.
42 if { [gdb_start_cmd] < 0 } {
46 gdb_test "" "main .* at .*" "start"
48 # Check it is really a `hw'-watchpoint.
49 gdb_test "info watchpoints" "1 *hw watchpoint .* watchee"