In Paper [A Software Product Line for Static Analyses(2014)], there is an illustration related constructing call graph(Listing7).
In this example, Line14 is related to construct call graph. while i check the src code and API, what i could find is DefaultCHACallGraphDomain.scala which has no implementation of construct call graph.
As my purpose is using OPAL to construct call graph. Is there any demo or documents help me understanding existing CallGraphDomain in OPAL? currently, i can only find some class declaration.
I'll be really appreciated if anyone can give me some suggestions related this topic.
Thanks in advance.
Jiang
The interface that was shown in the paper doesn't exist anymore, so you can totally forget about it.
The default interface to get a
CallGraph
class is provided by theProject
object you retrieve when you load the bytecode a Java project.A general code Example:
The computed call graph contains several things. It contains the entry points, unresolved method calls, exceptions when something went wrong at the construction time and the actual call graph.
OPAL provides you several call graph algorithms, you can retrieve each by passing the corresponding call graph key to the
Project
'sget
method.Currently, the following two keys are available and can be passed to
Project.get
(more information is available in the documentation of this classes):CHACallGraphKey
VTACallGraphKey
Analysis mode - Library vs Application
To construct a valid call graph for a software project it depends on the project kind which analysis mode to chose. While applications provide complete information (except incomplete projects, class loading and so on), software libraries are intended to be used by other projects. However, those two different scenarios have to be kept in mind, when construction call graphs. More details can be found here:
org.opalj.AnalysisModes
OPAL offers the following analysis modes:
The analysis mode can be either configured in OPAL's config file or set as project setting at runtime. You can find the config file in the
Common
project under/src/main/resources/reference.conf
.All of those analysis modes are supported by the the
CHACallGraphKey
whileVTACallGraphKey
only supports applications so far.NOTE: The interface may change in upcoming versions again.