Paul Brook wrote: >> 2) The current watchpoint code is not implemented correctly so it is not >> safe to improve it using the same system (IMHO it should not have been >> commited in its current state). A correct implementation should not >> delay the DEBUG exception. It should be implemented like the "normal" >> MMU exceptions. > > On most targets watchpoint traps occur after the instruction completes, so you > have to defer the DEBUG exception. > Normal MMU faults occur before the instruction completes. OK, that explains why it is not an immediately raised exception. Still, instead of changing the TB stop condition as you suggested, I would prefer to pay the price only on watchpoint hit. Any show stopper to reuse the pattern of tb_invalidate_phys_page_range (find pc, [invalidate TB?,] regenerate TB @PC with CF_SINGLE_INSN, resume execution)? Or is you suggestion simpler and not as costly as I assume? Jan