|
funcscan Version 1.0.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.ovgu.cs.funcscan.Module
public class Module
A container for information extracted by nm.
Constructor Summary | |
---|---|
Module(String filename,
String remove)
Create a new Module. |
Method Summary | |
---|---|
void |
add(Symbol s,
String name)
Add the given symbol to this module. |
LinkedHashMap<String,de.ovgu.cs.funcscan.Module.CP> |
getFunctionCallers(Collection<Module> potentialCaller,
boolean cached)
Get all modules, which call a global function of this module. |
String |
getFunctionDefinition(String name)
Get the definition for the given function. |
String |
getName()
Get the name of the module file. |
String |
getSource()
Get the 'cc -E' pre-processed source code for this module. |
String |
getSrcName()
Get the name of the source file for this module. |
Set<String> |
getSymbolNames(Symbol type)
Get the names of all symbols for the given type. |
String |
getVarDefinition(String name)
Get the definition for the given variable. |
LinkedHashMap<String,de.ovgu.cs.funcscan.Module.CP> |
getVarsCallers(Collection<Module> potentialCaller,
boolean cached)
Get all modules, which refer to a global variable of this module. |
void |
setFunctionDefinition(String name,
String code)
Set the definition for the given function. |
void |
setSource(String source)
Add the 'cc -E' pre-processed source for this module. |
void |
setVarDefinition(String name,
String code)
Set the definition for the given variable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Module(String filename, String remove)
filename
- the name of the object file.remove
- the regex to use to construct the real source file name
from the given filename. Might be null
.String.replaceAll(String, String)
Method Detail |
---|
public String getName()
public String getSrcName()
public void add(Symbol s, String name)
s
- symbol typename
- name of the symbolpublic Set<String> getSymbolNames(Symbol type)
type
- type of the symbol names to return.
public LinkedHashMap<String,de.ovgu.cs.funcscan.Module.CP> getFunctionCallers(Collection<Module> potentialCaller, boolean cached)
potentialCaller
- a list of modules to check for calling.cached
- if true
, avoid re-scanning and return the result
from the last scan if there is one.
null
if the parameter is null or empty, otherwise a
map with global function names of this module paired with a set of
modules, which define and call this function. Since the scan is based
on the object file information (undefined global symbols) only, name
clashes may occur, so that a caller gets listed as well, which refers
not to the function but an external variable with the same name.public LinkedHashMap<String,de.ovgu.cs.funcscan.Module.CP> getVarsCallers(Collection<Module> potentialCaller, boolean cached)
potentialCaller
- a list of modules to check for references.cached
- if true
, avoid re-scanning and return the result
from the last scan if there is one.
null
if the parameter is null or empty, otherwise a
map with global variable names of this module paired with a set of
modules, which define and reference this variable. Since the scan is based
on the object file information (undefined global symbols) only, name
clashes may occur, so that a source files gets listed as well, which refers
not to the variable but an external function with the same name.public void setSource(String source)
source
- the pre-processed source to set. Use an empty String to
indicate, that source code for this module could not be found or
the pre-processor was unable to handle it.getSrcName()
,
getSource()
public String getSource()
null
if not yet available, an empty String, if the
source code could not be found or pre-processed, the source code
otherwise.public void setFunctionDefinition(String name, String code)
name
- name of the functioncode
- definition to add.getFunctionDefinition(String)
public String getFunctionDefinition(String name)
name
- name of the function
null
if not set, an empty string if it could not be
extracted from source, the definition otherwise.setFunctionDefinition(String, String)
public void setVarDefinition(String name, String code)
name
- name of the variablecode
- definition to add.getVarDefinition(String)
public String getVarDefinition(String name)
name
- name of the variable
null
if not set, an empty string if it could not be
extracted from source, the definition otherwise.setVarDefinition(String, String)
|
funcscan Version 1.0.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |