title: Make GDB print control flow of functions as they are called
body: <p>How do I make gdb print functions of interest as they are called, indented according to how deep in the stack they are?</p>
  
  <p>I want to be able to say something like (made up):</p>
  
  <pre><code>(gdb) trace Foo* Bar* printf
  </code></pre>
  
  <p>And have gdb print all functions which begin with Foo or Bar, as they are called. Kind of like gnu cflow, except using the debugging symbols and only printing functions which actually get called, not all possible call flows.</p>
  
  <p>Tools which won't help include cachegrind, callgrind and oprofile, which order the results by which functions were called most often. I need the order of calling preserved.</p>
  
  <p>The wildcarding (or equivalent) is essential, as there are a lot of Foo and Bar funcs. Although I would settle for recording absolutely every function. Or, perhaps telling gdb to record all functions in a particular library.</p>
  
  <p>Some GDB wizard must have a script for this common job!</p>