Bug 1629 - page based watchpoints
Summary: page based watchpoints
Status: NEW
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P3 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on: 1496
Blocks: 1582
  Show dependency treegraph
 
Reported: 2005-10-29 04:31 UTC by Andrew Cagney
Modified: 2006-11-28 16:50 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Cagney 2005-10-29 04:31:35 UTC
requires kernel support
Comment 1 Wu Zhou 2006-03-15 14:47:07 UTC
Andrew,

What is page based watchpoints mainly used for?  And how to implement that in
the kernel?  Go through some check statement at every page access attempts?  

When the number of this kind of watchpoints goes high, the performance might be
impacted.  Nevertheless, there won't be too much this kinds of watchpoints I
believe.
Comment 2 Andrew Cagney 2006-05-05 18:22:44 UTC
Whu,

The underlying problem is that a CPU's hardware watchpoint mechanism is a very
very limited resource.  Typically only 1-4 elements can be watched and that
limits things to just a few small variables.  Page based watchpoints, on the
other hand, do not have that limitation - arbitrary memory areas can be
monitored for accesses by disabling memory accesses on a page boundary.  Against
that is the need to juggle things when a page access does occure - the access
may not be to the protected variable; and that, as you note, adds additional
overhead.  However: at least the restriction of only 1-4 watchpoints is removed;
and it is more efficient than single-stepping all instructions looking for a
faulting access. 

The kernel requirement would be a mechanism for disabling|enabling access to
specific memory pages; possibly on a per thread basis.