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
           
private static Log fine
           
private  long length
           
private  String name
           
private  int ptPeek
           
private  int ptPoke
           
static AddressSpace TEXT
           
static AddressSpace USR
           
 
Constructor Summary
AddressSpace(long length, String name, int ptPeek, int ptPoke)
           
 
Method Summary
private static AddressSpace data()
           
 long length()
           
private  int peek(int pid, long addr)
           
 int peek(ProcessIdentifier pid, long addr)
          Fetch a byte at ADDR of process PID.
private  void poke(int pid, long addr, int data)
           
 void poke(ProcessIdentifier pid, long addr, int data)
          Store the byte at ADDR of process PID.
private static AddressSpace text()
           
 String toString()
           
private  void transfer(int op, int pid, long addr, byte[] bytes, int offset, int length)
           
 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.
private static AddressSpace usr()
           
 
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

length

private final long length

name

private final String name

ptPeek

private final int ptPeek

ptPoke

private final int ptPoke

TEXT

public static final AddressSpace TEXT

DATA

public static final AddressSpace DATA

USR

public static final AddressSpace USR
Constructor Detail

AddressSpace

AddressSpace(long length,
             String name,
             int ptPeek,
             int ptPoke)
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.


peek

private int peek(int pid,
                 long addr)

poke

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


poke

private void poke(int pid,
                  long addr,
                  int data)

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.


transfer

private final void transfer(int op,
                            int pid,
                            long addr,
                            byte[] bytes,
                            int offset,
                            int length)

text

private static AddressSpace text()

data

private static AddressSpace data()

usr

private static AddressSpace usr()