Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a simple static call graph in Java?

I would like to generate a simple call graph in order to be able to analyze the flow of execution in methods in java.

So for example, if in the code I'm able to go from method X to method Y in a number of method calls, then I would like to generate the call graph which shows the flow from method X to method Y.

I tried using SOOT however I did not manage to get this required call graph. Does anyone know of an API which I can use to generate such call graphs? I'm using Eclipse, however I cannot use plugins, as this tool is needed to be used across a number of projects

Thanks a lot for your help

like image 220
ict1991 Avatar asked Jun 08 '26 12:06

ict1991


1 Answers

This is as good an API as I've seen:

https://github.com/gousiosg/java-callgraph

like image 61
Sridhar Sarnobat Avatar answered Jun 11 '26 04:06

Sridhar Sarnobat