We use the same way with you to handle the issue 2.
As to adding watchpoint to kernel, there will be another problem.
ASID in kernel is variable. Therefore, we cannot indicate which thread we
want to watch by ASID.
What we can do is setting G (global) bit to WatchHi Register and then all
threads accessing that address will cause the exception.
In the exception, it will filter the threads by PID to find out the thread
we are watching.
----- Original Message -----
From: "Nigel Stephens" <email@example.com>
To: "colin" <firstname.lastname@example.org>
Sent: Wednesday, March 29, 2006 10:08 PM
Subject: Re: Using hardware watchpoint for applications debugging
> colin wrote:.
> > 2. When an exception happens and we find that it's not touching the
> > address, we will discard it. However, exception will happen again
> > the former instruction will be re-executed when the exception is
> 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
> It would be best if you added watchpoint support to the kernel ptrace
> code: since that would make the watchpoints usable by GDB also.