colin wrote:. > 2. When an exception happens and we find that it's not touching the righ > address, we will discard it. However, exception will happen again because > the former instruction will be re-executed when the exception is finished. > > You'll need to single-step over the instruction which generated the unwanted watchpoint exception, with the watchpoint disabled. Then after handling the single step reenable the watchpoint and resume normal execution. It would be best if you added watchpoint support to the kernel ptrace code: since that would make the watchpoints usable by GDB also. Nigel