Fix: Null pointer dereference in ldlex.l
[binutils-gdb.git] / gdb / testsuite / gdb.base / watchpoint-hw.exp
blob13871912d093ee9e11fe49f977addd6364475590
1 # Copyright 2008-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 !use_gdb_stub
18 require allow_hw_watchpoint_tests
20 standard_testfile
22 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
23 return -1
26 # Create the watchpoint before the inferior gets started. Now the native CPU
27 # target is still not active and its `to_can_use_hw_breakpoint' is not
28 # installed, therefore only a software watchpoint gets created.
30 gdb_test "watch watchee" "atchpoint 1: watchee"
32 # `runto_main' or `runto main' would delete the watchpoint created above.
34 if { [gdb_start_cmd] < 0 } {
35 fail start
36 return -1
38 gdb_test "" "main .* at .*" "start"
40 # Check it is really a `hw'-watchpoint.
41 gdb_test "info watchpoints" "1 *hw watchpoint .* watchee"