frysk.proc.live
Class LinuxPtraceTask

java.lang.Object
  extended by frysk.proc.Task
      extended by frysk.proc.live.LiveTask
          extended by frysk.proc.live.LinuxPtraceTask

public class LinuxPtraceTask
extends LiveTask

A Linux Task tracked using PTRACE.


Nested Class Summary
 
Nested classes/interfaces inherited from class frysk.proc.Task
Task.TaskEventObservable
 
Field Summary
private  TaskObservable attachedObservers
          Set of Attached observers.
(package private)  Set blockers
          Set of interfaces currently blocking this task.
private  TaskObservable clonedObservers
          Set of Cloned observers.
(package private)  TaskObservable codeObservers
          Set of Code observers.
private  LinuxPtraceTask creator
           
private  ISA currentISA
           
private  TaskObservable execedObservers
          Set of Execed observers.
private static Log fine
           
private  TaskObservable forkedObservers
          Set of Forked observers.
(package private)  TaskObservable instructionObservers
          Set of Instruction observers.
(package private)  boolean justStartedXXX
          Whether we have just started the Task.
private  ByteBuffer memory
           
private  int modCount
           
private  LinuxPtraceTaskState newState
           
private  LinuxPtraceTaskState oldState
          The state of this task.
private  Register pcRegister
           
(package private)  LinkedList pendingObservations
          List containing the TaskObservations that are pending addition or deletion (in order that they were requested).
private  long ptraceOptions
           
private  RegisterBanks registerBanks
           
private  TaskObservable signaledObservers
          Set of Signaled observers.
(package private)  Signal sigSendXXX
          The signal, or zero, send last to the task.
 Breakpoint steppingBreakpoint
          Whether we are currently stepping over a breakpoint.
(package private)  TaskObservable syscallObservers
          Set of Syscall observers.
 boolean syscallSigretXXX
          When the last request to the process was a step request, whether it was a request to step a sigreturn syscall.
private  TaskObservable terminatedObservers
          Set of Terminated observers.
private  TaskObservable terminatingObservers
          Set of Terminating observers.
private  TaskObservable watchObservers
          Set of Watch observers.
 
Fields inherited from class frysk.proc.live.LiveTask
tid
 
Constructor Summary
LinuxPtraceTask(LinuxPtraceTask forkingTask, LinuxPtraceProc proc, TaskAttachedObserverXXX attached)
          Create a new attached main Task of Proc.
LinuxPtraceTask(LinuxPtraceTask cloningTask, ProcessIdentifier clone)
          Create a new attached clone of Task.
LinuxPtraceTask(Proc proc, ProcessIdentifier pid)
          Create a new unattached Task.
 
Method Summary
 Set bogusUseOfInternalBlockersVariableFIXME()
          XXX: Code using this needs a re-think.
protected  void clearIsa()
           
 ISA getISA()
          Return the Task's ISA.
 Isa getIsaFIXME()
          Return the Task's ISA.
 ByteBuffer getMemory()
          Return the Task's memory.
 int getMod()
          Use a counter rather than a boolean because multiple caches may depend on this count and no cache should be able to clear it.
 long getPC()
          Return the address of the instruction that this task will execute next.
(package private)  ByteBuffer getRawMemory()
          Return the raw memory byte-buffer.
protected  RegisterBanks getRegisterBanks()
          Return this task's register banks.
protected  LinuxPtraceTaskState getState()
          Return the current state.
protected  String getStateFIXME()
          Return the state as a string; do not use!!!!
(package private)  void handleAddObservation(TaskObservation observation)
          (Internal) Add the specified observer to the observable.
(package private)  void handleDeleteObservation(TaskObservation observation)
          (Internal) Delete the specified observer from the observable.
private  LinuxPtraceTaskState handleDisappearedEvent(Throwable arg)
           
(package private)  void handleUnblock(TaskObserver observer)
           
 void incrementMod()
           
(package private)  void initializeAttachedState()
           
 boolean isInstructionObserverAdded(TaskObserver.Instruction o)
          Returns true if the observer has been added to task's instruction observer list.
(package private)  int notifyAttached()
          Notify all Attached observers that this task attached.
(package private)  int notifyClonedOffspring()
          Notify all cloned observers that this task cloned.
(package private)  int notifyClonedParent(Task offspring)
          Notify all cloned observers that this task cloned.
(package private)  int notifyCodeBreakpoint(long address)
          Notify all Code observers of the breakpoint.
(package private)  int notifyExeced()
          Notify all Execed observers, of this Task's demise.
(package private)  int notifyForkedOffspring()
          Notify all Forked observers that this task's new offspring, created using fork, is sitting at the first instruction.
(package private)  int notifyForkedParent(Task offspring)
          Notify all Forked observers that this task forked.
(package private)  int notifyInstruction()
          Notify all Instruction observers.
(package private)  int notifySignaled(int sig)
          Notify all Signaled observers of the signal.
(package private)  int notifySyscallEnter()
          Notify all Syscall observers of this Task's entry into a system call.
(package private)  int notifySyscallExit()
          Notify all Syscall observers of this Task's exit from a system call.
(package private)  int notifyTerminated(boolean sig, int value)
          Notify all Terminated observers, of this Task's demise.
(package private)  int notifyTerminating(boolean sig, int value)
          Notify all Terminating observers, of this Task's demise.
(package private)  int notifyWatchpoint(long address, int length, boolean writeOnly)
          Notify all Watchpoint observers of the triggered watchpoint.
protected  LinuxPtraceTaskState oldState()
          Return the current state while at the same time marking that the state is in flux.
private  Register pcRegister()
           
(package private)  void performAttach()
          (Internal) Tell the task to attach itself (if it isn't already).
(package private)  void performContinue()
          (Internal) Requesting that the task go (or resume execution).
(package private)  void performDetach(boolean shouldRemoveObservers)
          (Internal) Tell the task to detach itself (if it isn't already).
(package private)  void performRemoval()
          (Internal) Tell the task to remove itself (it is no longer listed in the system process table and, presumably, has exited).
protected  void postDisappearedEvent(Throwable arg)
          Must inject disappeared events back into the event loop so that they can be processed in sequence.
(package private)  void processClonedEvent(LinuxPtraceTask clone)
          (internal) This task cloned creating the new Task cloneArg.
(package private)  void processDisappearedEvent(Throwable arg)
          (internal) The task has disappeared (due to an exit or some other error operation).
(package private)  void processExecedEvent()
          (internal) The task has execed, overlaying itself with another program.
(package private)  void processForkedEvent(LinuxPtraceTask fork)
          (internal) This Task forked creating an entirely new child process containing one (the fork) task.
(package private)  void processStoppedEvent(Signal signal)
          (internal) This task stopped with SIGNAL pending.
(package private)  void processSyscalledEvent()
          (internal) The task is performing a system call.
(package private)  void processTerminatedEvent(Signal signal, int value)
          (internal) The task has terminated; if SIGNAL is non-NULL the termination signal else STATUS contains the exit status.
(package private)  void processTerminatingEvent(Signal signal, int value)
          (internal) The task is in the process of terminating.
(package private)  void removeObservers()
          (Internal) Request that all observers from this task be removed.
 void requestAddAttachedObserver(TaskAttachedObserverXXX o)
          Add a TaskAttachedObserverXXX observer.
 void requestAddClonedObserver(TaskObserver.Cloned o)
          Add a TaskObserver.Cloned observer.
 void requestAddCodeObserver(TaskObserver.Code o, long a)
          Add TaskObserver.Code to the TaskObserver pool.
 void requestAddExecedObserver(TaskObserver.Execed o)
          Add TaskObserver.Execed to the TaskObserver pool.
 void requestAddForkedObserver(TaskObserver.Forked o)
          Add a TaskObserver.Forked observer.
 void requestAddInstructionObserver(TaskObserver.Instruction o)
          Request the addition of a Instruction observer that will be notified as soon as the task executes an instruction.
 void requestAddSignaledObserver(TaskObserver.Signaled o)
          Add TaskObserver.Signaled to the TaskObserver pool.
 void requestAddSyscallsObserver(TaskObserver.Syscalls o)
          Add TaskObserver.Syscalls to the TaskObserver pool.
 void requestAddTerminatedObserver(TaskObserver.Terminated o)
          Add a TaskObserver.Terminated observer.
 void requestAddTerminatingObserver(TaskObserver.Terminating o)
          Add TaskObserver.Terminating to the TaskObserver pool.
 void requestAddWatchObserver(TaskObserver.Watch o, long address, int length, boolean writeOnly)
          Add a TaskObserver.Watch observer (hardware data breakpoint only)
 void requestDeleteAttachedObserver(TaskAttachedObserverXXX o)
          Delete a TaskAttachedObserverXXX observer.
 void requestDeleteClonedObserver(TaskObserver.Cloned o)
          Delete a TaskObserver.Cloned observer.
 void requestDeleteCodeObserver(TaskObserver.Code o, long a)
          Delete TaskObserver.Code for the TaskObserver pool.
 void requestDeleteExecedObserver(TaskObserver.Execed o)
          Delete TaskObserver.Execed.
 void requestDeleteForkedObserver(TaskObserver.Forked o)
          Delete a TaskObserver.Forked observer.
 void requestDeleteInstructionObserver(TaskObserver.Instruction o)
          Delete TaskObserver.Instruction from the TaskObserver pool.
 void requestDeleteSignaledObserver(TaskObserver.Signaled o)
          Delete TaskObserver.Signaled.
 void requestDeleteSyscallsObserver(TaskObserver.Syscalls o)
          Delete TaskObserver.Syscall.
 void requestDeleteTerminatedObserver(TaskObserver.Terminated o)
          Delete a TaskObserver.Terminated observer.
 void requestDeleteTerminatingObserver(TaskObserver.Terminating o)
          Delete TaskObserver.Terminating.
 void requestDeleteWatchObserver(TaskObserver.Watch o, long address, int length, boolean writeOnly)
          Delete a TaskObserver.Watch observer (hardware data breakpoint only)
 void requestUnblock(TaskObserver observerArg)
          Request that the observer be removed from this tasks set of blockers; once there are no blocking observers, this task resumes.
 void sendAttach()
           
(package private)  void sendContinue(Signal sig)
           
(package private)  void sendDetach(Signal sig)
           
(package private)  void sendStepInstruction(Signal sig)
           
 void sendStop()
           
(package private)  void sendSyscallContinue(Signal sig)
           
 void setPC(long addr)
          Set the address of the instruction that this task will execute next.
(package private)  void startTracingSyscalls()
           
(package private)  void stopTracingSyscalls()
           
 
Methods inherited from class frysk.proc.Task
access, compareTo, getName, getProc, getRegister, getRegisterBuffersFIXME, getSignalTable, getSyscallTable, getTid, setRegister, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fine

private static final Log fine

creator

private final LinuxPtraceTask creator

memory

private ByteBuffer memory

registerBanks

private RegisterBanks registerBanks

currentISA

private ISA currentISA

ptraceOptions

private long ptraceOptions

oldState

private LinuxPtraceTaskState oldState
The state of this task. During a state transition newState is NULL.


newState

private LinuxPtraceTaskState newState

blockers

final Set blockers
Set of interfaces currently blocking this task. Package-private.


watchObservers

private final TaskObservable watchObservers
Set of Watch observers.


clonedObservers

private final TaskObservable clonedObservers
Set of Cloned observers.


attachedObservers

private final TaskObservable attachedObservers
Set of Attached observers. XXX: Should not be public.


forkedObservers

private final TaskObservable forkedObservers
Set of Forked observers.


terminatedObservers

private final TaskObservable terminatedObservers
Set of Terminated observers.


terminatingObservers

private final TaskObservable terminatingObservers
Set of Terminating observers.


execedObservers

private final TaskObservable execedObservers
Set of Execed observers.


syscallObservers

final TaskObservable syscallObservers
Set of Syscall observers. Checked in TaskState. FIXME: LinuxPtraceProc screws around with this; should be private.


signaledObservers

private final TaskObservable signaledObservers
Set of Signaled observers.


codeObservers

final TaskObservable codeObservers
Set of Code observers. FIXME: Should be private only LinuxPtraceTaskState grubs around with this variable.


instructionObservers

final TaskObservable instructionObservers
Set of Instruction observers. FIXME: LinuxPtraceProc and LinuxPtraceTaskState grub around with this; chould not be public.


pendingObservations

final LinkedList pendingObservations
List containing the TaskObservations that are pending addition or deletion (in order that they were requested). Will be dealt with as soon as a stop event is received during one of the running states.


justStartedXXX

boolean justStartedXXX
Whether we have just started the Task. Set in wantToAttachContinue.blockOrAttachContinue() and immediately reset in sendContinue() unless we request a step or Running.handleTrappedEvent() when the first step is received. XXX: This is a temporary hack to work around bug #4663. Needs to be merged with SteppingState (see step_send).


sigSendXXX

Signal sigSendXXX
The signal, or zero, send last to the task. XXX: This should be a state in Linux/PTRACE state machine.


syscallSigretXXX

public boolean syscallSigretXXX
When the last request to the process was a step request, whether it was a request to step a sigreturn syscall. Set by sendStepInstruction(). XXX: This should be a state in Linux/PTRACE state machine.


modCount

private int modCount

pcRegister

private Register pcRegister

steppingBreakpoint

public Breakpoint steppingBreakpoint
Whether we are currently stepping over a breakpoint. Used in the running task state when a trap event occurs after a step has been issued. Null when no step is being performed. XXX: This variable belongs in the Linux/PTRACE state machine.

Constructor Detail

LinuxPtraceTask

public LinuxPtraceTask(Proc proc,
                       ProcessIdentifier pid)
Create a new unattached Task.


LinuxPtraceTask

public LinuxPtraceTask(LinuxPtraceTask cloningTask,
                       ProcessIdentifier clone)
Create a new attached clone of Task.


LinuxPtraceTask

public LinuxPtraceTask(LinuxPtraceTask forkingTask,
                       LinuxPtraceProc proc,
                       TaskAttachedObserverXXX attached)
Create a new attached main Task of Proc.

Method Detail

getRawMemory

ByteBuffer getRawMemory()
Return the raw memory byte-buffer. This is the TEXT/DATA area.

Specified by:
getRawMemory in class LiveTask

getMemory

public ByteBuffer getMemory()
Return the Task's memory.

Specified by:
getMemory in class Task

getRegisterBanks

protected RegisterBanks getRegisterBanks()
Description copied from class: Task
Return this task's register banks.

Specified by:
getRegisterBanks in class Task

getISA

public ISA getISA()
Return the Task's ISA. Can this instead look at AUXV?

Specified by:
getISA in class Task

getIsaFIXME

public Isa getIsaFIXME()
Return the Task's ISA. XXX: This code locally, and not the IsaFactory, and definitly not via a PID should be determining the ISA of the process.


processClonedEvent

void processClonedEvent(LinuxPtraceTask clone)
(internal) This task cloned creating the new Task cloneArg.


processForkedEvent

void processForkedEvent(LinuxPtraceTask fork)
(internal) This Task forked creating an entirely new child process containing one (the fork) task.


processStoppedEvent

void processStoppedEvent(Signal signal)
(internal) This task stopped with SIGNAL pending.


processTerminatingEvent

void processTerminatingEvent(Signal signal,
                             int value)
(internal) The task is in the process of terminating. If SIGNAL is non-ZERO the terminating signal, else STATUS is the exit status.


processDisappearedEvent

void processDisappearedEvent(Throwable arg)
(internal) The task has disappeared (due to an exit or some other error operation).


handleDisappearedEvent

private LinuxPtraceTaskState handleDisappearedEvent(Throwable arg)

processSyscalledEvent

void processSyscalledEvent()
(internal) The task is performing a system call.


processTerminatedEvent

void processTerminatedEvent(Signal signal,
                            int value)
(internal) The task has terminated; if SIGNAL is non-NULL the termination signal else STATUS contains the exit status.


processExecedEvent

void processExecedEvent()
(internal) The task has execed, overlaying itself with another program.


postDisappearedEvent

protected void postDisappearedEvent(Throwable arg)
Must inject disappeared events back into the event loop so that they can be processed in sequence. Calling receiveDisappearedEvent directly would cause a recursive state transition.


sendContinue

void sendContinue(Signal sig)

sendSyscallContinue

void sendSyscallContinue(Signal sig)

sendStepInstruction

void sendStepInstruction(Signal sig)

sendStop

public void sendStop()

sendAttach

public void sendAttach()

sendDetach

void sendDetach(Signal sig)

initializeAttachedState

void initializeAttachedState()

startTracingSyscalls

void startTracingSyscalls()

stopTracingSyscalls

void stopTracingSyscalls()

getState

protected final LinuxPtraceTaskState getState()
Return the current state.


getStateFIXME

protected String getStateFIXME()
Description copied from class: Task
Return the state as a string; do not use!!!!

Specified by:
getStateFIXME in class Task

oldState

protected LinuxPtraceTaskState oldState()
Return the current state while at the same time marking that the state is in flux. If a second attempt to change state occurs before the current state transition has completed, barf. XXX: Bit of a hack, but at least this prevents state transition code attempting a second recursive state transition.


handleAddObservation

void handleAddObservation(TaskObservation observation)
(Internal) Add the specified observer to the observable.

Specified by:
handleAddObservation in class LiveTask

handleDeleteObservation

void handleDeleteObservation(TaskObservation observation)
(Internal) Delete the specified observer from the observable.

Specified by:
handleDeleteObservation in class LiveTask

handleUnblock

void handleUnblock(TaskObserver observer)

performContinue

void performContinue()
(Internal) Requesting that the task go (or resume execution).


performRemoval

void performRemoval()
(Internal) Tell the task to remove itself (it is no longer listed in the system process table and, presumably, has exited). XXX: Should not be public.


performAttach

void performAttach()
(Internal) Tell the task to attach itself (if it isn't already). Notify the containing process once the operation has been completed. The task is left in the stopped state. XXX: Should not be public.


performDetach

void performDetach(boolean shouldRemoveObservers)
(Internal) Tell the task to detach itself (if it isn't already). Notify the containing process once the operation has been processed; the task is allowed to run free.

Parameters:
shouldRemoveObservers - whether to remove the observers as well.

requestUnblock

public void requestUnblock(TaskObserver observerArg)
Request that the observer be removed from this tasks set of blockers; once there are no blocking observers, this task resumes.

Specified by:
requestUnblock in class Task

bogusUseOfInternalBlockersVariableFIXME

public Set bogusUseOfInternalBlockersVariableFIXME()
Description copied from class: Task
XXX: Code using this needs a re-think.

Overrides:
bogusUseOfInternalBlockersVariableFIXME in class Task

notifyWatchpoint

int notifyWatchpoint(long address,
                     int length,
                     boolean writeOnly)
Notify all Watchpoint observers of the triggered watchpoint. Return the number of blocking observers, or 0 if nothing blocks.


requestAddWatchObserver

public void requestAddWatchObserver(TaskObserver.Watch o,
                                    long address,
                                    int length,
                                    boolean writeOnly)
Add a TaskObserver.Watch observer (hardware data breakpoint only)

Specified by:
requestAddWatchObserver in class Task

requestDeleteWatchObserver

public void requestDeleteWatchObserver(TaskObserver.Watch o,
                                       long address,
                                       int length,
                                       boolean writeOnly)
Delete a TaskObserver.Watch observer (hardware data breakpoint only)

Specified by:
requestDeleteWatchObserver in class Task

notifyClonedParent

int notifyClonedParent(Task offspring)
Notify all cloned observers that this task cloned. Return the number of blocking observers.


notifyClonedOffspring

int notifyClonedOffspring()
Notify all cloned observers that this task cloned. Return the number of blocking observers.


requestAddClonedObserver

public void requestAddClonedObserver(TaskObserver.Cloned o)
Add a TaskObserver.Cloned observer.

Specified by:
requestAddClonedObserver in class Task

requestDeleteClonedObserver

public void requestDeleteClonedObserver(TaskObserver.Cloned o)
Delete a TaskObserver.Cloned observer.

Specified by:
requestDeleteClonedObserver in class Task

notifyAttached

int notifyAttached()
Notify all Attached observers that this task attached. Return the number of blocking observers.


requestAddAttachedObserver

public void requestAddAttachedObserver(TaskAttachedObserverXXX o)
Add a TaskAttachedObserverXXX observer.

Specified by:
requestAddAttachedObserver in class Task

requestDeleteAttachedObserver

public void requestDeleteAttachedObserver(TaskAttachedObserverXXX o)
Delete a TaskAttachedObserverXXX observer.

Specified by:
requestDeleteAttachedObserver in class Task

notifyForkedParent

int notifyForkedParent(Task offspring)
Notify all Forked observers that this task forked. Return the number of blocking observers.


notifyForkedOffspring

int notifyForkedOffspring()
Notify all Forked observers that this task's new offspring, created using fork, is sitting at the first instruction.


requestAddForkedObserver

public void requestAddForkedObserver(TaskObserver.Forked o)
Add a TaskObserver.Forked observer.

Specified by:
requestAddForkedObserver in class Task

requestDeleteForkedObserver

public void requestDeleteForkedObserver(TaskObserver.Forked o)
Delete a TaskObserver.Forked observer.

Specified by:
requestDeleteForkedObserver in class Task

notifyTerminated

int notifyTerminated(boolean sig,
                     int value)
Notify all Terminated observers, of this Task's demise. Return the number of blocking observers (does this make any sense?); or -1 if there were no observers.


requestAddTerminatedObserver

public void requestAddTerminatedObserver(TaskObserver.Terminated o)
Add a TaskObserver.Terminated observer.

Specified by:
requestAddTerminatedObserver in class Task

requestDeleteTerminatedObserver

public void requestDeleteTerminatedObserver(TaskObserver.Terminated o)
Delete a TaskObserver.Terminated observer.

Specified by:
requestDeleteTerminatedObserver in class Task

notifyTerminating

int notifyTerminating(boolean sig,
                      int value)
Notify all Terminating observers, of this Task's demise. Return the number of blocking observers; or -1 of there are no observers.


requestAddTerminatingObserver

public void requestAddTerminatingObserver(TaskObserver.Terminating o)
Add TaskObserver.Terminating to the TaskObserver pool.

Specified by:
requestAddTerminatingObserver in class Task

requestDeleteTerminatingObserver

public void requestDeleteTerminatingObserver(TaskObserver.Terminating o)
Delete TaskObserver.Terminating.

Specified by:
requestDeleteTerminatingObserver in class Task

notifyExeced

int notifyExeced()
Notify all Execed observers, of this Task's demise. Return the number of blocking observers.


requestAddExecedObserver

public void requestAddExecedObserver(TaskObserver.Execed o)
Add TaskObserver.Execed to the TaskObserver pool.

Specified by:
requestAddExecedObserver in class Task

requestDeleteExecedObserver

public void requestDeleteExecedObserver(TaskObserver.Execed o)
Delete TaskObserver.Execed.

Specified by:
requestDeleteExecedObserver in class Task

notifySyscallEnter

int notifySyscallEnter()
Notify all Syscall observers of this Task's entry into a system call. Return the number of blocking observers.


notifySyscallExit

int notifySyscallExit()
Notify all Syscall observers of this Task's exit from a system call. Return the number of blocking observers.


requestAddSyscallsObserver

public void requestAddSyscallsObserver(TaskObserver.Syscalls o)
Add TaskObserver.Syscalls to the TaskObserver pool.

Specified by:
requestAddSyscallsObserver in class Task

requestDeleteSyscallsObserver

public void requestDeleteSyscallsObserver(TaskObserver.Syscalls o)
Delete TaskObserver.Syscall.

Specified by:
requestDeleteSyscallsObserver in class Task

notifySignaled

int notifySignaled(int sig)
Notify all Signaled observers of the signal. Return the number of blocking observers; or -1 if there are no observers.


requestAddSignaledObserver

public void requestAddSignaledObserver(TaskObserver.Signaled o)
Add TaskObserver.Signaled to the TaskObserver pool.

Specified by:
requestAddSignaledObserver in class Task

requestDeleteSignaledObserver

public void requestDeleteSignaledObserver(TaskObserver.Signaled o)
Delete TaskObserver.Signaled.

Specified by:
requestDeleteSignaledObserver in class Task

notifyCodeBreakpoint

int notifyCodeBreakpoint(long address)
Notify all Code observers of the breakpoint. Return the number of blocking observers or -1 if no Code observer were installed on this address.


requestAddCodeObserver

public void requestAddCodeObserver(TaskObserver.Code o,
                                   long a)
Add TaskObserver.Code to the TaskObserver pool.

Specified by:
requestAddCodeObserver in class Task

requestDeleteCodeObserver

public void requestDeleteCodeObserver(TaskObserver.Code o,
                                      long a)
Delete TaskObserver.Code for the TaskObserver pool.

Specified by:
requestDeleteCodeObserver in class Task

notifyInstruction

int notifyInstruction()
Notify all Instruction observers. Returns the total number of blocking observers.


requestAddInstructionObserver

public void requestAddInstructionObserver(TaskObserver.Instruction o)
Request the addition of a Instruction observer that will be notified as soon as the task executes an instruction. o.updateExecuted is called as soon as the Task starts running again (is not blocked or stopped) and executes the next instruction.

Specified by:
requestAddInstructionObserver in class Task

requestDeleteInstructionObserver

public void requestDeleteInstructionObserver(TaskObserver.Instruction o)
Delete TaskObserver.Instruction from the TaskObserver pool.

Specified by:
requestDeleteInstructionObserver in class Task

isInstructionObserverAdded

public boolean isInstructionObserverAdded(TaskObserver.Instruction o)
Description copied from class: Task
Returns true if the observer has been added to task's instruction observer list.

Specified by:
isInstructionObserverAdded in class Task

removeObservers

void removeObservers()
(Internal) Request that all observers from this task be removed. Warning, should also be removed from the proc's observations.


incrementMod

public void incrementMod()

getMod

public int getMod()
Description copied from class: Task
Use a counter rather than a boolean because multiple caches may depend on this count and no cache should be able to clear it.

Specified by:
getMod in class Task

pcRegister

private Register pcRegister()

getPC

public long getPC()
Description copied from class: Task
Return the address of the instruction that this task will execute next.

Specified by:
getPC in class Task

setPC

public void setPC(long addr)
Description copied from class: Task
Set the address of the instruction that this task will execute next.

Specified by:
setPC in class Task

clearIsa

protected void clearIsa()
Overrides:
clearIsa in class Task