I'm trying to implement watchpoints management in my software but it doesn't
works. For a write watchpoint at 0x800000A4, GDB sets it (Z2) and then the
watchpoint triggers on my board (just before executing the asm instruction
which modifies the 0x800000A4 address), so I send back the answer
T05watch800000A4 to GDB before effectively writing to the 0x800000A4
address. Then GDB reads the system registers (G), reads at the 0x800000A4
address, unsets the watchpoint, reads at the 0x800000A4 address, re-sets the
watchpoint (at the same address) and make a continue. Then the watchpoint
triggers again immediately because the instruction modifying the 0x800000A4
address has not been executed before.
What is the problem with this GDB flow ? What can I do ?