This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] gdb/riscv: expect h/w watchpoints to trigger before the memory is written
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Tue, 23 Oct 2018 06:49:33 -0400
- Subject: [binutils-gdb] gdb/riscv: expect h/w watchpoints to trigger before the memory is written
*** TEST RESULTS FOR COMMIT 5a77b1b49f49cc5cfdb30727d8fc1bf456cad429 ***
Author: Joel Brobecker <brobecker@adacore.com>
Branch: master
Commit: 5a77b1b49f49cc5cfdb30727d8fc1bf456cad429
gdb/riscv: expect h/w watchpoints to trigger before the memory is written
When using QEMU as a RISCV simulator, hardware watchpoint events are
reported to GDB before the target memory gets written. GDB currently
expects the event to be reported after it is written. As a result of
this mismatch, upon receiving the event, GDB sees that the target
memory region has not changed, and therefore decides to ignore the
event. It therefore resumes the program's execution with a continue,
which is the start of an infinite loop between QEMU repeatedly
reporting the same watchpoint event over and over, and GDB repeatedly
ignoring it.
This patch fixes the issue by telling GDB to expect the watchpoint
event to be reported ahead of the memory region being modified.
Upon receiving the event, GDB then single-steps the program before
checking the watched memory value.
gdb/ChangeLog:
* riscv-tdep.c (riscv_gdbarch_init): Set the gdbarch's
have_nonsteppable_watchpoint attribute to 1.
- Follow-Ups:
- Failures on RHEL-s390x-m64, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master
- Failures on Fedora-x86_64-native-gdbserver-m64, branch master
- Failures on Fedora-s390x-m64, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master
- Failures on Debian-s390x-native-extended-gdbserver-m64, branch master
- Failures on Fedora-x86_64-m32, branch master
- Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, branch master
- Failures on Debian-s390x-m64, branch master
- Failures on Ubuntu-Aarch64-native-gdbserver-m64, branch master
- Failures on Ubuntu-Aarch64-m64, branch master