EnSoftCorp / call-graph-toolbox

A toolbox with several call graph construction algorithm implementations
https://ensoftcorp.github.io/call-graph-toolbox/
Other
19 stars 5 forks source link

How can we use the code with making it a eclipse plugin? #3

Open farhaanbukhsh opened 5 years ago

farhaanbukhsh commented 5 years ago
  1. How can we use this callgraph toolbox as a standalone program instead of a plugin of eclipse?

The use case is in my project I just want the relationship between different functions and wanted to do an analysis on it. So having an IDE booted to that job is an overkill, so can we use the plugin code without the eclipse extension?

Which files should we look into?

  1. Does the callgraph algorithm require building the source code first? (works on .class or .java)

Since we want to do a static analysis on the code is this really required to build the project and then do it?

atamrawi commented 5 years ago

Atlas is simply an Eclipse plugin, so you cannot run it without running Eclipse. However, you can export whatever data (call relation) to a file format of your choice by writing a custom Atlas script via a custom Atlas plugin. You can easily create a demo Atlas plugin with sample custom scripts through: File > New > Other > Atlas > Sample Atlas Plug-in Project. Once the project is created, please take a look at the class "CallGraphAtlasScript" that can answer your first question.

For the second question, the call graph algorithm stems call relation information from Atlas code map which requires having a compilable source code (.java). Atlas can work on Jimple an intermediate representation of Java bytecode.

benjholla commented 5 years ago

First of all, Atlas itself has a Class Hierarchy Analysis algorithm to produce a call graph. This particular toolbox adds more implementations of call graph algorithms which are more expensive in nature (the algorithm provided by Atlas is a good default). In both cases you will be using Atlas.

To answer your other questions, you can't really use it as a standalone analysis per say (Eclipse is part of the framework), but you can write code to export your analysis results to whatever format you want. Atlas can take source .Java files as input or .class files which are transformed to .jimple IR as input. Atlas and this code is already an Eclipse plugin. You can create another plugin that depends on either Atlas or Atlas and this toolbox.

On Mon, Feb 11, 2019, 12:05 PM Ahmed Tamrawi <notifications@github.com wrote:

Atlas is simply an Eclipse plugin, so you cannot run it without running Eclipse. However, you can export whatever data (call relation) to a file format of your choice by writing a custom Atlas script via a custom Atlas plugin. You can easily create a demo Atlas plugin with sample custom scripts through: File > New > Other > Atlas > Sample Atlas Plug-in Project. Once the project is created, please take a look at the class "CallGraphAtlasScript" that can answer your first question.

For the second question, the call graph algorithm stems call relation information from Atlas code map which requires having a compilable source code (.java). Atlas can work on Jimple an intermediate representation of Java bytecode.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/EnSoftCorp/call-graph-toolbox/issues/3#issuecomment-462408491, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwqPX2zNTvZdCYUZ_Imfb72jeLa9Aywks5vMaLmgaJpZM4azgK0 .