1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<html> 3<!-- Copyright (C) 1988-2021 Free Software Foundation, Inc. 4 5Permission is granted to copy, distribute and/or modify this document 6under the terms of the GNU Free Documentation License, Version 1.3 or 7any later version published by the Free Software Foundation; with the 8Invariant Sections being "Free Software" and "Free Software Needs 9Free Documentation", with the Front-Cover Texts being "A GNU Manual," 10and with the Back-Cover Texts as in (a) below. 11 12(a) The FSF's Back-Cover Text is: "You are free to copy and modify 13this GNU Manual. Buying copies from GNU Press supports the FSF in 14developing GNU and promoting software freedom." --> 15<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ --> 16<head> 17<title>Debugging with GDB: Set Tracepoints</title> 18 19<meta name="description" content="Debugging with GDB: Set Tracepoints"> 20<meta name="keywords" content="Debugging with GDB: Set Tracepoints"> 21<meta name="resource-type" content="document"> 22<meta name="distribution" content="global"> 23<meta name="Generator" content="makeinfo"> 24<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 25<link href="index.html#Top" rel="start" title="Top"> 26<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index"> 27<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> 28<link href="Tracepoints.html#Tracepoints" rel="up" title="Tracepoints"> 29<link href="Create-and-Delete-Tracepoints.html#Create-and-Delete-Tracepoints" rel="next" title="Create and Delete Tracepoints"> 30<link href="Tracepoints.html#Tracepoints" rel="previous" title="Tracepoints"> 31<style type="text/css"> 32<!-- 33a.summary-letter {text-decoration: none} 34blockquote.smallquotation {font-size: smaller} 35div.display {margin-left: 3.2em} 36div.example {margin-left: 3.2em} 37div.indentedblock {margin-left: 3.2em} 38div.lisp {margin-left: 3.2em} 39div.smalldisplay {margin-left: 3.2em} 40div.smallexample {margin-left: 3.2em} 41div.smallindentedblock {margin-left: 3.2em; font-size: smaller} 42div.smalllisp {margin-left: 3.2em} 43kbd {font-style:oblique} 44pre.display {font-family: inherit} 45pre.format {font-family: inherit} 46pre.menu-comment {font-family: serif} 47pre.menu-preformatted {font-family: serif} 48pre.smalldisplay {font-family: inherit; font-size: smaller} 49pre.smallexample {font-size: smaller} 50pre.smallformat {font-family: inherit; font-size: smaller} 51pre.smalllisp {font-size: smaller} 52span.nocodebreak {white-space:nowrap} 53span.nolinebreak {white-space:nowrap} 54span.roman {font-family:serif; font-weight:normal} 55span.sansserif {font-family:sans-serif; font-weight:normal} 56ul.no-bullet {list-style: none} 57--> 58</style> 59 60 61</head> 62 63<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> 64<a name="Set-Tracepoints"></a> 65<div class="header"> 66<p> 67Next: <a href="Analyze-Collected-Data.html#Analyze-Collected-Data" accesskey="n" rel="next">Analyze Collected Data</a>, Up: <a href="Tracepoints.html#Tracepoints" accesskey="u" rel="up">Tracepoints</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p> 68</div> 69<hr> 70<a name="Commands-to-Set-Tracepoints"></a> 71<h3 class="section">13.1 Commands to Set Tracepoints</h3> 72 73<p>Before running such a <em>trace experiment</em>, an arbitrary number of 74tracepoints can be set. A tracepoint is actually a special type of 75breakpoint (see <a href="Set-Breaks.html#Set-Breaks">Set Breaks</a>), so you can manipulate it using 76standard breakpoint commands. For instance, as with breakpoints, 77tracepoint numbers are successive integers starting from one, and many 78of the commands associated with tracepoints take the tracepoint number 79as their argument, to identify which tracepoint to work on. 80</p> 81<p>For each tracepoint, you can specify, in advance, some arbitrary set 82of data that you want the target to collect in the trace buffer when 83it hits that tracepoint. The collected data can include registers, 84local variables, or global data. Later, you can use <small>GDB</small> 85commands to examine the values these data had at the time the 86tracepoint was hit. 87</p> 88<p>Tracepoints do not support every breakpoint feature. Ignore counts on 89tracepoints have no effect, and tracepoints cannot run <small>GDB</small> 90commands when they are hit. Tracepoints may not be thread-specific 91either. 92</p> 93<a name="index-fast-tracepoints"></a> 94<p>Some targets may support <em>fast tracepoints</em>, which are inserted in 95a different way (such as with a jump instead of a trap), that is 96faster but possibly restricted in where they may be installed. 97</p> 98<a name="index-static-tracepoints"></a> 99<a name="index-markers_002c-static-tracepoints"></a> 100<a name="index-probing-markers_002c-static-tracepoints"></a> 101<p>Regular and fast tracepoints are dynamic tracing facilities, meaning 102that they can be used to insert tracepoints at (almost) any location 103in the target. Some targets may also support controlling <em>static 104tracepoints</em> from <small>GDB</small>. With static tracing, a set of 105instrumentation points, also known as <em>markers</em>, are embedded in 106the target program, and can be activated or deactivated by name or 107address. These are usually placed at locations which facilitate 108investigating what the target is actually doing. <small>GDB</small>’s 109support for static tracing includes being able to list instrumentation 110points, and attach them with <small>GDB</small> defined high level 111tracepoints that expose the whole range of convenience of 112<small>GDB</small>’s tracepoints support. Namely, support for collecting 113registers values and values of global or local (to the instrumentation 114point) variables; tracepoint conditions and trace state variables. 115The act of installing a <small>GDB</small> static tracepoint on an 116instrumentation point, or marker, is referred to as <em>probing</em> a 117static tracepoint marker. 118</p> 119<p><code>gdbserver</code> supports tracepoints on some target systems. 120See <a href="Server.html#Server">Tracepoints support in <code>gdbserver</code></a>. 121</p> 122<p>This section describes commands to set tracepoints and associated 123conditions and actions. 124</p> 125<table class="menu" border="0" cellspacing="0"> 126<tr><td align="left" valign="top">• <a href="Create-and-Delete-Tracepoints.html#Create-and-Delete-Tracepoints" accesskey="1">Create and Delete Tracepoints</a>:</td><td> </td><td align="left" valign="top"> 127</td></tr> 128<tr><td align="left" valign="top">• <a href="Enable-and-Disable-Tracepoints.html#Enable-and-Disable-Tracepoints" accesskey="2">Enable and Disable Tracepoints</a>:</td><td> </td><td align="left" valign="top"> 129</td></tr> 130<tr><td align="left" valign="top">• <a href="Tracepoint-Passcounts.html#Tracepoint-Passcounts" accesskey="3">Tracepoint Passcounts</a>:</td><td> </td><td align="left" valign="top"> 131</td></tr> 132<tr><td align="left" valign="top">• <a href="Tracepoint-Conditions.html#Tracepoint-Conditions" accesskey="4">Tracepoint Conditions</a>:</td><td> </td><td align="left" valign="top"> 133</td></tr> 134<tr><td align="left" valign="top">• <a href="Trace-State-Variables.html#Trace-State-Variables" accesskey="5">Trace State Variables</a>:</td><td> </td><td align="left" valign="top"> 135</td></tr> 136<tr><td align="left" valign="top">• <a href="Tracepoint-Actions.html#Tracepoint-Actions" accesskey="6">Tracepoint Actions</a>:</td><td> </td><td align="left" valign="top"> 137</td></tr> 138<tr><td align="left" valign="top">• <a href="Listing-Tracepoints.html#Listing-Tracepoints" accesskey="7">Listing Tracepoints</a>:</td><td> </td><td align="left" valign="top"> 139</td></tr> 140<tr><td align="left" valign="top">• <a href="Listing-Static-Tracepoint-Markers.html#Listing-Static-Tracepoint-Markers" accesskey="8">Listing Static Tracepoint Markers</a>:</td><td> </td><td align="left" valign="top"> 141</td></tr> 142<tr><td align="left" valign="top">• <a href="Starting-and-Stopping-Trace-Experiments.html#Starting-and-Stopping-Trace-Experiments" accesskey="9">Starting and Stopping Trace Experiments</a>:</td><td> </td><td align="left" valign="top"> 143</td></tr> 144<tr><td align="left" valign="top">• <a href="Tracepoint-Restrictions.html#Tracepoint-Restrictions">Tracepoint Restrictions</a>:</td><td> </td><td align="left" valign="top"> 145</td></tr> 146</table> 147 148<hr> 149<div class="header"> 150<p> 151Next: <a href="Analyze-Collected-Data.html#Analyze-Collected-Data" accesskey="n" rel="next">Analyze Collected Data</a>, Up: <a href="Tracepoints.html#Tracepoints" accesskey="u" rel="up">Tracepoints</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p> 152</div> 153 154 155 156</body> 157</html> 158