public abstract class ProcAddressTable extends Object
FunctionAddressResolver
,
DynamicLookupHelper
Modifier and Type | Field and Description |
---|---|
protected static boolean |
DEBUG |
protected static String |
DEBUG_PREFIX |
protected static int |
debugNum |
static String |
PROCADDRESS_VAR_PREFIX |
Constructor and Description |
---|
ProcAddressTable() |
ProcAddressTable(FunctionAddressResolver resolver) |
Modifier and Type | Method and Description |
---|---|
protected Field |
fieldForFunction(String name) |
protected String |
fieldToFunctionName(String addressFieldName) |
long |
getAddressFor(String functionName)
This is a convenience method to get (by name) the native function
pointer for a given function.
|
protected static PrintStream |
getDebugOutStream() |
Set |
getNullPointerFunctions()
Returns all functions pointing to null.
|
void |
initEntry(String name,
DynamicLookupHelper lookup)
Initializes the mapping for a single function.
|
protected boolean |
isAddressField(String fieldName) |
boolean |
isFunctionAvailable(String functionName)
Returns true only if non null function pointer to this function exists.
|
void |
reset(DynamicLookupHelper lookup)
Resets the complete table.
|
protected void |
setEntry(Field addressField,
String funcName,
DynamicLookupHelper lookup) |
Map |
toMap()
Returns this table as map with the function name as key and the address as value.
|
String |
toString() |
public static final String PROCADDRESS_VAR_PREFIX
protected static boolean DEBUG
protected static String DEBUG_PREFIX
protected static int debugNum
public ProcAddressTable()
public ProcAddressTable(FunctionAddressResolver resolver)
public void reset(DynamicLookupHelper lookup) throws RuntimeException
RuntimeException
public void initEntry(String name, DynamicLookupHelper lookup)
IllegalArgumentException
- if this function is not in this table.protected void setEntry(Field addressField, String funcName, DynamicLookupHelper lookup)
protected boolean isAddressField(String fieldName)
protected static PrintStream getDebugOutStream()
public Map toMap()
public boolean isFunctionAvailable(String functionName)
public long getAddressFor(String functionName)
PROCADDRESS_VAR_PREFIX
+ <functionName>"
member variable name and look it up via reflection.IllegalArgumentException
- if this function is not in this table.public Set getNullPointerFunctions()