Is there a way to do a call graph of c++ code in R?

80 Views Asked by At

I'm a daily user of R but very new to c++. I'm using Rstudio to explore a very large and complicated C++ code by using R and Shell tools like ctags, grep and the system function. To better understand the code, i would like to understand the call hierarchy by building a call tree of that code. Is there a simple way to do that in R, e.g. with Rcpp?

Ultimately, i would like to be able to follow a parameter by coloring/ extracting the parts of the code that contains it (and still seeing the call hierarchy between the routines the parameter is mentioned in)

FYI: So far i have tried to use Vim cctree to get the call tree from the main(), and transferred the list result to R and then to a graph with igraph, but this method has a lot of intermediate steps that make it hard to repeat. Also, from R, i'm using ctags to find all the routines and i'm thinking i could use grep to find the various occurences of the routine, detect where it is defined and where it is called, but i don't know exactly how to do that.

Sorry if the question is quite vague. I guess, in short, i'm hoping that there is already a way to explore C++ code in R. Thanks!

0

There are 0 best solutions below