watchpoint-reuse-slot.exp: skip setting HW breakpoints on some address
authorYao Qi <yao.qi@linaro.org>
Fri, 13 Mar 2015 10:56:01 +0000 (10:56 +0000)
committerYao Qi <yao.qi@linaro.org>
Mon, 16 Mar 2015 17:27:02 +0000 (17:27 +0000)
commitca5fd19bfb2a41fae7696d67d1f4dce5d5a9053a
tree7d827ed4b24021a64d6bdad96494bc42bf74db6f
parent1b6c08316381961223fc3e1f9e3ba0547a53cce1
watchpoint-reuse-slot.exp: skip setting HW breakpoints on some address

We see some fails in watchpoint-reuse-slot.exp on aarch64-linux, because
it sets some HW breakpoint on some address doesn't meet the alignment
requirements by kernel, kernel will reject the
ptrace (PTRACE_SETHBPREGS) call, and some fails are caused, for example:

(gdb) PASS: gdb.base/watchpoint-reuse-slot.exp: always-inserted off: watch x hbreak: : width 1, iter 0: base + 0: delete $bpnum
hbreak *(buf.byte + 0 + 1)^M
Hardware assisted breakpoint 80 at 0x410a61^M
(gdb) PASS: gdb.base/watchpoint-reuse-slot.exp: always-inserted off: watch x hbreak: : width 1, iter 0: base + 1: hbreak *(buf.byte + 0 + 1)
stepi^M
Warning:^M
Cannot insert hardware breakpoint 80.^M
Could not insert hardware breakpoints:^M
You may have requested too many hardware breakpoints/watchpoints.^M
^M
(gdb) FAIL: gdb.base/watchpoint-reuse-slot.exp: always-inserted off: watch x hbreak: : width 1, iter 0: base + 1: stepi advanced

hbreak *(buf.byte + 0 + 1)^M
Hardware assisted breakpoint 440 at 0x410a61^M
Warning:^M
Cannot insert hardware breakpoint 440.^M
Could not insert hardware breakpoints:^M
You may have requested too many hardware breakpoints/watchpoints.^M
^M
(gdb) FAIL: gdb.base/watchpoint-reuse-slot.exp: always-inserted on: watch x hbreak: : width 1, iter 0: base + 1: hbreak *(buf.byte + 0 + 1)

This patch is to skip some tests by checking proc valid_addr_p.
We can handle other targets in valid_addr_p too.

gdb/testsuite:

2015-03-16  Yao Qi  <yao.qi@linaro.org>

* gdb.base/watchpoint-reuse-slot.exp (valid_addr_p): New proc.
(top level): Skip tests if valid_addr_p returns false for
$cmd1 or $cmd2.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
This page took 0.043918 seconds and 4 git commands to generate.