title: How to Generate a calling graph for C++ code
body: <p>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 instance:</p>
  
  <pre><code>path 1: A -&gt; B -&gt; C -&gt; D  
  path 2: A -&gt; B -&gt; X -&gt; Y -&gt; D  
  path 3: A -&gt; G -&gt; M -&gt; N -&gt; O -&gt; P -&gt; S -&gt; D  
  ...  
  path n: ...
  </code></pre>
  
  <p>I have tried Codeviz and Doxygen, somehow both results show nothing but callees of target function, D. In my case, D is a member function of a class whose object will be wrapped within a smart pointer. Clients will always obtain the smart pointer object through a factory in order to invoke D.</p>
  
  <p>Does anyone know how to achieve this?</p>