Search code examples
c++reverse-engineering

How to keep track of source code call stack


I'm trying to re-implement a C++ code in Go. Specifically, I'm focused on meshToVolume tool of OpenVDB library.

As shown by a manually-prepared code flow screenshot, even a rough call stack map is pretty perplexing.

I'm looking for a tool to help me keep track of call stack and the code flow. So far:

  • I've looked at this post and tried out BOUML, but it didn't help
  • Also, OpenVDB has a Doxygen, but I couldn't get much help regarding keeping track of code flow and call stack

Can anybody suggest a helpful tool/method?


Solution

  • Using Doxygen, I could finally visualize call graph!

    Approach

    Downloaded and installed Doxygen. Then ran Doxywizard i.e. Doxygen GUI front-end. OpenVDB has a doc directory which is set as the working directory from which Doxygen will run.

    Working directories

    Without selecting these options, call graphs didn't get generated for me:

    enter image description here

    I have Graphviz DOT language installed on my machine. There I can use it to generate call graphs:

    Dot tool

    Finally, Doxygen generates the output HTML accessible at:

    file:///C:/Users/m3/repos/doxygen-output/html/index.html

    enter image description here

    Dependency graph sample:

    Dependency graph sample