OPAL-关于在OPAL中实现构造调用图 [英] OPAL-Regarding implementing construct call graph in OPAL

查看:132
本文介绍了OPAL-关于在OPAL中实现构造调用图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在论文[用于静态分析的软件产品线(2014)]中,有一个与插图相关的构造调用图(清单7)。

In Paper [A Software Product Line for Static Analyses(2014)], there is an illustration related constructing call graph(Listing7).

在此示例中,Line14与构造调用图有关。当我检查src代码和API时,我能找到的是DefaultCHACallGraphDomain.scala,它没有构造调用图的实现。

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.

因为我的目的是使用OPAL构造调用图形。是否有任何演示或文档可以帮助我了解OPAL中现有的CallGraphDomain?目前,我只能找到一些类声明。

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.

谢谢。

推荐答案

本文显示的界面不再存在,因此您完全可以忽略它。

The interface that was shown in the paper doesn't exist anymore, so you can totally forget about it.

Project 提供了获取 CallGraph 类的默认接口。 c $ c>在加载Java项目的字节码时检索的对象。

The default interface to get a CallGraph class is provided by the Project object you retrieve when you load the bytecode a Java project.

通用代码示例:

val project = ... // a java project
val computedCallGraph = project.get(/* Some call graph key */)
val callGraph = computedCallGraph.callGraph // the final call graph interface.

计算出的调用图包含一些东西。它包含入口点,未解决的方法调用,在构造时出现问题的异常以及实际的调用图。

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提供了几种调用图算法,您可以通过将相应的调用图键传递给 Project get 方法来检索每个对象。

OPAL provides you several call graph algorithms, you can retrieve each by passing the corresponding call graph key to the Project's get method.

当前,以下两个键可用,并且可以传递给 Project.get (有关更多信息,请参见此类的文档):

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

  • CHACallGraphKey
  • VTACallGraphKey

要为软件项目构建有效的调用图,取决于选择哪种分析模式的项目种类。尽管应用程序提供了完整的信息(不完整的项目,类加载等除外),但是软件库也打算由其他项目使用。但是,在构造调用图时,必须牢记这两种不同的情况。可以在这里找到更多详细信息: org.opalj.AnalysisModes

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提供以下分析模式:

OPAL offers the following analysis modes:


  • DesktopApplication(对于应用程序调用图安全)

  • LibraryWithClosePackagesAssumption(对于用于安全性的调用图安全-不敏感的分析)

  • LibraryWithOpenPackagesAssumption(对于安全性分析而言非常保守/安全)

分析模式可以在OPAL的配置文件中配置,也可以在运行时设置为项目设置。您可以在 Common 项目的 /src/main/resources/reference.conf 下找到配置文件。

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.

CHACallGraphKey 支持所有这些分析模式,而 VTACallGraphKey 仅支持到目前为止的应用程序。

All of those analysis modes are supported by the the CHACallGraphKey while VTACallGraphKey only supports applications so far.

注意:界面可能会在即将发布的版本中再次更改。

NOTE: The interface may change in upcoming versions again.

这篇关于OPAL-关于在OPAL中实现构造调用图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆