A method is provided that allows a general set of watchpoints to be defined for
a computer system (a watchpoint is a memory address that triggers an interrupt
for debugging or tracing purposes). This is accomplished by modifying the system
page table for the memory page containing a watchpoint, such that a page fault
interrupt is triggered whenever said memory page is accessed (for example by marking
the page as not present). The paging mechanism of the computer system is then adapted,
so that responsive to a page fault interrupt, a determination is made as to whether
such interrupt has resulted from an access to the watchpoint, and if so, control
is passed to a watchpoint handler. Alternatively, if there is no watchpoint, normal
paging operations can be resumed if necessary.