frysk.sys.ptrace
Class AddressSpace

java.lang.Object
  extended by frysk.sys.ptrace.AddressSpace

public class AddressSpace
extends Object

A ptrace address space, that can be peeked or poked a "word" at a time.


Field Summary
static AddressSpace DATA
           
static AddressSpace TEXT
           
static AddressSpace USR
           
 
Method Summary
 long length()
           
 int peek(ProcessIdentifier pid, long addr)
          Fetch a byte at ADDR of process PID.
 void poke(ProcessIdentifier pid, long addr, int data)
          Store the byte at ADDR of process PID.
 String toString()
           
 void transfer(ProcessIdentifier pid, long addr, byte[] bytes, int offset, int length, boolean write)
          Transfer data between the local BYTES array and process PID.
 int transfer(ProcessIdentifier pid, long addr, long length, byte[] bytes, int offset, boolean write)
          Transfer data between the local BYTES array and process PID.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TEXT

public static final AddressSpace TEXT

DATA

public static final AddressSpace DATA

USR

public static final AddressSpace USR
Method Detail

toString

public String toString()
Overrides:
toString in class Object

length

public long length()

peek

public int peek(ProcessIdentifier pid,
                long addr)
Fetch a byte at ADDR of process PID.


poke

public void poke(ProcessIdentifier pid,
                 long addr,
                 int data)
Store the byte at ADDR of process PID.


transfer

public void transfer(ProcessIdentifier pid,
                     long addr,
                     byte[] bytes,
                     int offset,
                     int length,
                     boolean write)
Transfer data between the local BYTES array and process PID. Locally the data starts at OFFSET and goes for LENGTH bytes. This is a host oriented transfer; hence LENGTH, which must fall within the bounds of BYTES, is an int.


transfer

public int transfer(ProcessIdentifier pid,
                    long addr,
                    long length,
                    byte[] bytes,
                    int offset,
                    boolean write)
Transfer data between the local BYTES array and process PID. Up to LENGTH bytes are copied, starting at OFFSET in the BYTES array. The number of bytes actually transfered is returned. This is a target oriented transfer; hence LENGTH, as an address sized quantity, is a long and can be larger than the bounds of BYTES.