Bug 6648 - Get TaskObserver.Watch.updateHit() to distinguish between read and write hits
Summary: Get TaskObserver.Watch.updateHit() to distinguish between read and write hits
Status: NEW
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Phil Muldoon
Depends on:
Blocks: 1625 6633
  Show dependency treegraph
Reported: 2008-06-16 15:01 UTC by Teresa Thomas
Modified: 2008-06-17 11:59 UTC (History)
0 users

See Also:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Teresa Thomas 2008-06-16 15:01:18 UTC
Useful to display a better message in case of a read hit. The code currently
treats reads and writes identically but displaying something like:

(fhpd) Watchpoint hit: double_
  Value before hit = 1.2
  Value after  hit = 1.2

which has no real meaning in case of a read hit.
Comment 1 Phil Muldoon 2008-06-17 11:59:39 UTC
I investigated this a bit and this is what I came up with.

- When the user sets a read only watchpoint, they will know that the watchpoint
is triggering due to it being specific read only watchpoint. Writes to memory
will not trigger this watchpoint.

- When the user sets a read and write watchpoint it becomes a bit more
complicated. If the value changed, then obviously a write occurred. If the value
did not change then a read of that memory, or alternatively a write of the same
value at that memory occurred. However in the case of IA32 and X8664 there is no
method in hardware to determine if the watchpoint triggered due to a read, or
write of the same value. All that exists in hardware is a bit set in the debug
status register indicating that the watchpoint fired.  There is not enough
information present in the debug registers to make this determination.

A possible way to determine this would be to look at that the last instruction
that occurred when a watchpoint triggers. On IA32 and X8664 the watchpoint
triggers after the instruction that causes it to trigger completes. However this
invariably will change with different ISAs.

- w