Package com.ensoftcorp.open.cg.analysis
Class ReachabilityAnalysis
- java.lang.Object
-
- com.ensoftcorp.open.cg.analysis.CGAnalysis
-
- com.ensoftcorp.open.cg.analysis.ReachabilityAnalysis
-
public class ReachabilityAnalysis extends CGAnalysis
This is about the simplest call graph we can make (dumber than a CHA). It just matches the method signature of the callsite with all methods that have the same signature. In terms of matching method signatures, this at least makes sure the matched method is a virtual method and the method name and parameter types/count match, but simpler implementations exist that only match the name of the method (regardless if its static/dynamic or has different parameter types/count).- Author:
- Ben Holland
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CALL
static java.lang.String
LIBRARY_CALL
static java.lang.String
LIBRARY_PER_CONTROL_FLOW
static java.lang.String
PER_CONTROL_FLOW
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
getCallEdgeTags()
Returns the set of tags applied to edges during call graph constructionstatic ReachabilityAnalysis
getInstance()
java.lang.String
getName()
java.lang.String[]
getPerControlFlowEdgeTags()
Returns the set of tags applied to per control flow edges during call graph constructionstatic com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node>
getReachableMethods(com.ensoftcorp.atlas.core.db.graph.Node callsite, com.ensoftcorp.atlas.core.query.Q typesToSearch)
Returns a set of reachable methods (methods with the matching signature of the callsite) Note: This method specifically includes abstract methodsstatic com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node>
getReachableMethods_AlternateImplementation(com.ensoftcorp.atlas.core.db.graph.Node callsite, com.ensoftcorp.atlas.core.query.Q typesToSearch)
Returns a set of reachable methods (methods with the matching signature of the callsite) Note: This method specifically includes abstract methods Note: This implementation uses a very verbose (and expensive) implementation of signature matching in Atlas It is included here as an example of how it could be done.-
Methods inherited from class com.ensoftcorp.open.cg.analysis.CGAnalysis
getCallGraph, getPerControlFlowGraph, hasRun, run
-
-
-
-
Field Detail
-
CALL
public static final java.lang.String CALL
- See Also:
- Constant Field Values
-
PER_CONTROL_FLOW
public static final java.lang.String PER_CONTROL_FLOW
- See Also:
- Constant Field Values
-
LIBRARY_CALL
public static final java.lang.String LIBRARY_CALL
- See Also:
- Constant Field Values
-
LIBRARY_PER_CONTROL_FLOW
public static final java.lang.String LIBRARY_PER_CONTROL_FLOW
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static ReachabilityAnalysis getInstance()
-
getReachableMethods
public static com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> getReachableMethods(com.ensoftcorp.atlas.core.db.graph.Node callsite, com.ensoftcorp.atlas.core.query.Q typesToSearch)
Returns a set of reachable methods (methods with the matching signature of the callsite) Note: This method specifically includes abstract methods- Parameters:
callsite
-- Returns:
-
getReachableMethods_AlternateImplementation
public static com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> getReachableMethods_AlternateImplementation(com.ensoftcorp.atlas.core.db.graph.Node callsite, com.ensoftcorp.atlas.core.query.Q typesToSearch)
Returns a set of reachable methods (methods with the matching signature of the callsite) Note: This method specifically includes abstract methods Note: This implementation uses a very verbose (and expensive) implementation of signature matching in Atlas It is included here as an example of how it could be done. For this particular purpose it is better to use the Atlas signature attribute instead.- Parameters:
callsite
-- Returns:
-
getCallEdgeTags
public java.lang.String[] getCallEdgeTags()
Description copied from class:CGAnalysis
Returns the set of tags applied to edges during call graph construction- Specified by:
getCallEdgeTags
in classCGAnalysis
- Returns:
-
getPerControlFlowEdgeTags
public java.lang.String[] getPerControlFlowEdgeTags()
Description copied from class:CGAnalysis
Returns the set of tags applied to per control flow edges during call graph construction- Specified by:
getPerControlFlowEdgeTags
in classCGAnalysis
- Returns:
-
getName
public java.lang.String getName()
- Specified by:
getName
in classCGAnalysis
-
-