Enable hardware watchpoints on attach for aarch64
authorRichard Bunt <richard.bunt@arm.com>
Thu, 21 Jun 2018 13:09:34 +0000 (14:09 +0100)
committerRichard Bunt <richard.bunt@arm.com>
Thu, 21 Jun 2018 13:09:34 +0000 (14:09 +0100)
commit8363f9d5f2fab2c8b5a25c35c572f0426a716b66
treebb6b9abc3f6dc6ed668ec1301c95e2ea536a5559
parent57c0d77c2ce5e583dab322e05f8291bcbad0ccd3
Enable hardware watchpoints on attach for aarch64

This commit fixes a bug whereby hardware watchpoints are not used on
aarch64 when attaching to a target. The fix adds an aarch64 specialization
of post_attach which records the number of available hardware debug registers
using aarch64_linux_get_debug_reg_capacity. This implementation mirrors that
of aarch64_linux_child_post_startup_inferior which successfully enables the
use of hardware watchpoints when launching the target under the debugger.

gdb/ChangeLog:

* aarch64-linux-nat.c (post_attach): New.
(aarch64_linux_nat_target::post_attach): Override post_attach to
record the number of hardware debug registers.

gdb/testsuite/ChangeLog:

* gdb.base/watchpoint-hw-attach.c: New test.
* gdb.base/watchpoint-hw-attach.exp: New file.
gdb/ChangeLog
gdb/aarch64-linux-nat.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/watchpoint-hw-attach.c [new file with mode: 0644]
gdb/testsuite/gdb.base/watchpoint-hw-attach.exp [new file with mode: 0644]