frysk.testbed
Class LocalMemory

java.lang.Object
  extended by frysk.testbed.LocalMemory

public class LocalMemory
extends Object

Provide access to known local areas of memory. Most useful by doing a fork to create a mirror image of the address space that can then be manipulated using ptrace calls.


Nested Class Summary
static interface LocalMemory.StackBuilder
          Callback or builder describing the constructed stack.
 
Constructor Summary
LocalMemory()
           
 
Method Summary
static void constructStack(LocalMemory.StackBuilder builder)
          Allocate a bit of stack, with known content, and pass it back to the client.
static long getCodeAddr()
          Returns the address of a function.
static byte[] getCodeBytes()
           
static String getCodeFile()
          Returns the file-name of a function.
static int getCodeLine()
          Returns the line number of a function.
static String getCodeName()
          Returns the name of the code function.
static long getDataAddr()
          Returns the address of a bunch of data.
static byte[] getDataBytes()
          Returns a copy of SIZE data bytes starting at getDataAddr.
static String getModuleName()
          Return the basename of the shared library or executable that contains the LocalMemory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalMemory

public LocalMemory()
Method Detail

getModuleName

public static String getModuleName()
Return the basename of the shared library or executable that contains the LocalMemory.


getDataAddr

public static long getDataAddr()
Returns the address of a bunch of data.


getDataBytes

public static byte[] getDataBytes()
Returns a copy of SIZE data bytes starting at getDataAddr.


getCodeName

public static String getCodeName()
Returns the name of the code function.


getCodeAddr

public static long getCodeAddr()
Returns the address of a function.


getCodeBytes

public static byte[] getCodeBytes()

getCodeLine

public static int getCodeLine()
Returns the line number of a function.


getCodeFile

public static String getCodeFile()
Returns the file-name of a function.


constructStack

public static void constructStack(LocalMemory.StackBuilder builder)
Allocate a bit of stack, with known content, and pass it back to the client. Since stack is in "high" memory, this provides an address in higher memory. For instance, on the i386, ADDR will be so large that it is negative.