gdb requires watchpoints to fire after the write

Tim Newsome <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAGDihen6ipD2pv2QRonBQwjoYpwbu-doL0GPX6JRix=eED8XZQ@mail.gmail.com>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.