3 <title>Debugging with GDB
</title>
4 <meta http-equiv=
"Content-Type" content=
"text/html">
5 <meta name=
"description" content=
"Debugging with GDB">
6 <meta name=
"generator" content=
"makeinfo 4.3">
7 <link href=
"http://www.gnu.org/software/texinfo/" rel=
"generator-home">
12 Node:
<a name=
"Tracepoint%20Variables">Tracepoint Variables
</a>,
13 Previous:
<a rel=
"previous" accesskey=
"p" href=
"Analyze-Collected-Data.html#Analyze%20Collected%20Data">Analyze Collected Data
</a>,
14 Up:
<a rel=
"up" accesskey=
"u" href=
"Tracepoints.html#Tracepoints">Tracepoints
</a>
18 <h3 class=
"section">Convenience Variables for Tracepoints
</h3>
21 <dt><code>(int) $trace_frame
</code>
22 <dd>The current trace snapshot (a.k.a.
<dfn>frame
</dfn>) number, or -
1 if no
25 <br><dt><code>(int) $tracepoint
</code>
26 <dd>The tracepoint for the current trace snapshot.
28 <br><dt><code>(int) $trace_line
</code>
29 <dd>The line number for the current trace snapshot.
31 <br><dt><code>(char []) $trace_file
</code>
32 <dd>The source file for the current trace snapshot.
34 <br><dt><code>(char []) $trace_func
</code>
35 <dd>The name of the function containing
<code>$tracepoint
</code>.
38 <p>Note:
<code>$trace_file
</code> is not suitable for use in
<code>printf
</code>,
39 use
<code>output
</code> instead.
41 <p>Here's a simple example of using these convenience variables for
42 stepping through all the trace snapshots and printing some of their
45 <pre class=
"smallexample"> (gdb)
<b>tfind start
</b>
47 (gdb)
<b>while $trace_frame != -
1</b>
48 > output $trace_file
49 > printf
", line %d (tracepoint #%d)\n", $trace_line, $tracepoint