Fix: Null pointer dereference in ldlex.l
[binutils-gdb.git] / gdb / testsuite / gdb.base / pr11022.exp
blobffafe2d32225adbed09a2003aa14209b78a02abd
1 # Copyright 2009-2023 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/>.
16 require allow_hw_watchpoint_tests
18 standard_testfile .c
20 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
21 untested "failed to compile"
22 return -1
25 # Start with a fresh gdb.
27 clean_restart ${binfile}
29 if {![runto_main]} {
30 return 0
33 gdb_test "break [gdb_get_line_number "break here"]" \
34 ".*Breakpoint.* at .*" \
35 "set breakpoint"
37 gdb_test "watch x" ".*Hardware watchpoint.*" "set watchpoint"
38 gdb_test "continue" ".*break here.*" "breakpoint hit"
39 gdb_test "continue" ".*Hardware watchpoint.*Old value = 0.*New value = 42.*" \
40 "watchpoint hit"
41 gdb_test "continue" ".*break here.*" "breakpoint hit 2"
42 gdb_test_no_output "set var x = 1"
43 gdb_test "continue" ".*Hardware watchpoint.*Old value = 1.*New value = 42.*" \
44 "watchpoint hit 2"