Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

660 lines
31KB

  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 Packets (Debugging with GDB)</title>
  17. <meta name="description" content="Tracepoint Packets (Debugging with GDB)">
  18. <meta name="keywords" content="Tracepoint Packets (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="Remote-Protocol.html#Remote-Protocol" rel="up" title="Remote Protocol">
  26. <link href="Host-I_002fO-Packets.html#Host-I_002fO-Packets" rel="next" title="Host I/O Packets">
  27. <link href="MIPS-Breakpoint-Kinds.html#MIPS-Breakpoint-Kinds" rel="prev" title="MIPS Breakpoint Kinds">
  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-Packets"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Host-I_002fO-Packets.html#Host-I_002fO-Packets" accesskey="n" rel="next">Host I/O Packets</a>, Previous: <a href="Architecture_002dSpecific-Protocol-Details.html#Architecture_002dSpecific-Protocol-Details" accesskey="p" rel="prev">Architecture-Specific Protocol Details</a>, Up: <a href="Remote-Protocol.html#Remote-Protocol" accesskey="u" rel="up">Remote Protocol</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-Packets-1"></a>
  64. <h3 class="section">E.6 Tracepoint Packets</h3>
  65. <a name="index-tracepoint-packets"></a>
  66. <a name="index-packets_002c-tracepoint"></a>
  67. <p>Here we describe the packets <small>GDB</small> uses to implement
  68. tracepoints (see <a href="Tracepoints.html#Tracepoints">Tracepoints</a>).
  69. </p>
  70. <dl compact="compact">
  71. <dt>&lsquo;<samp>QTDP:<var>n</var>:<var>addr</var>:<var>ena</var>:<var>step</var>:<var>pass</var>[:F<var>flen</var>][:X<var>len</var>,<var>bytes</var>]<span class="roman">[</span>-<span class="roman">]</span></samp>&rsquo;</dt>
  72. <dd><a name="index-QTDP-packet"></a>
  73. <p>Create a new tracepoint, number <var>n</var>, at <var>addr</var>. If <var>ena</var>
  74. is &lsquo;<samp>E</samp>&rsquo;, then the tracepoint is enabled; if it is &lsquo;<samp>D</samp>&rsquo;, then
  75. the tracepoint is disabled. The <var>step</var> gives the tracepoint&rsquo;s step
  76. count, and <var>pass</var> gives its pass count. If an &lsquo;<samp>F</samp>&rsquo; is present,
  77. then the tracepoint is to be a fast tracepoint, and the <var>flen</var> is
  78. the number of bytes that the target should copy elsewhere to make room
  79. for the tracepoint. If an &lsquo;<samp>X</samp>&rsquo; is present, it introduces a
  80. tracepoint condition, which consists of a hexadecimal length, followed
  81. by a comma and hex-encoded bytes, in a manner similar to action
  82. encodings as described below. If the trailing &lsquo;<samp>-</samp>&rsquo; is present,
  83. further &lsquo;<samp>QTDP</samp>&rsquo; packets will follow to specify this tracepoint&rsquo;s
  84. actions.
  85. </p>
  86. <p>Replies:
  87. </p><dl compact="compact">
  88. <dt>&lsquo;<samp>OK</samp>&rsquo;</dt>
  89. <dd><p>The packet was understood and carried out.
  90. </p></dd>
  91. <dt>&lsquo;<samp>qRelocInsn</samp>&rsquo;</dt>
  92. <dd><p>See <a href="#Tracepoint-Packets">Relocate instruction reply packet</a>.
  93. </p></dd>
  94. <dt>&lsquo;<samp><!-- /@w --></samp>&rsquo;</dt>
  95. <dd><p>The packet was not recognized.
  96. </p></dd>
  97. </dl>
  98. </dd>
  99. <dt>&lsquo;<samp>QTDP:-<var>n</var>:<var>addr</var>:<span class="roman">[</span>S<span class="roman">]</span><var>action</var>&hellip;<span class="roman">[</span>-<span class="roman">]</span></samp>&rsquo;</dt>
  100. <dd><p>Define actions to be taken when a tracepoint is hit. The <var>n</var> and
  101. <var>addr</var> must be the same as in the initial &lsquo;<samp>QTDP</samp>&rsquo; packet for
  102. this tracepoint. This packet may only be sent immediately after
  103. another &lsquo;<samp>QTDP</samp>&rsquo; packet that ended with a &lsquo;<samp>-</samp>&rsquo;. If the
  104. trailing &lsquo;<samp>-</samp>&rsquo; is present, further &lsquo;<samp>QTDP</samp>&rsquo; packets will follow,
  105. specifying more actions for this tracepoint.
  106. </p>
  107. <p>In the series of action packets for a given tracepoint, at most one
  108. can have an &lsquo;<samp>S</samp>&rsquo; before its first <var>action</var>. If such a packet
  109. is sent, it and the following packets define &ldquo;while-stepping&rdquo;
  110. actions. Any prior packets define ordinary actions &mdash; that is, those
  111. taken when the tracepoint is first hit. If no action packet has an
  112. &lsquo;<samp>S</samp>&rsquo;, then all the packets in the series specify ordinary
  113. tracepoint actions.
  114. </p>
  115. <p>The &lsquo;<samp><var>action</var>&hellip;</samp>&rsquo; portion of the packet is a series of
  116. actions, concatenated without separators. Each action has one of the
  117. following forms:
  118. </p>
  119. <dl compact="compact">
  120. <dt>&lsquo;<samp>R <var>mask</var></samp>&rsquo;</dt>
  121. <dd><p>Collect the registers whose bits are set in <var>mask</var>,
  122. a hexadecimal number whose <var>i</var>&rsquo;th bit is set if register number
  123. <var>i</var> should be collected. (The least significant bit is numbered
  124. zero.) Note that <var>mask</var> may be any number of digits long; it may
  125. not fit in a 32-bit word.
  126. </p>
  127. </dd>
  128. <dt>&lsquo;<samp>M <var>basereg</var>,<var>offset</var>,<var>len</var></samp>&rsquo;</dt>
  129. <dd><p>Collect <var>len</var> bytes of memory starting at the address in register
  130. number <var>basereg</var>, plus <var>offset</var>. If <var>basereg</var> is
  131. &lsquo;<samp>-1</samp>&rsquo;, then the range has a fixed address: <var>offset</var> is the
  132. address of the lowest byte to collect. The <var>basereg</var>,
  133. <var>offset</var>, and <var>len</var> parameters are all unsigned hexadecimal
  134. values (the &lsquo;<samp>-1</samp>&rsquo; value for <var>basereg</var> is a special case).
  135. </p>
  136. </dd>
  137. <dt>&lsquo;<samp>X <var>len</var>,<var>expr</var></samp>&rsquo;</dt>
  138. <dd><p>Evaluate <var>expr</var>, whose length is <var>len</var>, and collect memory as
  139. it directs. The agent expression <var>expr</var> is as described in
  140. <a href="Agent-Expressions.html#Agent-Expressions">Agent Expressions</a>. Each byte of the expression is encoded as a
  141. two-digit hex number in the packet; <var>len</var> is the number of bytes
  142. in the expression (and thus one-half the number of hex digits in the
  143. packet).
  144. </p>
  145. </dd>
  146. </dl>
  147. <p>Any number of actions may be packed together in a single &lsquo;<samp>QTDP</samp>&rsquo;
  148. packet, as long as the packet does not exceed the maximum packet
  149. length (400 bytes, for many stubs). There may be only one &lsquo;<samp>R</samp>&rsquo;
  150. action per tracepoint, and it must precede any &lsquo;<samp>M</samp>&rsquo; or &lsquo;<samp>X</samp>&rsquo;
  151. actions. Any registers referred to by &lsquo;<samp>M</samp>&rsquo; and &lsquo;<samp>X</samp>&rsquo; actions
  152. must be collected by a preceding &lsquo;<samp>R</samp>&rsquo; action. (The
  153. &ldquo;while-stepping&rdquo; actions are treated as if they were attached to a
  154. separate tracepoint, as far as these restrictions are concerned.)
  155. </p>
  156. <p>Replies:
  157. </p><dl compact="compact">
  158. <dt>&lsquo;<samp>OK</samp>&rsquo;</dt>
  159. <dd><p>The packet was understood and carried out.
  160. </p></dd>
  161. <dt>&lsquo;<samp>qRelocInsn</samp>&rsquo;</dt>
  162. <dd><p>See <a href="#Tracepoint-Packets">Relocate instruction reply packet</a>.
  163. </p></dd>
  164. <dt>&lsquo;<samp><!-- /@w --></samp>&rsquo;</dt>
  165. <dd><p>The packet was not recognized.
  166. </p></dd>
  167. </dl>
  168. </dd>
  169. <dt>&lsquo;<samp>QTDPsrc:<var>n</var>:<var>addr</var>:<var>type</var>:<var>start</var>:<var>slen</var>:<var>bytes</var></samp>&rsquo;</dt>
  170. <dd><a name="index-QTDPsrc-packet"></a>
  171. <p>Specify a source string of tracepoint <var>n</var> at address <var>addr</var>.
  172. This is useful to get accurate reproduction of the tracepoints
  173. originally downloaded at the beginning of the trace run. The <var>type</var>
  174. is the name of the tracepoint part, such as &lsquo;<samp>cond</samp>&rsquo; for the
  175. tracepoint&rsquo;s conditional expression (see below for a list of types), while
  176. <var>bytes</var> is the string, encoded in hexadecimal.
  177. </p>
  178. <p><var>start</var> is the offset of the <var>bytes</var> within the overall source
  179. string, while <var>slen</var> is the total length of the source string.
  180. This is intended for handling source strings that are longer than will
  181. fit in a single packet.
  182. </p>
  183. <p>The available string types are &lsquo;<samp>at</samp>&rsquo; for the location,
  184. &lsquo;<samp>cond</samp>&rsquo; for the conditional, and &lsquo;<samp>cmd</samp>&rsquo; for an action command.
  185. <small>GDB</small> sends a separate packet for each command in the action
  186. list, in the same order in which the commands are stored in the list.
  187. </p>
  188. <p>The target does not need to do anything with source strings except
  189. report them back as part of the replies to the &lsquo;<samp>qTfP</samp>&rsquo;/&lsquo;<samp>qTsP</samp>&rsquo;
  190. query packets.
  191. </p>
  192. <p>Although this packet is optional, and <small>GDB</small> will only send it
  193. if the target replies with &lsquo;<samp>TracepointSource</samp>&rsquo; See <a href="General-Query-Packets.html#General-Query-Packets">General Query Packets</a>, it makes both disconnected tracing and trace files
  194. much easier to use. Otherwise the user must be careful that the
  195. tracepoints in effect while looking at trace frames are identical to
  196. the ones in effect during the trace run; even a small discrepancy
  197. could cause &lsquo;<samp>tdump</samp>&rsquo; not to work, or a particular trace frame not
  198. be found.
  199. </p>
  200. </dd>
  201. <dt>&lsquo;<samp>QTDV:<var>n</var>:<var>value</var>:<var>builtin</var>:<var>name</var></samp>&rsquo;</dt>
  202. <dd><a name="index-define-trace-state-variable_002c-remote-request"></a>
  203. <a name="index-QTDV-packet"></a>
  204. <p>Create a new trace state variable, number <var>n</var>, with an initial
  205. value of <var>value</var>, which is a 64-bit signed integer. Both <var>n</var>
  206. and <var>value</var> are encoded as hexadecimal values. <small>GDB</small> has
  207. the option of not using this packet for initial values of zero; the
  208. target should simply create the trace state variables as they are
  209. mentioned in expressions. The value <var>builtin</var> should be 1 (one)
  210. if the trace state variable is builtin and 0 (zero) if it is not builtin.
  211. <small>GDB</small> only sets <var>builtin</var> to 1 if a previous &lsquo;<samp>qTfV</samp>&rsquo; or
  212. &lsquo;<samp>qTsV</samp>&rsquo; packet had it set. The contents of <var>name</var> is the
  213. hex-encoded name (without the leading &lsquo;<samp>$</samp>&rsquo;) of the trace state
  214. variable.
  215. </p>
  216. </dd>
  217. <dt>&lsquo;<samp>QTFrame:<var>n</var></samp>&rsquo;</dt>
  218. <dd><a name="index-QTFrame-packet"></a>
  219. <p>Select the <var>n</var>&rsquo;th tracepoint frame from the buffer, and use the
  220. register and memory contents recorded there to answer subsequent
  221. request packets from <small>GDB</small>.
  222. </p>
  223. <p>A successful reply from the stub indicates that the stub has found the
  224. requested frame. The response is a series of parts, concatenated
  225. without separators, describing the frame we selected. Each part has
  226. one of the following forms:
  227. </p>
  228. <dl compact="compact">
  229. <dt>&lsquo;<samp>F <var>f</var></samp>&rsquo;</dt>
  230. <dd><p>The selected frame is number <var>n</var> in the trace frame buffer;
  231. <var>f</var> is a hexadecimal number. If <var>f</var> is &lsquo;<samp>-1</samp>&rsquo;, then there
  232. was no frame matching the criteria in the request packet.
  233. </p>
  234. </dd>
  235. <dt>&lsquo;<samp>T <var>t</var></samp>&rsquo;</dt>
  236. <dd><p>The selected trace frame records a hit of tracepoint number <var>t</var>;
  237. <var>t</var> is a hexadecimal number.
  238. </p>
  239. </dd>
  240. </dl>
  241. </dd>
  242. <dt>&lsquo;<samp>QTFrame:pc:<var>addr</var></samp>&rsquo;</dt>
  243. <dd><p>Like &lsquo;<samp>QTFrame:<var>n</var></samp>&rsquo;, but select the first tracepoint frame after the
  244. currently selected frame whose PC is <var>addr</var>;
  245. <var>addr</var> is a hexadecimal number.
  246. </p>
  247. </dd>
  248. <dt>&lsquo;<samp>QTFrame:tdp:<var>t</var></samp>&rsquo;</dt>
  249. <dd><p>Like &lsquo;<samp>QTFrame:<var>n</var></samp>&rsquo;, but select the first tracepoint frame after the
  250. currently selected frame that is a hit of tracepoint <var>t</var>; <var>t</var>
  251. is a hexadecimal number.
  252. </p>
  253. </dd>
  254. <dt>&lsquo;<samp>QTFrame:range:<var>start</var>:<var>end</var></samp>&rsquo;</dt>
  255. <dd><p>Like &lsquo;<samp>QTFrame:<var>n</var></samp>&rsquo;, but select the first tracepoint frame after the
  256. currently selected frame whose PC is between <var>start</var> (inclusive)
  257. and <var>end</var> (inclusive); <var>start</var> and <var>end</var> are hexadecimal
  258. numbers.
  259. </p>
  260. </dd>
  261. <dt>&lsquo;<samp>QTFrame:outside:<var>start</var>:<var>end</var></samp>&rsquo;</dt>
  262. <dd><p>Like &lsquo;<samp>QTFrame:range:<var>start</var>:<var>end</var></samp>&rsquo;, but select the first
  263. frame <em>outside</em> the given range of addresses (exclusive).
  264. </p>
  265. </dd>
  266. <dt>&lsquo;<samp>qTMinFTPILen</samp>&rsquo;</dt>
  267. <dd><a name="index-qTMinFTPILen-packet"></a>
  268. <p>This packet requests the minimum length of instruction at which a fast
  269. tracepoint (see <a href="Set-Tracepoints.html#Set-Tracepoints">Set Tracepoints</a>) may be placed. For instance, on
  270. the 32-bit x86 architecture, it is possible to use a 4-byte jump, but
  271. it depends on the target system being able to create trampolines in
  272. the first 64K of memory, which might or might not be possible for that
  273. system. So the reply to this packet will be 4 if it is able to
  274. arrange for that.
  275. </p>
  276. <p>Replies:
  277. </p>
  278. <dl compact="compact">
  279. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  280. <dd><p>The minimum instruction length is currently unknown.
  281. </p></dd>
  282. <dt>&lsquo;<samp><var>length</var></samp>&rsquo;</dt>
  283. <dd><p>The minimum instruction length is <var>length</var>, where <var>length</var>
  284. is a hexadecimal number greater or equal to 1. A reply
  285. of 1 means that a fast tracepoint may be placed on any instruction
  286. regardless of size.
  287. </p></dd>
  288. <dt>&lsquo;<samp>E</samp>&rsquo;</dt>
  289. <dd><p>An error has occurred.
  290. </p></dd>
  291. <dt>&lsquo;<samp><!-- /@w --></samp>&rsquo;</dt>
  292. <dd><p>An empty reply indicates that the request is not supported by the stub.
  293. </p></dd>
  294. </dl>
  295. </dd>
  296. <dt>&lsquo;<samp>QTStart</samp>&rsquo;</dt>
  297. <dd><a name="index-QTStart-packet"></a>
  298. <p>Begin the tracepoint experiment. Begin collecting data from
  299. tracepoint hits in the trace frame buffer. This packet supports the
  300. &lsquo;<samp>qRelocInsn</samp>&rsquo; reply (see <a href="#Tracepoint-Packets">Relocate
  301. instruction reply packet</a>).
  302. </p>
  303. </dd>
  304. <dt>&lsquo;<samp>QTStop</samp>&rsquo;</dt>
  305. <dd><a name="index-QTStop-packet"></a>
  306. <p>End the tracepoint experiment. Stop collecting trace frames.
  307. </p>
  308. </dd>
  309. <dt>&lsquo;<samp>QTEnable:<var>n</var>:<var>addr</var></samp>&rsquo;</dt>
  310. <dd><a name="QTEnable"></a><a name="index-QTEnable-packet"></a>
  311. <p>Enable tracepoint <var>n</var> at address <var>addr</var> in a started tracepoint
  312. experiment. If the tracepoint was previously disabled, then collection
  313. of data from it will resume.
  314. </p>
  315. </dd>
  316. <dt>&lsquo;<samp>QTDisable:<var>n</var>:<var>addr</var></samp>&rsquo;</dt>
  317. <dd><a name="QTDisable"></a><a name="index-QTDisable-packet"></a>
  318. <p>Disable tracepoint <var>n</var> at address <var>addr</var> in a started tracepoint
  319. experiment. No more data will be collected from the tracepoint unless
  320. &lsquo;<samp>QTEnable:<var>n</var>:<var>addr</var></samp>&rsquo; is subsequently issued.
  321. </p>
  322. </dd>
  323. <dt>&lsquo;<samp>QTinit</samp>&rsquo;</dt>
  324. <dd><a name="index-QTinit-packet"></a>
  325. <p>Clear the table of tracepoints, and empty the trace frame buffer.
  326. </p>
  327. </dd>
  328. <dt>&lsquo;<samp>QTro:<var>start1</var>,<var>end1</var>:<var>start2</var>,<var>end2</var>:&hellip;</samp>&rsquo;</dt>
  329. <dd><a name="index-QTro-packet"></a>
  330. <p>Establish the given ranges of memory as &ldquo;transparent&rdquo;. The stub
  331. will answer requests for these ranges from memory&rsquo;s current contents,
  332. if they were not collected as part of the tracepoint hit.
  333. </p>
  334. <p><small>GDB</small> uses this to mark read-only regions of memory, like those
  335. containing program code. Since these areas never change, they should
  336. still have the same contents they did when the tracepoint was hit, so
  337. there&rsquo;s no reason for the stub to refuse to provide their contents.
  338. </p>
  339. </dd>
  340. <dt>&lsquo;<samp>QTDisconnected:<var>value</var></samp>&rsquo;</dt>
  341. <dd><a name="index-QTDisconnected-packet"></a>
  342. <p>Set the choice to what to do with the tracing run when <small>GDB</small>
  343. disconnects from the target. A <var>value</var> of 1 directs the target to
  344. continue the tracing run, while 0 tells the target to stop tracing if
  345. <small>GDB</small> is no longer in the picture.
  346. </p>
  347. </dd>
  348. <dt>&lsquo;<samp>qTStatus</samp>&rsquo;</dt>
  349. <dd><a name="index-qTStatus-packet"></a>
  350. <p>Ask the stub if there is a trace experiment running right now.
  351. </p>
  352. <p>The reply has the form:
  353. </p>
  354. <dl compact="compact">
  355. <dt>&lsquo;<samp>T<var>running</var><span class="roman">[</span>;<var>field</var><span class="roman">]</span>&hellip;</samp>&rsquo;</dt>
  356. <dd><p><var>running</var> is a single digit <code>1</code> if the trace is presently
  357. running, or <code>0</code> if not. It is followed by semicolon-separated
  358. optional fields that an agent may use to report additional status.
  359. </p>
  360. </dd>
  361. </dl>
  362. <p>If the trace is not running, the agent may report any of several
  363. explanations as one of the optional fields:
  364. </p>
  365. <dl compact="compact">
  366. <dt>&lsquo;<samp>tnotrun:0</samp>&rsquo;</dt>
  367. <dd><p>No trace has been run yet.
  368. </p>
  369. </dd>
  370. <dt>&lsquo;<samp>tstop[:<var>text</var>]:0</samp>&rsquo;</dt>
  371. <dd><p>The trace was stopped by a user-originated stop command. The optional
  372. <var>text</var> field is a user-supplied string supplied as part of the
  373. stop command (for instance, an explanation of why the trace was
  374. stopped manually). It is hex-encoded.
  375. </p>
  376. </dd>
  377. <dt>&lsquo;<samp>tfull:0</samp>&rsquo;</dt>
  378. <dd><p>The trace stopped because the trace buffer filled up.
  379. </p>
  380. </dd>
  381. <dt>&lsquo;<samp>tdisconnected:0</samp>&rsquo;</dt>
  382. <dd><p>The trace stopped because <small>GDB</small> disconnected from the target.
  383. </p>
  384. </dd>
  385. <dt>&lsquo;<samp>tpasscount:<var>tpnum</var></samp>&rsquo;</dt>
  386. <dd><p>The trace stopped because tracepoint <var>tpnum</var> exceeded its pass count.
  387. </p>
  388. </dd>
  389. <dt>&lsquo;<samp>terror:<var>text</var>:<var>tpnum</var></samp>&rsquo;</dt>
  390. <dd><p>The trace stopped because tracepoint <var>tpnum</var> had an error. The
  391. string <var>text</var> is available to describe the nature of the error
  392. (for instance, a divide by zero in the condition expression); it
  393. is hex encoded.
  394. </p>
  395. </dd>
  396. <dt>&lsquo;<samp>tunknown:0</samp>&rsquo;</dt>
  397. <dd><p>The trace stopped for some other reason.
  398. </p>
  399. </dd>
  400. </dl>
  401. <p>Additional optional fields supply statistical and other information.
  402. Although not required, they are extremely useful for users monitoring
  403. the progress of a trace run. If a trace has stopped, and these
  404. numbers are reported, they must reflect the state of the just-stopped
  405. trace.
  406. </p>
  407. <dl compact="compact">
  408. <dt>&lsquo;<samp>tframes:<var>n</var></samp>&rsquo;</dt>
  409. <dd><p>The number of trace frames in the buffer.
  410. </p>
  411. </dd>
  412. <dt>&lsquo;<samp>tcreated:<var>n</var></samp>&rsquo;</dt>
  413. <dd><p>The total number of trace frames created during the run. This may
  414. be larger than the trace frame count, if the buffer is circular.
  415. </p>
  416. </dd>
  417. <dt>&lsquo;<samp>tsize:<var>n</var></samp>&rsquo;</dt>
  418. <dd><p>The total size of the trace buffer, in bytes.
  419. </p>
  420. </dd>
  421. <dt>&lsquo;<samp>tfree:<var>n</var></samp>&rsquo;</dt>
  422. <dd><p>The number of bytes still unused in the buffer.
  423. </p>
  424. </dd>
  425. <dt>&lsquo;<samp>circular:<var>n</var></samp>&rsquo;</dt>
  426. <dd><p>The value of the circular trace buffer flag. <code>1</code> means that the
  427. trace buffer is circular and old trace frames will be discarded if
  428. necessary to make room, <code>0</code> means that the trace buffer is linear
  429. and may fill up.
  430. </p>
  431. </dd>
  432. <dt>&lsquo;<samp>disconn:<var>n</var></samp>&rsquo;</dt>
  433. <dd><p>The value of the disconnected tracing flag. <code>1</code> means that
  434. tracing will continue after <small>GDB</small> disconnects, <code>0</code> means
  435. that the trace run will stop.
  436. </p>
  437. </dd>
  438. </dl>
  439. </dd>
  440. <dt>&lsquo;<samp>qTP:<var>tp</var>:<var>addr</var></samp>&rsquo;</dt>
  441. <dd><a name="index-tracepoint-status_002c-remote-request"></a>
  442. <a name="index-qTP-packet"></a>
  443. <p>Ask the stub for the current state of tracepoint number <var>tp</var> at
  444. address <var>addr</var>.
  445. </p>
  446. <p>Replies:
  447. </p><dl compact="compact">
  448. <dt>&lsquo;<samp>V<var>hits</var>:<var>usage</var></samp>&rsquo;</dt>
  449. <dd><p>The tracepoint has been hit <var>hits</var> times so far during the trace
  450. run, and accounts for <var>usage</var> in the trace buffer. Note that
  451. <code>while-stepping</code> steps are not counted as separate hits, but the
  452. steps&rsquo; space consumption is added into the usage number.
  453. </p>
  454. </dd>
  455. </dl>
  456. </dd>
  457. <dt>&lsquo;<samp>qTV:<var>var</var></samp>&rsquo;</dt>
  458. <dd><a name="index-trace-state-variable-value_002c-remote-request"></a>
  459. <a name="index-qTV-packet"></a>
  460. <p>Ask the stub for the value of the trace state variable number <var>var</var>.
  461. </p>
  462. <p>Replies:
  463. </p><dl compact="compact">
  464. <dt>&lsquo;<samp>V<var>value</var></samp>&rsquo;</dt>
  465. <dd><p>The value of the variable is <var>value</var>. This will be the current
  466. value of the variable if the user is examining a running target, or a
  467. saved value if the variable was collected in the trace frame that the
  468. user is looking at. Note that multiple requests may result in
  469. different reply values, such as when requesting values while the
  470. program is running.
  471. </p>
  472. </dd>
  473. <dt>&lsquo;<samp>U</samp>&rsquo;</dt>
  474. <dd><p>The value of the variable is unknown. This would occur, for example,
  475. if the user is examining a trace frame in which the requested variable
  476. was not collected.
  477. </p></dd>
  478. </dl>
  479. </dd>
  480. <dt>&lsquo;<samp>qTfP</samp>&rsquo;</dt>
  481. <dd><a name="index-qTfP-packet"></a>
  482. </dd>
  483. <dt>&lsquo;<samp>qTsP</samp>&rsquo;</dt>
  484. <dd><a name="index-qTsP-packet"></a>
  485. <p>These packets request data about tracepoints that are being used by
  486. the target. <small>GDB</small> sends <code>qTfP</code> to get the first piece
  487. of data, and multiple <code>qTsP</code> to get additional pieces. Replies
  488. to these packets generally take the form of the <code>QTDP</code> packets
  489. that define tracepoints. (FIXME add detailed syntax)
  490. </p>
  491. </dd>
  492. <dt>&lsquo;<samp>qTfV</samp>&rsquo;</dt>
  493. <dd><a name="index-qTfV-packet"></a>
  494. </dd>
  495. <dt>&lsquo;<samp>qTsV</samp>&rsquo;</dt>
  496. <dd><a name="index-qTsV-packet"></a>
  497. <p>These packets request data about trace state variables that are on the
  498. target. <small>GDB</small> sends <code>qTfV</code> to get the first vari of data,
  499. and multiple <code>qTsV</code> to get additional variables. Replies to
  500. these packets follow the syntax of the <code>QTDV</code> packets that define
  501. trace state variables.
  502. </p>
  503. </dd>
  504. <dt>&lsquo;<samp>qTfSTM</samp>&rsquo;</dt>
  505. <dt>&lsquo;<samp>qTsSTM</samp>&rsquo;</dt>
  506. <dd><a name="qTfSTM"></a><a name="qTsSTM"></a><a name="index-qTfSTM-packet"></a>
  507. <a name="index-qTsSTM-packet"></a>
  508. <p>These packets request data about static tracepoint markers that exist
  509. in the target program. <small>GDB</small> sends <code>qTfSTM</code> to get the
  510. first piece of data, and multiple <code>qTsSTM</code> to get additional
  511. pieces. Replies to these packets take the following form:
  512. </p>
  513. <p>Reply:
  514. </p><dl compact="compact">
  515. <dt>&lsquo;<samp>m <var>address</var>:<var>id</var>:<var>extra</var></samp>&rsquo;</dt>
  516. <dd><p>A single marker
  517. </p></dd>
  518. <dt>&lsquo;<samp>m <var>address</var>:<var>id</var>:<var>extra</var>,<var>address</var>:<var>id</var>:<var>extra</var>&hellip;</samp>&rsquo;</dt>
  519. <dd><p>a comma-separated list of markers
  520. </p></dd>
  521. <dt>&lsquo;<samp>l</samp>&rsquo;</dt>
  522. <dd><p>(lower case letter &lsquo;<samp>L</samp>&rsquo;) denotes end of list.
  523. </p></dd>
  524. <dt>&lsquo;<samp>E <var>nn</var></samp>&rsquo;</dt>
  525. <dd><p>An error occurred. The error number <var>nn</var> is given as hex digits.
  526. </p></dd>
  527. <dt>&lsquo;<samp><!-- /@w --></samp>&rsquo;</dt>
  528. <dd><p>An empty reply indicates that the request is not supported by the
  529. stub.
  530. </p></dd>
  531. </dl>
  532. <p>The <var>address</var> is encoded in hex;
  533. <var>id</var> and <var>extra</var> are strings encoded in hex.
  534. </p>
  535. <p>In response to each query, the target will reply with a list of one or
  536. more markers, separated by commas. <small>GDB</small> will respond to each
  537. reply with a request for more markers (using the &lsquo;<samp>qs</samp>&rsquo; form of the
  538. query), until the target responds with &lsquo;<samp>l</samp>&rsquo; (lower-case ell, for
  539. <em>last</em>).
  540. </p>
  541. </dd>
  542. <dt>&lsquo;<samp>qTSTMat:<var>address</var></samp>&rsquo;</dt>
  543. <dd><a name="qTSTMat"></a><a name="index-qTSTMat-packet"></a>
  544. <p>This packets requests data about static tracepoint markers in the
  545. target program at <var>address</var>. Replies to this packet follow the
  546. syntax of the &lsquo;<samp>qTfSTM</samp>&rsquo; and <code>qTsSTM</code> packets that list static
  547. tracepoint markers.
  548. </p>
  549. </dd>
  550. <dt>&lsquo;<samp>QTSave:<var>filename</var></samp>&rsquo;</dt>
  551. <dd><a name="index-QTSave-packet"></a>
  552. <p>This packet directs the target to save trace data to the file name
  553. <var>filename</var> in the target&rsquo;s filesystem. The <var>filename</var> is encoded
  554. as a hex string; the interpretation of the file name (relative vs
  555. absolute, wild cards, etc) is up to the target.
  556. </p>
  557. </dd>
  558. <dt>&lsquo;<samp>qTBuffer:<var>offset</var>,<var>len</var></samp>&rsquo;</dt>
  559. <dd><a name="index-qTBuffer-packet"></a>
  560. <p>Return up to <var>len</var> bytes of the current contents of trace buffer,
  561. starting at <var>offset</var>. The trace buffer is treated as if it were
  562. a contiguous collection of traceframes, as per the trace file format.
  563. The reply consists as many hex-encoded bytes as the target can deliver
  564. in a packet; it is not an error to return fewer than were asked for.
  565. A reply consisting of just <code>l</code> indicates that no bytes are
  566. available.
  567. </p>
  568. </dd>
  569. <dt>&lsquo;<samp>QTBuffer:circular:<var>value</var></samp>&rsquo;</dt>
  570. <dd><p>This packet directs the target to use a circular trace buffer if
  571. <var>value</var> is 1, or a linear buffer if the value is 0.
  572. </p>
  573. </dd>
  574. <dt>&lsquo;<samp>QTBuffer:size:<var>size</var></samp>&rsquo;</dt>
  575. <dd><a name="QTBuffer_002dsize"></a><a name="index-QTBuffer-size-packet"></a>
  576. <p>This packet directs the target to make the trace buffer be of size
  577. <var>size</var> if possible. A value of <code>-1</code> tells the target to
  578. use whatever size it prefers.
  579. </p>
  580. </dd>
  581. <dt>&lsquo;<samp>QTNotes:<span class="roman">[</span><var>type</var>:<var>text</var><span class="roman">]</span><span class="roman">[</span>;<var>type</var>:<var>text</var><span class="roman">]</span>&hellip;</samp>&rsquo;</dt>
  582. <dd><a name="index-QTNotes-packet"></a>
  583. <p>This packet adds optional textual notes to the trace run. Allowable
  584. types include <code>user</code>, <code>notes</code>, and <code>tstop</code>, the
  585. <var>text</var> fields are arbitrary strings, hex-encoded.
  586. </p>
  587. </dd>
  588. </dl>
  589. <a name="Relocate-instruction-reply-packet"></a>
  590. <h4 class="subsection">E.6.1 Relocate instruction reply packet</h4>
  591. <p>When installing fast tracepoints in memory, the target may need to
  592. relocate the instruction currently at the tracepoint address to a
  593. different address in memory. For most instructions, a simple copy is
  594. enough, but, for example, call instructions that implicitly push the
  595. return address on the stack, and relative branches or other
  596. PC-relative instructions require offset adjustment, so that the effect
  597. of executing the instruction at a different address is the same as if
  598. it had executed in the original location.
  599. </p>
  600. <p>In response to several of the tracepoint packets, the target may also
  601. respond with a number of intermediate &lsquo;<samp>qRelocInsn</samp>&rsquo; request
  602. packets before the final result packet, to have <small>GDB</small> handle
  603. this relocation operation. If a packet supports this mechanism, its
  604. documentation will explicitly say so. See for example the above
  605. descriptions for the &lsquo;<samp>QTStart</samp>&rsquo; and &lsquo;<samp>QTDP</samp>&rsquo; packets. The
  606. format of the request is:
  607. </p>
  608. <dl compact="compact">
  609. <dt>&lsquo;<samp>qRelocInsn:<var>from</var>;<var>to</var></samp>&rsquo;</dt>
  610. <dd>
  611. <p>This requests <small>GDB</small> to copy instruction at address <var>from</var>
  612. to address <var>to</var>, possibly adjusted so that executing the
  613. instruction at <var>to</var> has the same effect as executing it at
  614. <var>from</var>. <small>GDB</small> writes the adjusted instruction to target
  615. memory starting at <var>to</var>.
  616. </p></dd>
  617. </dl>
  618. <p>Replies:
  619. </p><dl compact="compact">
  620. <dt>&lsquo;<samp>qRelocInsn:<var>adjusted_size</var></samp>&rsquo;</dt>
  621. <dd><p>Informs the stub the relocation is complete. The <var>adjusted_size</var> is
  622. the length in bytes of resulting relocated instruction sequence.
  623. </p></dd>
  624. <dt>&lsquo;<samp>E <var>NN</var></samp>&rsquo;</dt>
  625. <dd><p>A badly formed request was detected, or an error was encountered while
  626. relocating the instruction.
  627. </p></dd>
  628. </dl>
  629. <hr>
  630. <div class="header">
  631. <p>
  632. Next: <a href="Host-I_002fO-Packets.html#Host-I_002fO-Packets" accesskey="n" rel="next">Host I/O Packets</a>, Previous: <a href="Architecture_002dSpecific-Protocol-Details.html#Architecture_002dSpecific-Protocol-Details" accesskey="p" rel="prev">Architecture-Specific Protocol Details</a>, Up: <a href="Remote-Protocol.html#Remote-Protocol" accesskey="u" rel="up">Remote Protocol</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>
  633. </div>
  634. </body>
  635. </html>