frysk.sys.proc
Class MapsBuilder

java.lang.Object
  extended by frysk.sys.proc.MapsBuilder

public abstract class MapsBuilder
extends Object

The build the list of maps from the contents of the file /proc/PID/maps. While this isn't a pure builder pattern, it is close enough.


Method Summary
abstract  void buildBuffer(byte[] maps)
          Called with the raw byte buffer slurped by construct(int).
abstract  void buildMap(long addressLow, long addressHigh, boolean permRead, boolean permWrite, boolean permExecute, boolean shared, long offset, int devMajor, int devMinor, int inode, int pathnameOffset, int pathnameLength)
          Build an address map covering [addressLow,addressHigh) with permissions {permR, permW, permX, permP }, device devMajor devMinor, inode, and the pathname's offset/length within the buf.
 boolean construct(byte[] maps)
          Scan the maps MAPS byte array building corresponding map.
 boolean construct(ProcessIdentifier pid)
          Scan the maps file found in /proc/PID/auxv building up a list of memory maps.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

construct

public boolean construct(ProcessIdentifier pid)
Scan the maps file found in /proc/PID/auxv building up a list of memory maps. Return true if the scan was successful.


construct

public final boolean construct(byte[] maps)
Scan the maps MAPS byte array building corresponding map. It is assumed that the byte array contains ASCII characters, and includes a terminating NUL. buildMap(long, long, boolean, boolean, boolean, boolean, long, int, int, int, int, int) is called with each mapping.


buildBuffer

public abstract void buildBuffer(byte[] maps)
Called with the raw byte buffer slurped by construct(int).


buildMap

public abstract void buildMap(long addressLow,
                              long addressHigh,
                              boolean permRead,
                              boolean permWrite,
                              boolean permExecute,
                              boolean shared,
                              long offset,
                              int devMajor,
                              int devMinor,
                              int inode,
                              int pathnameOffset,
                              int pathnameLength)
Build an address map covering [addressLow,addressHigh) with permissions {permR, permW, permX, permP }, device devMajor devMinor, inode, and the pathname's offset/length within the buf. !shared implies private, they are mutually exclusive.