This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
gdb requires watchpoints to fire after the write
- From: Tim Newsome <tim at sifive dot com>
- To: gdb <gdb at sourceware dot org>
- Date: Tue, 28 Aug 2018 15:08:03 -0700
- Subject: gdb requires watchpoints to fire after the write
The RISC-V Debug Spec suggests that memory write triggers fire before the
access actually takes place. This allows a user to see what the value in
memory is before it's overwritten. This does not play nice with gdb's
watchpoint expectation, however. When a watchpoint is hit, gdb instantly
reads the memory that it fired on, and if it hasn't changed it silently
lets execution resume. Since on RISC-V the watchpoint fired before the
write actually took place, gdb will always miss the first write because
memory won't have changed yet.
Does that sound right? How should I fix this? With hardware breakpoint
functionality being generally all over the map, I can't imagine this hasn't
come up before.
Thank you,
Tim