symfile, vdso: remove target sections
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / hbreak-unmapped.exp
CommitLineData
076855f9
PA
1# Copyright 2014 Free Software Foundation, Inc.
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
16if {[skip_hw_breakpoint_tests]} {
17 return 0
18}
19
20standard_testfile
21
22if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
23 return -1
24}
25
26if ![runto_main] {
27 fail "Can't run to main"
28 return -1
29}
30
31delete_breakpoints
32
33# Test whether the target supports hardware breakpoints at all.
34
35set supports_hbreak 0
36set test "probe hardware breakpoint support"
37gdb_test_multiple "hbreak main" $test {
38 -re "No hardware breakpoint support in the target.*$gdb_prompt $" {
39 pass $test
40 }
41 -re "Hardware breakpoints used exceeds limit.*$gdb_prompt $" {
42 pass $test
43 }
44 -re "Hardware assisted breakpoint.*at.* file .*$srcfile, line.*$gdb_prompt $" {
45 set supports_hbreak 1
46 pass $test
47 }
48}
49
50if {!$supports_hbreak} {
51 unsupported "hardware breakpoints"
52 return
53}
54
55delete_breakpoints
56
57# Force immediate breakpoint insertion.
58gdb_test_no_output "set breakpoint always-inserted on"
59
60# Hardware breakpoints are implemented using a mechanism that is not
61# dependent on being able to modify the target's memory, we should be
62# able to set them even in unmapped memory areas.
63gdb_test "hbreak *0" "Hardware assisted breakpoint \[0-9\]+ at 0x0"
64
65gdb_test "info break" "hw breakpoint.*y.*0x0\+\[ \t\]\+" \
66 "info break shows hw breakpoint"
67
68gdb_test_no_output "delete \$bpnum" "" "delete" \
69 "delete hw breakpoint"
70
71gdb_test "info break" "No breakpoints or watchpoints\." \
72 "info break shows no breakpoints"
This page took 0.042295 seconds and 4 git commands to generate.