Set-Tracepoints.html 8.8 KB

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