blob: 724f459d90fb2144d9414bcb562bca8a83f4a8ad [file] [log] [blame]
<html lang="en">
<head>
<title>Tracepoints - Debugging with GDB</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Debugging with GDB">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="Macros.html#Macros" title="Macros">
<link rel="next" href="Overlays.html#Overlays" title="Overlays">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Free Software'' and ``Free Software Needs
Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,''
and with the Back-Cover Texts as in (a) below.
(a) The FSF's Back-Cover Text is: ``You are free to copy and modify
this GNU Manual. Buying copies from GNU Press supports the FSF in
developing GNU and promoting software freedom.''-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
<link rel="stylesheet" type="text/css" href="../cs.css">
</head>
<body>
<div class="node">
<a name="Tracepoints"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Overlays.html#Overlays">Overlays</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Macros.html#Macros">Macros</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
</div>
<h2 class="chapter">13 Tracepoints</h2>
<!-- This chapter is based on the documentation written by Michael -->
<!-- Snyder, David Taylor, Jim Blandy, and Elena Zannoni. -->
<p><a name="index-tracepoints-680"></a>In some applications, it is not feasible for the debugger to interrupt
the program's execution long enough for the developer to learn
anything helpful about its behavior. If the program's correctness
depends on its real-time behavior, delays introduced by a debugger
might cause the program to change its behavior drastically, or perhaps
fail, even when the code itself is correct. It is useful to be able
to observe the program's behavior without interrupting it.
<p>Using <span class="sc">gdb</span>'s <code>trace</code> and <code>collect</code> commands, you can
specify locations in the program, called <dfn>tracepoints</dfn>, and
arbitrary expressions to evaluate when those tracepoints are reached.
Later, using the <code>tfind</code> command, you can examine the values
those expressions had when the program hit the tracepoints. The
expressions may also denote objects in memory&mdash;structures or arrays,
for example&mdash;whose values <span class="sc">gdb</span> should record; while visiting
a particular tracepoint, you may inspect those objects as if they were
in memory at that moment. However, because <span class="sc">gdb</span> records these
values without interacting with you, it can do so quickly and
unobtrusively, hopefully not disturbing the program's behavior.
<p>The tracepoint facility is currently available only for remote
targets. See <a href="Targets.html#Targets">Targets</a>. In addition, your remote target must know
how to collect trace data. This functionality is implemented in the
remote stub; however, none of the stubs distributed with <span class="sc">gdb</span>
support tracepoints as of this writing. The format of the remote
packets used to implement tracepoints are described in <a href="Tracepoint-Packets.html#Tracepoint-Packets">Tracepoint Packets</a>.
<p>It is also possible to get trace data from a file, in a manner reminiscent
of corefiles; you specify the filename, and use <code>tfind</code> to search
through the file. See <a href="Trace-Files.html#Trace-Files">Trace Files</a>, for more details.
<p>This chapter describes the tracepoint commands and features.
<ul class="menu">
<li><a accesskey="1" href="Set-Tracepoints.html#Set-Tracepoints">Set Tracepoints</a>
<li><a accesskey="2" href="Analyze-Collected-Data.html#Analyze-Collected-Data">Analyze Collected Data</a>
<li><a accesskey="3" href="Tracepoint-Variables.html#Tracepoint-Variables">Tracepoint Variables</a>
<li><a accesskey="4" href="Trace-Files.html#Trace-Files">Trace Files</a>
</ul>
</body></html>