Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>How about using <a href="http://en.wikipedia.org/wiki/Strace" rel="noreferrer">strace</a> for system calls and <a href="http://en.wikipedia.org/wiki/Ltrace" rel="noreferrer">ltrace</a> for library calls to see traces instead of using gdb? <a href="http://en.wikipedia.org/wiki/Strace" rel="noreferrer">strace</a> for system calls and <a href="http://en.wikipedia.org/wiki/Ltrace" rel="noreferrer">ltrace</a> for library calls work with any application, even if you don't have the source code.</p> <p>If you have access to the source code, then you could also instrument your own code to do traces. Gcc has a mode that allows you to do that. Here's an <a href="http://ndevilla.free.fr/etrace/" rel="noreferrer">example</a>.</p> <p>Then you would only have to analyze the log files.</p> <p>If you want to use plain GDB, then you can use <a href="http://sourceware.org/gdb/current/onlinedocs/gdb_6.html#SEC40" rel="noreferrer">Breakpoint Command Lists</a></p> <blockquote> <p>You can give any breakpoint (or watchpoint or catchpoint) a series of commands to execute when your program stops due to that breakpoint. For example, you might want to print the values of certain expressions, or enable other breakpoints.</p> </blockquote> <p>And in particular:</p> <blockquote> <p>for example, here is how you could use breakpoint commands to print the value of x at entry to foo whenever x is positive. </p> </blockquote> <pre><code>break foo if x&gt;0 commands silent printf "x is %d\n",x cont end </code></pre>
 

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