You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Tracepoint-Restrictions.html 7.5KB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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 6.5, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  16. <title>Tracepoint Restrictions (Debugging with GDB)</title>
  17. <meta name="description" content="Tracepoint Restrictions (Debugging with GDB)">
  18. <meta name="keywords" content="Tracepoint Restrictions (Debugging with GDB)">
  19. <meta name="resource-type" content="document">
  20. <meta name="distribution" content="global">
  21. <meta name="Generator" content="makeinfo">
  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="Set-Tracepoints.html#Set-Tracepoints" rel="up" title="Set Tracepoints">
  26. <link href="Analyze-Collected-Data.html#Analyze-Collected-Data" rel="next" title="Analyze Collected Data">
  27. <link href="Starting-and-Stopping-Trace-Experiments.html#Starting-and-Stopping-Trace-Experiments" rel="prev" title="Starting and Stopping Trace Experiments">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.indentedblock {margin-right: 0em}
  32. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  33. blockquote.smallquotation {font-size: smaller}
  34. div.display {margin-left: 3.2em}
  35. div.example {margin-left: 3.2em}
  36. div.lisp {margin-left: 3.2em}
  37. div.smalldisplay {margin-left: 3.2em}
  38. div.smallexample {margin-left: 3.2em}
  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.nolinebreak {white-space: nowrap}
  50. span.roman {font-family: initial; font-weight: normal}
  51. span.sansserif {font-family: sans-serif; font-weight: normal}
  52. ul.no-bullet {list-style: none}
  53. -->
  54. </style>
  55. </head>
  56. <body lang="en">
  57. <a name="Tracepoint-Restrictions"></a>
  58. <div class="header">
  59. <p>
  60. Previous: <a href="Starting-and-Stopping-Trace-Experiments.html#Starting-and-Stopping-Trace-Experiments" accesskey="p" rel="prev">Starting and Stopping Trace Experiments</a>, Up: <a href="Set-Tracepoints.html#Set-Tracepoints" accesskey="u" rel="up">Set 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>
  61. </div>
  62. <hr>
  63. <a name="Tracepoint-Restrictions-1"></a>
  64. <h4 class="subsection">13.1.10 Tracepoint Restrictions</h4>
  65. <a name="index-tracepoint-restrictions"></a>
  66. <p>There are a number of restrictions on the use of tracepoints. As
  67. described above, tracepoint data gathering occurs on the target
  68. without interaction from <small>GDB</small>. Thus the full capabilities of
  69. the debugger are not available during data gathering, and then at data
  70. examination time, you will be limited by only having what was
  71. collected. The following items describe some common problems, but it
  72. is not exhaustive, and you may run into additional difficulties not
  73. mentioned here.
  74. </p>
  75. <ul>
  76. <li> Tracepoint expressions are intended to gather objects (lvalues). Thus
  77. the full flexibility of GDB&rsquo;s expression evaluator is not available.
  78. You cannot call functions, cast objects to aggregate types, access
  79. convenience variables or modify values (except by assignment to trace
  80. state variables). Some language features may implicitly call
  81. functions (for instance Objective-C fields with accessors), and therefore
  82. cannot be collected either.
  83. </li><li> Collection of local variables, either individually or in bulk with
  84. <code>$locals</code> or <code>$args</code>, during <code>while-stepping</code> may
  85. behave erratically. The stepping action may enter a new scope (for
  86. instance by stepping into a function), or the location of the variable
  87. may change (for instance it is loaded into a register). The
  88. tracepoint data recorded uses the location information for the
  89. variables that is correct for the tracepoint location. When the
  90. tracepoint is created, it is not possible, in general, to determine
  91. where the steps of a <code>while-stepping</code> sequence will advance the
  92. program&mdash;particularly if a conditional branch is stepped.
  93. </li><li> Collection of an incompletely-initialized or partially-destroyed object
  94. may result in something that <small>GDB</small> cannot display, or displays
  95. in a misleading way.
  96. </li><li> When <small>GDB</small> displays a pointer to character it automatically
  97. dereferences the pointer to also display characters of the string
  98. being pointed to. However, collecting the pointer during tracing does
  99. not automatically collect the string. You need to explicitly
  100. dereference the pointer and provide size information if you want to
  101. collect not only the pointer, but the memory pointed to. For example,
  102. <code>*ptr@50</code> can be used to collect the 50 element array pointed to
  103. by <code>ptr</code>.
  104. </li><li> It is not possible to collect a complete stack backtrace at a
  105. tracepoint. Instead, you may collect the registers and a few hundred
  106. bytes from the stack pointer with something like <code>*(unsigned char *)$esp@300</code>
  107. (adjust to use the name of the actual stack pointer register on your
  108. target architecture, and the amount of stack you wish to capture).
  109. Then the <code>backtrace</code> command will show a partial backtrace when
  110. using a trace frame. The number of stack frames that can be examined
  111. depends on the sizes of the frames in the collected stack. Note that
  112. if you ask for a block so large that it goes past the bottom of the
  113. stack, the target agent may report an error trying to read from an
  114. invalid address.
  115. </li><li> If you do not collect registers at a tracepoint, <small>GDB</small> can
  116. infer that the value of <code>$pc</code> must be the same as the address of
  117. the tracepoint and use that when you are looking at a trace frame
  118. for that tracepoint. However, this cannot work if the tracepoint has
  119. multiple locations (for instance if it was set in a function that was
  120. inlined), or if it has a <code>while-stepping</code> loop. In those cases
  121. <small>GDB</small> will warn you that it can&rsquo;t infer <code>$pc</code>, and default
  122. it to zero.
  123. </li></ul>
  124. <hr>
  125. <div class="header">
  126. <p>
  127. Previous: <a href="Starting-and-Stopping-Trace-Experiments.html#Starting-and-Stopping-Trace-Experiments" accesskey="p" rel="prev">Starting and Stopping Trace Experiments</a>, Up: <a href="Set-Tracepoints.html#Set-Tracepoints" accesskey="u" rel="up">Set 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>
  128. </div>
  129. </body>
  130. </html>