]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.base/pr11022.exp
Automatic Copyright Year update after running gdb/copyright.py
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / pr11022.exp
CommitLineData
4a94e368 1# Copyright 2009-2022 Free Software Foundation, Inc.
1f3b5d1b
PP
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
b800ec70
UW
16if {[skip_hw_watchpoint_tests]} {
17 return 0
1f3b5d1b
PP
18}
19
822bd149
TT
20standard_testfile .c
21
1f3b5d1b 22if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
84c93cd5 23 untested "failed to compile"
1f3b5d1b
PP
24 return -1
25}
26
27# Start with a fresh gdb.
28
822bd149 29clean_restart ${binfile}
1f3b5d1b
PP
30
31if ![runto_main] then {
1f3b5d1b
PP
32 return 0
33}
34
35gdb_test "break [gdb_get_line_number "break here"]" \
36 ".*Breakpoint.* at .*" \
37 "set breakpoint"
38
39gdb_test "watch x" ".*Hardware watchpoint.*" "set watchpoint"
40gdb_test "continue" ".*break here.*" "breakpoint hit"
41gdb_test "continue" ".*Hardware watchpoint.*Old value = 0.*New value = 42.*" \
42 "watchpoint hit"
43gdb_test "continue" ".*break here.*" "breakpoint hit 2"
27d3a1a2 44gdb_test_no_output "set var x = 1"
1f3b5d1b
PP
45gdb_test "continue" ".*Hardware watchpoint.*Old value = 1.*New value = 42.*" \
46 "watchpoint hit 2"