This is the mail archive of the
frysk@sources.redhat.com
mailing list for the frysk project.
Outline Proposal: add getMaps() to abstract Proc.java
- From: Phil Muldoon <pmuldoon at redhat dot com>
- To: Frysk Hackers <frysk at sourceware dot org>
- Date: Mon, 14 May 2007 11:51:31 -0500
- Subject: Outline Proposal: add getMaps() to abstract Proc.java
This api will allow the direct access to map information via the
abstract class Proc. This api will provide the maps for the Proc instead
of the user constructing them manually via MapsBuilder for live
processes, and CorefileByteBuffer for core file processes. Maps would
not be stored in Proc as they are subject to change. This api would be
demand based only (not via refresh).
Rough outline:
In Proc.java:
/**
* Return the Maps of the Proc.
*/
public int getMaps ()
{
Map[] maps = sendrecMaps();
return maps;
}
protected abstract Map[] sendrecMaps ();
in LinuxPtraceProc.java
protected Map[] sendrecMaps()
{
// Implement frysk.sys.proc.MapsBuilder here
}
in LinuxCoreFileProc.java
protected Map[] sendrecMaps()
{
return coreFileByteBuffer.getConstructedMaps()
}
in Maps.java
// Think of a different name for this class
public class Map
{
public long addressLow;
public long addressHigh;
public boolean permRead;
public boolean permWrite;
public boolean permExecute;
public boolean shared;
public long offset;
public int devMajor;
public int devMinor;
public int inode;
public int pathnameOffset;
public int pathnameLength;
public void Map(....)
{
// implement constructor setters here
............
............
}
}