Questions tagged [call-graph]

A Call-Graph is a visual representation of calls between functions/procedures/methods etc. Typically created from the entry point of the code through each of the calls.

A Call-Graph is a useful tool in researching problems in your code. By seeing a visual reference of the order calls are performed, it allows the individual to trace back to a piece of code quicker. This allows them to test data output in various points faster by reducing the number of files that will have to be opened and searched to track this data manually.

Questions with this tag would include:

  1. How to build a call-graph in a particular language.
  2. Understanding a particular call-graph. This should generally include a visual reference.

Additional information about call graphs can be found on Wikipedia under the entry Call_Graph

204 questions
111
votes
7 answers

Tools to get a pictorial function call graph of code

I have a large work space which has many source files of C code. Although I can see the functions called from a function in MS VS2005 using the Object browser, and in MSVC 6.0 also, this only shows functions called from a particular function in a…
goldenmean
  • 16,908
  • 50
  • 144
  • 206
89
votes
8 answers

How to Generate a calling graph for C++ code

I'm trying to generate calling graph with which to find out all the possible execution paths that are hitting a particular function (so that I don't have to figure out all the paths manually, as there are many paths that lead to this function). For…
shiouming
  • 1,671
  • 2
  • 14
  • 26
65
votes
6 answers

Build a Call graph in python including modules and functions?

I have a bunch of scripts to perform a task. And I really need to know the call graph of the project because it is very confusing. I am not able to execute the code because it needs extra HW and SW to do so. However, I need to understand the logic…
JohnnyDH
  • 1,396
  • 2
  • 13
  • 12
41
votes
4 answers

How to generate call-graphs for given javascript?

I have seen "https://stackoverflow.com/questions/1385335/how-to-generate-function-call-graphs-for-javascript", and tried it. It works well, if you want to get an abstract syntax tree. Unfortunately Closure Compiler only seems to offer…
beatak
  • 8,376
  • 9
  • 30
  • 41
32
votes
4 answers

Generating a Call Graph in R

I've been given a big chunk of poorly formatted monolithic R code with plenty of functions, and I'd like to work out what functions call what functions. I thought I could use roxygen's @callGraph stuff, but a) the code needs to be in a package,…
Spacedman
  • 86,225
  • 12
  • 117
  • 197
29
votes
8 answers

C# Call Graph Generation Tool

I just got a heaping pile of (mostly undocumented) C# code and I'd like to visualize it's structure before I dive in and start refactoring. I've done this in the past (in other languages) with tools that generate call graphs. Can you recommend a…
Waylon Flinn
  • 18,635
  • 12
  • 65
  • 70
28
votes
6 answers

Static analysis of Java call graph

What I'd like to do is scan a set of Java classes, and trace all method calls from a specific method of an Abstract Class, and within that context, build a list of all code which performs some operation (in this case, instantiates an instance of a…
Mark Renouf
  • 29,573
  • 19
  • 89
  • 120
27
votes
5 answers

PHP call graph utility?

I'm looking for a utility similar to gprof that will generate a call graph for PHP code. I'd prefer something that can produce graphical output, or at least text output that can be interpreted by GraphViz or similar, but I'll settle for plain text…
glomad
  • 5,421
  • 2
  • 22
  • 38
25
votes
4 answers

Creating call graph

I am looking for a possibility to generate a call graph for Go projects. Something similar to Doxygen's diagram functionality for C++ classes (with the option CALL_GRAPH=YES). So far I found…
alex
  • 1,870
  • 4
  • 18
  • 29
24
votes
4 answers

C/C++ call-graph utility for Windows platform

I have a large 95% C, 5% C++ Win32 code base that I am trying to grok. What modern tools are available for generating call-graph diagrams for C or C++ projects?
Jeff Leonard
  • 3,144
  • 7
  • 27
  • 27
23
votes
8 answers

Are there any static Call-Graph and/or Control-Flow-Graph API for JavaScript?

Are there any Call-Graph and/or Control-Flow-Graph generators for JavaScript? Call Graph - http://en.wikipedia.org/wiki/Call_graph Control Flow Graph - http://en.wikipedia.org/wiki/Control_flow_graph EDIT: I am looking specifically for a static tool…
DuduAlul
  • 5,822
  • 7
  • 34
  • 61
20
votes
3 answers

Creating a visual call graph for java projects from command line

I'm looking to create a callgraph for java projects from the command line. I have explored several projects, each time falling short (either in my understanding, or the functionality) of what I am aiming for. Some simple guidelines on how to do this…
ThePerson
  • 2,663
  • 7
  • 34
  • 64
18
votes
5 answers

Make GDB print control flow of functions as they are called

How do I make gdb print functions of interest as they are called, indented according to how deep in the stack they are? I want to be able to say something like (made up): (gdb) trace Foo* Bar* printf And have gdb print all functions which begin…
callgiraffe
17
votes
1 answer

Static call graph generation for the Linux kernel

I'm looking for a tool to statically generate a call graph of the Linux kernel (for a given kernel configuration). The generated call graph should be "complete", in the sense that all calls are included, including potential indirect ones which we…
16
votes
7 answers

How to print the next N executed lines automatically in GDB?

I have been trying to find a way for some time to automate the progress in GDB of tracing the control flow of a program. Even just a simple way of automating the n command so you can see in what order routines are called. I realise that you can…
sice
1
2 3
13 14