frysk.isa.watchpoints
Class IA32WatchpointFunctions

java.lang.Object
  extended by frysk.isa.watchpoints.WatchpointFunctions
      extended by frysk.isa.watchpoints.IA32WatchpointFunctions

 class IA32WatchpointFunctions
extends WatchpointFunctions


Field Summary
 
Fields inherited from class frysk.isa.watchpoints.WatchpointFunctions
noOfWatchpoints, watchpointMaxLength, watchpointMinLength
 
Constructor Summary
IA32WatchpointFunctions()
           
 
Method Summary
 void deleteWatchpoint(Task task, int index)
          Deletes a watchpoint.
 boolean hasWatchpointTriggered(Task task, int index)
          Reads the Debug Status Register and checks if the breakpoint specified has fired.
protected  long readControlRegister(Task task)
          Reads the Debug control register.
protected  long readStatusRegister(Task task)
          Reads the Debug status register.
 Watchpoint readWatchpoint(Task task, int index)
          Reads a watchpoint.
 void resetWatchpoint(Task task, int index)
          Resets the appropriate bit in the debug status register after a watchpoint has triggered, thereby reseting it.
 void setWatchpoint(Task task, int index, long addr, int range, boolean writeOnly)
          Builds and sets a hardware watchpoint on a task.
private  boolean testBit(long register, int bitToTest)
           
 
Methods inherited from class frysk.isa.watchpoints.WatchpointFunctions
getAllWatchpoints, getWatchpointCount, getWatchpointMaxLength, getWatchpointMinLength
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IA32WatchpointFunctions

public IA32WatchpointFunctions()
Method Detail

setWatchpoint

public void setWatchpoint(Task task,
                          int index,
                          long addr,
                          int range,
                          boolean writeOnly)
Builds and sets a hardware watchpoint on a task.

Specified by:
setWatchpoint in class WatchpointFunctions
Parameters:
task - - task to set a watchpoint on.
index - - watchpoint number to write. Architecture dependent.
addr - - linear virtual address to watch.
range - - length of range to watch. Normally 1,2 or 4 bytes.
writeOnly - - When true, only trigger when address is written. False, trigger when address is read or written to.

readWatchpoint

public Watchpoint readWatchpoint(Task task,
                                 int index)
Reads a watchpoint. Takes a task, and an index.

Specified by:
readWatchpoint in class WatchpointFunctions
Parameters:
task - - task to read a watchpoint from.
index - - watchpoint number to read.
Returns:
Watchpoint - value of Watchpoint at register.

deleteWatchpoint

public final void deleteWatchpoint(Task task,
                                   int index)
Deletes a watchpoint. Takes a task, and an index.

Specified by:
deleteWatchpoint in class WatchpointFunctions
Parameters:
task - - task on which to delete a watchpoint.
index - - watchpoint number to delete.

hasWatchpointTriggered

public boolean hasWatchpointTriggered(Task task,
                                      int index)
Reads the Debug Status Register and checks if the breakpoint specified has fired.

Specified by:
hasWatchpointTriggered in class WatchpointFunctions
Parameters:
task - - task to read the debug control register from.
index - - Debug register to check

resetWatchpoint

public void resetWatchpoint(Task task,
                            int index)
Resets the appropriate bit in the debug status register after a watchpoint has triggered, thereby reseting it.

Specified by:
resetWatchpoint in class WatchpointFunctions
Parameters:
task - - task to read the debug control register from.
index - - Debug register to reset.

readControlRegister

protected long readControlRegister(Task task)
Reads the Debug control register.

Specified by:
readControlRegister in class WatchpointFunctions
Parameters:
task - - task to read the debug control register from.

readStatusRegister

protected long readStatusRegister(Task task)
Reads the Debug status register.

Specified by:
readStatusRegister in class WatchpointFunctions
Parameters:
task - - task to read the debug status register from.

testBit

private boolean testBit(long register,
                        int bitToTest)