This is a modified version of Andreas Gustafsson's egypt program, which uses gcc and graphviz to generate call graphs. I modified it to support C++.
Here is the Perl source.
Here is an example:
#include <stdio.h>
class Blah {
public:
static void hello_world() {
printf("hello world\n");
if (0) {
foo();
baz(0);
}
}
static void foo() {
bar();
}
static void bar() {
printf("hello world\n");
foo();
baz(1);
}
static void baz(int) {
foo();
}
};
int main(int argc, char **argv)
{
Blah::hello_world();
return 0;
}
| ![]() |