Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This question might need clarification to decide between what are currently 2 answers. Depends on what you need:</p> <p>1) You need to know how many times each function is being called in straight list/graph format of functions matched with # of calls. This could lead to ambiguous/inconclusive results if your code is not procedural (i.e. functions calling other functions in a branch out structure without ambiguity of what is calling what). This is basic gprof functionality which requires recompilation with -pg flag.</p> <p>2) You need a list of functions in the order in which they were called, this depends on your program which is the best/feasible option: a) IF your program runs and terminates without runtime errors you can use gprof for this purpose. b) ELSE option above using dbg with logging and break points is the left over option that I learned upon reading this.</p> <p>3) You need to know not only the order but, for example, the function arguments for each call as well. My current work is simulations in physics of particle transport, so this would ABSOLUTELY be useful in tracking down where anomalous results are coming from... i.e. when the arguments getting passed around stop making sense. I imagine one way to do this is would be a variation on what Employed Russian did except using the following:</p> <blockquote> <p>(gdb) info args</p> </blockquote> <p>Logging the results of this command with every break point (set at every function call) gives the args of the current function.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload