Walking thru CallGraph bottom up

Dear Simon,

Kevin is correct; as far as I can tell, there is no method of getting the functions calling a given function. Instead, you have to start at the main() function and search for the function using a depth-first or breadth-first search.

What may make sense is to build a new data structure that has nodes that point from callees to callers once and then use that for your queries. That way, you're not researching the CallGraph all the time.

One important note is that the CallGraph has an "external node" which represents all unresolved calls (e.g., indirect function calls). Technically, you need to start searching from this node as well as the main() node (as a program can call out to external code which then calls back into the program; think of qsort() as an example).


John Criswell

Hi guys,

thank you so much for your great answers.
I kept looking for such a data structure but there is no such a thing as you confirmed.
But I think I have all the info I need thanks to your suggestions.
If I get something working I will share it!

Thanks again!