]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/testsuite/ChangeLog
Fix TBI handling for watchpoints
authorLuis Machado <luis.machado@linaro.org>
Thu, 10 Dec 2020 19:51:20 +0000 (16:51 -0300)
committerLuis Machado <luis.machado@linaro.org>
Wed, 16 Dec 2020 13:05:56 +0000 (10:05 -0300)
commit19007d955670a183fdf79408301d403b43eb7db1
tree4792181fe8ae0bf0fb897646fe30ed98937e100e
parentc410035d37d8237c641155c4e51e7ccf53decb29
Fix TBI handling for watchpoints

When inserting hw watchpoints, we take care of masking off the top byte
of the address (and sign-extending it if needed).  This guarantees we won't
pass tagged addresses to the kernel via ptrace.

However, from the kernel documentation on tagged pointers...

"Non-zero tags are not preserved when delivering signals. This means that
signal handlers in applications making use of tags cannot rely on the tag
information for user virtual addresses being maintained for fields inside
siginfo_t.

One exception to this rule is for signals raised in response to watchpoint
debug exceptions, where the tag information will be preserved."

So the stopped data address after a hw watchpoint hit can be potentially
tagged, and we don't handle this in GDB at the moment.  This results in
GDB missing a hw watchpoint hit and attempting to step over an unsteppable
hw watchpoint, causing it to spin endlessly.

The following patch fixes this by adjusting the stopped data address and adds
some tests to expose the problem.

gdb/ChangeLog:

2020-12-16  Luis Machado  <luis.machado@linaro.org>

* aarch64-linux-nat.c
(aarch64_linux_nat_target::stopped_data_address): Handle the TBI.

gdbserver/ChangeLog:

2020-12-16  Luis Machado  <luis.machado@linaro.org>

* linux-aarch64-low.cc (address_significant): New function.
(aarch64_target::low_stopped_data_address): Handle the TBI.

gdb/testsuite/ChangeLog:

2020-12-16  Luis Machado  <luis.machado@linaro.org>

* gdb.arch/aarch64-tagged-pointer.c (main): Add a few more
pointer-based memory accesses.
* gdb.arch/aarch64-tagged-pointer.exp: Exercise additional
hw watchpoint cases.
gdb/ChangeLog
gdb/aarch64-linux-nat.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/aarch64-tagged-pointer.c
gdb/testsuite/gdb.arch/aarch64-tagged-pointer.exp
gdbserver/ChangeLog
gdbserver/linux-aarch64-low.cc