GDB_002fMI-Data-Manipulation.html 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821
  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: GDB/MI Data Manipulation</title>
  16. <meta name="description" content="Debugging with GDB: GDB/MI Data Manipulation">
  17. <meta name="keywords" content="Debugging with GDB: GDB/MI Data Manipulation">
  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="GDB_002fMI.html#GDB_002fMI" rel="up" title="GDB/MI">
  26. <link href="GDB_002fMI-Tracepoint-Commands.html#GDB_002fMI-Tracepoint-Commands" rel="next" title="GDB/MI Tracepoint Commands">
  27. <link href="GDB_002fMI-Variable-Objects.html#GDB_002fMI-Variable-Objects" rel="previous" title="GDB/MI Variable Objects">
  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="GDB_002fMI-Data-Manipulation"></a>
  59. <div class="header">
  60. <p>
  61. Next: <a href="GDB_002fMI-Tracepoint-Commands.html#GDB_002fMI-Tracepoint-Commands" accesskey="n" rel="next">GDB/MI Tracepoint Commands</a>, Previous: <a href="GDB_002fMI-Variable-Objects.html#GDB_002fMI-Variable-Objects" accesskey="p" rel="previous">GDB/MI Variable Objects</a>, Up: <a href="GDB_002fMI.html#GDB_002fMI" accesskey="u" rel="up">GDB/MI</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="GDB_002fMI-Data-Manipulation-1"></a>
  65. <h3 class="section">27.16 <small>GDB/MI</small> Data Manipulation</h3>
  66. <a name="index-data-manipulation_002c-in-GDB_002fMI"></a>
  67. <a name="index-GDB_002fMI_002c-data-manipulation"></a>
  68. <p>This section describes the <small>GDB/MI</small> commands that manipulate data:
  69. examine memory and registers, evaluate expressions, etc.
  70. </p>
  71. <p>For details about what an addressable memory unit is,
  72. see <a href="Memory.html#addressable-memory-unit">addressable memory unit</a>.
  73. </p>
  74. <a name="The-_002ddata_002ddisassemble-Command"></a>
  75. <h4 class="subheading">The <code>-data-disassemble</code> Command</h4>
  76. <a name="index-_002ddata_002ddisassemble"></a>
  77. <a name="Synopsis-64"></a>
  78. <h4 class="subsubheading">Synopsis</h4>
  79. <div class="smallexample">
  80. <pre class="smallexample"> -data-disassemble
  81. [ -s <var>start-addr</var> -e <var>end-addr</var> ]
  82. | [ -a <var>addr</var> ]
  83. | [ -f <var>filename</var> -l <var>linenum</var> [ -n <var>lines</var> ] ]
  84. -- <var>mode</var>
  85. </pre></div>
  86. <p>Where:
  87. </p>
  88. <dl compact="compact">
  89. <dt>&lsquo;<samp><var>start-addr</var></samp>&rsquo;</dt>
  90. <dd><p>is the beginning address (or <code>$pc</code>)
  91. </p></dd>
  92. <dt>&lsquo;<samp><var>end-addr</var></samp>&rsquo;</dt>
  93. <dd><p>is the end address
  94. </p></dd>
  95. <dt>&lsquo;<samp><var>addr</var></samp>&rsquo;</dt>
  96. <dd><p>is an address anywhere within (or the name of) the function to
  97. disassemble. If an address is specified, the whole function
  98. surrounding that address will be disassembled. If a name is
  99. specified, the whole function with that name will be disassembled.
  100. </p></dd>
  101. <dt>&lsquo;<samp><var>filename</var></samp>&rsquo;</dt>
  102. <dd><p>is the name of the file to disassemble
  103. </p></dd>
  104. <dt>&lsquo;<samp><var>linenum</var></samp>&rsquo;</dt>
  105. <dd><p>is the line number to disassemble around
  106. </p></dd>
  107. <dt>&lsquo;<samp><var>lines</var></samp>&rsquo;</dt>
  108. <dd><p>is the number of disassembly lines to be produced. If it is -1,
  109. the whole function will be disassembled, in case no <var>end-addr</var> is
  110. specified. If <var>end-addr</var> is specified as a non-zero value, and
  111. <var>lines</var> is lower than the number of disassembly lines between
  112. <var>start-addr</var> and <var>end-addr</var>, only <var>lines</var> lines are
  113. displayed; if <var>lines</var> is higher than the number of lines between
  114. <var>start-addr</var> and <var>end-addr</var>, only the lines up to <var>end-addr</var>
  115. are displayed.
  116. </p></dd>
  117. <dt>&lsquo;<samp><var>mode</var></samp>&rsquo;</dt>
  118. <dd><p>is one of:
  119. </p><ul>
  120. <li> 0 disassembly only
  121. </li><li> 1 mixed source and disassembly (deprecated)
  122. </li><li> 2 disassembly with raw opcodes
  123. </li><li> 3 mixed source and disassembly with raw opcodes (deprecated)
  124. </li><li> 4 mixed source and disassembly
  125. </li><li> 5 mixed source and disassembly with raw opcodes
  126. </li></ul>
  127. <p>Modes 1 and 3 are deprecated. The output is &ldquo;source centric&rdquo;
  128. which hasn&rsquo;t proved useful in practice.
  129. See <a href="Machine-Code.html#Machine-Code">Machine Code</a>, for a discussion of the difference between
  130. <code>/m</code> and <code>/s</code> output of the <code>disassemble</code> command.
  131. </p></dd>
  132. </dl>
  133. <a name="Result-6"></a>
  134. <h4 class="subsubheading">Result</h4>
  135. <p>The result of the <code>-data-disassemble</code> command will be a list named
  136. &lsquo;<samp>asm_insns</samp>&rsquo;, the contents of this list depend on the <var>mode</var>
  137. used with the <code>-data-disassemble</code> command.
  138. </p>
  139. <p>For modes 0 and 2 the &lsquo;<samp>asm_insns</samp>&rsquo; list contains tuples with the
  140. following fields:
  141. </p>
  142. <dl compact="compact">
  143. <dt><code>address</code></dt>
  144. <dd><p>The address at which this instruction was disassembled.
  145. </p>
  146. </dd>
  147. <dt><code>func-name</code></dt>
  148. <dd><p>The name of the function this instruction is within.
  149. </p>
  150. </dd>
  151. <dt><code>offset</code></dt>
  152. <dd><p>The decimal offset in bytes from the start of &lsquo;<samp>func-name</samp>&rsquo;.
  153. </p>
  154. </dd>
  155. <dt><code>inst</code></dt>
  156. <dd><p>The text disassembly for this &lsquo;<samp>address</samp>&rsquo;.
  157. </p>
  158. </dd>
  159. <dt><code>opcodes</code></dt>
  160. <dd><p>This field is only present for modes 2, 3 and 5. This contains the raw opcode
  161. bytes for the &lsquo;<samp>inst</samp>&rsquo; field.
  162. </p>
  163. </dd>
  164. </dl>
  165. <p>For modes 1, 3, 4 and 5 the &lsquo;<samp>asm_insns</samp>&rsquo; list contains tuples named
  166. &lsquo;<samp>src_and_asm_line</samp>&rsquo;, each of which has the following fields:
  167. </p>
  168. <dl compact="compact">
  169. <dt><code>line</code></dt>
  170. <dd><p>The line number within &lsquo;<samp>file</samp>&rsquo;.
  171. </p>
  172. </dd>
  173. <dt><code>file</code></dt>
  174. <dd><p>The file name from the compilation unit. This might be an absolute
  175. file name or a relative file name depending on the compile command
  176. used.
  177. </p>
  178. </dd>
  179. <dt><code>fullname</code></dt>
  180. <dd><p>Absolute file name of &lsquo;<samp>file</samp>&rsquo;. It is converted to a canonical form
  181. using the source file search path
  182. (see <a href="Source-Path.html#Source-Path">Specifying Source Directories</a>)
  183. and after resolving all the symbolic links.
  184. </p>
  185. <p>If the source file is not found this field will contain the path as
  186. present in the debug information.
  187. </p>
  188. </dd>
  189. <dt><code>line_asm_insn</code></dt>
  190. <dd><p>This is a list of tuples containing the disassembly for &lsquo;<samp>line</samp>&rsquo; in
  191. &lsquo;<samp>file</samp>&rsquo;. The fields of each tuple are the same as for
  192. <code>-data-disassemble</code> in <var>mode</var> 0 and 2, so &lsquo;<samp>address</samp>&rsquo;,
  193. &lsquo;<samp>func-name</samp>&rsquo;, &lsquo;<samp>offset</samp>&rsquo;, &lsquo;<samp>inst</samp>&rsquo;, and optionally
  194. &lsquo;<samp>opcodes</samp>&rsquo;.
  195. </p>
  196. </dd>
  197. </dl>
  198. <p>Note that whatever included in the &lsquo;<samp>inst</samp>&rsquo; field, is not
  199. manipulated directly by <small>GDB/MI</small>, i.e., it is not possible to
  200. adjust its format.
  201. </p>
  202. <a name="GDB-Command-46"></a>
  203. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  204. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>disassemble</samp>&rsquo;.
  205. </p>
  206. <a name="Example-52"></a>
  207. <h4 class="subsubheading">Example</h4>
  208. <p>Disassemble from the current value of <code>$pc</code> to <code>$pc + 20</code>:
  209. </p>
  210. <div class="smallexample">
  211. <pre class="smallexample">(gdb)
  212. -data-disassemble -s $pc -e &quot;$pc + 20&quot; -- 0
  213. ^done,
  214. asm_insns=[
  215. {address=&quot;0x000107c0&quot;,func-name=&quot;main&quot;,offset=&quot;4&quot;,
  216. inst=&quot;mov 2, %o0&quot;},
  217. {address=&quot;0x000107c4&quot;,func-name=&quot;main&quot;,offset=&quot;8&quot;,
  218. inst=&quot;sethi %hi(0x11800), %o2&quot;},
  219. {address=&quot;0x000107c8&quot;,func-name=&quot;main&quot;,offset=&quot;12&quot;,
  220. inst=&quot;or %o2, 0x140, %o1\t! 0x11940 &lt;_lib_version+8&gt;&quot;},
  221. {address=&quot;0x000107cc&quot;,func-name=&quot;main&quot;,offset=&quot;16&quot;,
  222. inst=&quot;sethi %hi(0x11800), %o2&quot;},
  223. {address=&quot;0x000107d0&quot;,func-name=&quot;main&quot;,offset=&quot;20&quot;,
  224. inst=&quot;or %o2, 0x168, %o4\t! 0x11968 &lt;_lib_version+48&gt;&quot;}]
  225. (gdb)
  226. </pre></div>
  227. <p>Disassemble the whole <code>main</code> function. Line 32 is part of
  228. <code>main</code>.
  229. </p>
  230. <div class="smallexample">
  231. <pre class="smallexample">-data-disassemble -f basics.c -l 32 -- 0
  232. ^done,asm_insns=[
  233. {address=&quot;0x000107bc&quot;,func-name=&quot;main&quot;,offset=&quot;0&quot;,
  234. inst=&quot;save %sp, -112, %sp&quot;},
  235. {address=&quot;0x000107c0&quot;,func-name=&quot;main&quot;,offset=&quot;4&quot;,
  236. inst=&quot;mov 2, %o0&quot;},
  237. {address=&quot;0x000107c4&quot;,func-name=&quot;main&quot;,offset=&quot;8&quot;,
  238. inst=&quot;sethi %hi(0x11800), %o2&quot;},
  239. [&hellip;]
  240. {address=&quot;0x0001081c&quot;,func-name=&quot;main&quot;,offset=&quot;96&quot;,inst=&quot;ret &quot;},
  241. {address=&quot;0x00010820&quot;,func-name=&quot;main&quot;,offset=&quot;100&quot;,inst=&quot;restore &quot;}]
  242. (gdb)
  243. </pre></div>
  244. <p>Disassemble 3 instructions from the start of <code>main</code>:
  245. </p>
  246. <div class="smallexample">
  247. <pre class="smallexample">(gdb)
  248. -data-disassemble -f basics.c -l 32 -n 3 -- 0
  249. ^done,asm_insns=[
  250. {address=&quot;0x000107bc&quot;,func-name=&quot;main&quot;,offset=&quot;0&quot;,
  251. inst=&quot;save %sp, -112, %sp&quot;},
  252. {address=&quot;0x000107c0&quot;,func-name=&quot;main&quot;,offset=&quot;4&quot;,
  253. inst=&quot;mov 2, %o0&quot;},
  254. {address=&quot;0x000107c4&quot;,func-name=&quot;main&quot;,offset=&quot;8&quot;,
  255. inst=&quot;sethi %hi(0x11800), %o2&quot;}]
  256. (gdb)
  257. </pre></div>
  258. <p>Disassemble 3 instructions from the start of <code>main</code> in mixed mode:
  259. </p>
  260. <div class="smallexample">
  261. <pre class="smallexample">(gdb)
  262. -data-disassemble -f basics.c -l 32 -n 3 -- 1
  263. ^done,asm_insns=[
  264. src_and_asm_line={line=&quot;31&quot;,
  265. file=&quot;../../../src/gdb/testsuite/gdb.mi/basics.c&quot;,
  266. fullname=&quot;/absolute/path/to/src/gdb/testsuite/gdb.mi/basics.c&quot;,
  267. line_asm_insn=[{address=&quot;0x000107bc&quot;,
  268. func-name=&quot;main&quot;,offset=&quot;0&quot;,inst=&quot;save %sp, -112, %sp&quot;}]},
  269. src_and_asm_line={line=&quot;32&quot;,
  270. file=&quot;../../../src/gdb/testsuite/gdb.mi/basics.c&quot;,
  271. fullname=&quot;/absolute/path/to/src/gdb/testsuite/gdb.mi/basics.c&quot;,
  272. line_asm_insn=[{address=&quot;0x000107c0&quot;,
  273. func-name=&quot;main&quot;,offset=&quot;4&quot;,inst=&quot;mov 2, %o0&quot;},
  274. {address=&quot;0x000107c4&quot;,func-name=&quot;main&quot;,offset=&quot;8&quot;,
  275. inst=&quot;sethi %hi(0x11800), %o2&quot;}]}]
  276. (gdb)
  277. </pre></div>
  278. <a name="The-_002ddata_002devaluate_002dexpression-Command"></a>
  279. <h4 class="subheading">The <code>-data-evaluate-expression</code> Command</h4>
  280. <a name="index-_002ddata_002devaluate_002dexpression"></a>
  281. <a name="Synopsis-65"></a>
  282. <h4 class="subsubheading">Synopsis</h4>
  283. <div class="smallexample">
  284. <pre class="smallexample"> -data-evaluate-expression <var>expr</var>
  285. </pre></div>
  286. <p>Evaluate <var>expr</var> as an expression. The expression could contain an
  287. inferior function call. The function call will execute synchronously.
  288. If the expression contains spaces, it must be enclosed in double quotes.
  289. </p>
  290. <a name="GDB-Command-47"></a>
  291. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  292. <p>The corresponding <small>GDB</small> commands are &lsquo;<samp>print</samp>&rsquo;, &lsquo;<samp>output</samp>&rsquo;, and
  293. &lsquo;<samp>call</samp>&rsquo;. In <code>gdbtk</code> only, there&rsquo;s a corresponding
  294. &lsquo;<samp>gdb_eval</samp>&rsquo; command.
  295. </p>
  296. <a name="Example-53"></a>
  297. <h4 class="subsubheading">Example</h4>
  298. <p>In the following example, the numbers that precede the commands are the
  299. <em>tokens</em> described in <a href="GDB_002fMI-Command-Syntax.html#GDB_002fMI-Command-Syntax"><small>GDB/MI</small>
  300. Command Syntax</a>. Notice how <small>GDB/MI</small> returns the same tokens in its
  301. output.
  302. </p>
  303. <div class="smallexample">
  304. <pre class="smallexample">211-data-evaluate-expression A
  305. 211^done,value=&quot;1&quot;
  306. (gdb)
  307. 311-data-evaluate-expression &amp;A
  308. 311^done,value=&quot;0xefffeb7c&quot;
  309. (gdb)
  310. 411-data-evaluate-expression A+3
  311. 411^done,value=&quot;4&quot;
  312. (gdb)
  313. 511-data-evaluate-expression &quot;A + 3&quot;
  314. 511^done,value=&quot;4&quot;
  315. (gdb)
  316. </pre></div>
  317. <a name="The-_002ddata_002dlist_002dchanged_002dregisters-Command"></a>
  318. <h4 class="subheading">The <code>-data-list-changed-registers</code> Command</h4>
  319. <a name="index-_002ddata_002dlist_002dchanged_002dregisters"></a>
  320. <a name="Synopsis-66"></a>
  321. <h4 class="subsubheading">Synopsis</h4>
  322. <div class="smallexample">
  323. <pre class="smallexample"> -data-list-changed-registers
  324. </pre></div>
  325. <p>Display a list of the registers that have changed.
  326. </p>
  327. <a name="GDB-Command-48"></a>
  328. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  329. <p><small>GDB</small> doesn&rsquo;t have a direct analog for this command; <code>gdbtk</code>
  330. has the corresponding command &lsquo;<samp>gdb_changed_register_list</samp>&rsquo;.
  331. </p>
  332. <a name="Example-54"></a>
  333. <h4 class="subsubheading">Example</h4>
  334. <p>On a PPC MBX board:
  335. </p>
  336. <div class="smallexample">
  337. <pre class="smallexample">(gdb)
  338. -exec-continue
  339. ^running
  340. (gdb)
  341. *stopped,reason=&quot;breakpoint-hit&quot;,disp=&quot;keep&quot;,bkptno=&quot;1&quot;,frame={
  342. func=&quot;main&quot;,args=[],file=&quot;try.c&quot;,fullname=&quot;/home/foo/bar/try.c&quot;,
  343. line=&quot;5&quot;,arch=&quot;powerpc&quot;}
  344. (gdb)
  345. -data-list-changed-registers
  346. ^done,changed-registers=[&quot;0&quot;,&quot;1&quot;,&quot;2&quot;,&quot;4&quot;,&quot;5&quot;,&quot;6&quot;,&quot;7&quot;,&quot;8&quot;,&quot;9&quot;,
  347. &quot;10&quot;,&quot;11&quot;,&quot;13&quot;,&quot;14&quot;,&quot;15&quot;,&quot;16&quot;,&quot;17&quot;,&quot;18&quot;,&quot;19&quot;,&quot;20&quot;,&quot;21&quot;,&quot;22&quot;,&quot;23&quot;,
  348. &quot;24&quot;,&quot;25&quot;,&quot;26&quot;,&quot;27&quot;,&quot;28&quot;,&quot;30&quot;,&quot;31&quot;,&quot;64&quot;,&quot;65&quot;,&quot;66&quot;,&quot;67&quot;,&quot;69&quot;]
  349. (gdb)
  350. </pre></div>
  351. <a name="The-_002ddata_002dlist_002dregister_002dnames-Command"></a>
  352. <h4 class="subheading">The <code>-data-list-register-names</code> Command</h4>
  353. <a name="index-_002ddata_002dlist_002dregister_002dnames"></a>
  354. <a name="Synopsis-67"></a>
  355. <h4 class="subsubheading">Synopsis</h4>
  356. <div class="smallexample">
  357. <pre class="smallexample"> -data-list-register-names [ ( <var>regno</var> )+ ]
  358. </pre></div>
  359. <p>Show a list of register names for the current target. If no arguments
  360. are given, it shows a list of the names of all the registers. If
  361. integer numbers are given as arguments, it will print a list of the
  362. names of the registers corresponding to the arguments. To ensure
  363. consistency between a register name and its number, the output list may
  364. include empty register names.
  365. </p>
  366. <a name="GDB-Command-49"></a>
  367. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  368. <p><small>GDB</small> does not have a command which corresponds to
  369. &lsquo;<samp>-data-list-register-names</samp>&rsquo;. In <code>gdbtk</code> there is a
  370. corresponding command &lsquo;<samp>gdb_regnames</samp>&rsquo;.
  371. </p>
  372. <a name="Example-55"></a>
  373. <h4 class="subsubheading">Example</h4>
  374. <p>For the PPC MBX board:
  375. </p><div class="smallexample">
  376. <pre class="smallexample">(gdb)
  377. -data-list-register-names
  378. ^done,register-names=[&quot;r0&quot;,&quot;r1&quot;,&quot;r2&quot;,&quot;r3&quot;,&quot;r4&quot;,&quot;r5&quot;,&quot;r6&quot;,&quot;r7&quot;,
  379. &quot;r8&quot;,&quot;r9&quot;,&quot;r10&quot;,&quot;r11&quot;,&quot;r12&quot;,&quot;r13&quot;,&quot;r14&quot;,&quot;r15&quot;,&quot;r16&quot;,&quot;r17&quot;,&quot;r18&quot;,
  380. &quot;r19&quot;,&quot;r20&quot;,&quot;r21&quot;,&quot;r22&quot;,&quot;r23&quot;,&quot;r24&quot;,&quot;r25&quot;,&quot;r26&quot;,&quot;r27&quot;,&quot;r28&quot;,&quot;r29&quot;,
  381. &quot;r30&quot;,&quot;r31&quot;,&quot;f0&quot;,&quot;f1&quot;,&quot;f2&quot;,&quot;f3&quot;,&quot;f4&quot;,&quot;f5&quot;,&quot;f6&quot;,&quot;f7&quot;,&quot;f8&quot;,&quot;f9&quot;,
  382. &quot;f10&quot;,&quot;f11&quot;,&quot;f12&quot;,&quot;f13&quot;,&quot;f14&quot;,&quot;f15&quot;,&quot;f16&quot;,&quot;f17&quot;,&quot;f18&quot;,&quot;f19&quot;,&quot;f20&quot;,
  383. &quot;f21&quot;,&quot;f22&quot;,&quot;f23&quot;,&quot;f24&quot;,&quot;f25&quot;,&quot;f26&quot;,&quot;f27&quot;,&quot;f28&quot;,&quot;f29&quot;,&quot;f30&quot;,&quot;f31&quot;,
  384. &quot;&quot;, &quot;pc&quot;,&quot;ps&quot;,&quot;cr&quot;,&quot;lr&quot;,&quot;ctr&quot;,&quot;xer&quot;]
  385. (gdb)
  386. -data-list-register-names 1 2 3
  387. ^done,register-names=[&quot;r1&quot;,&quot;r2&quot;,&quot;r3&quot;]
  388. (gdb)
  389. </pre></div>
  390. <a name="The-_002ddata_002dlist_002dregister_002dvalues-Command"></a>
  391. <h4 class="subheading">The <code>-data-list-register-values</code> Command</h4>
  392. <a name="index-_002ddata_002dlist_002dregister_002dvalues"></a>
  393. <a name="Synopsis-68"></a>
  394. <h4 class="subsubheading">Synopsis</h4>
  395. <div class="smallexample">
  396. <pre class="smallexample"> -data-list-register-values
  397. [ <code>--skip-unavailable</code> ] <var>fmt</var> [ ( <var>regno</var> )*]
  398. </pre></div>
  399. <p>Display the registers&rsquo; contents. The format according to which the
  400. registers&rsquo; contents are to be returned is given by <var>fmt</var>, followed
  401. by an optional list of numbers specifying the registers to display. A
  402. missing list of numbers indicates that the contents of all the
  403. registers must be returned. The <code>--skip-unavailable</code> option
  404. indicates that only the available registers are to be returned.
  405. </p>
  406. <p>Allowed formats for <var>fmt</var> are:
  407. </p>
  408. <dl compact="compact">
  409. <dt><code>x</code></dt>
  410. <dd><p>Hexadecimal
  411. </p></dd>
  412. <dt><code>o</code></dt>
  413. <dd><p>Octal
  414. </p></dd>
  415. <dt><code>t</code></dt>
  416. <dd><p>Binary
  417. </p></dd>
  418. <dt><code>d</code></dt>
  419. <dd><p>Decimal
  420. </p></dd>
  421. <dt><code>r</code></dt>
  422. <dd><p>Raw
  423. </p></dd>
  424. <dt><code>N</code></dt>
  425. <dd><p>Natural
  426. </p></dd>
  427. </dl>
  428. <a name="GDB-Command-50"></a>
  429. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  430. <p>The corresponding <small>GDB</small> commands are &lsquo;<samp>info reg</samp>&rsquo;, &lsquo;<samp>info
  431. all-reg</samp>&rsquo;, and (in <code>gdbtk</code>) &lsquo;<samp>gdb_fetch_registers</samp>&rsquo;.
  432. </p>
  433. <a name="Example-56"></a>
  434. <h4 class="subsubheading">Example</h4>
  435. <p>For a PPC MBX board (note: line breaks are for readability only, they
  436. don&rsquo;t appear in the actual output):
  437. </p>
  438. <div class="smallexample">
  439. <pre class="smallexample">(gdb)
  440. -data-list-register-values r 64 65
  441. ^done,register-values=[{number=&quot;64&quot;,value=&quot;0xfe00a300&quot;},
  442. {number=&quot;65&quot;,value=&quot;0x00029002&quot;}]
  443. (gdb)
  444. -data-list-register-values x
  445. ^done,register-values=[{number=&quot;0&quot;,value=&quot;0xfe0043c8&quot;},
  446. {number=&quot;1&quot;,value=&quot;0x3fff88&quot;},{number=&quot;2&quot;,value=&quot;0xfffffffe&quot;},
  447. {number=&quot;3&quot;,value=&quot;0x0&quot;},{number=&quot;4&quot;,value=&quot;0xa&quot;},
  448. {number=&quot;5&quot;,value=&quot;0x3fff68&quot;},{number=&quot;6&quot;,value=&quot;0x3fff58&quot;},
  449. {number=&quot;7&quot;,value=&quot;0xfe011e98&quot;},{number=&quot;8&quot;,value=&quot;0x2&quot;},
  450. {number=&quot;9&quot;,value=&quot;0xfa202820&quot;},{number=&quot;10&quot;,value=&quot;0xfa202808&quot;},
  451. {number=&quot;11&quot;,value=&quot;0x1&quot;},{number=&quot;12&quot;,value=&quot;0x0&quot;},
  452. {number=&quot;13&quot;,value=&quot;0x4544&quot;},{number=&quot;14&quot;,value=&quot;0xffdfffff&quot;},
  453. {number=&quot;15&quot;,value=&quot;0xffffffff&quot;},{number=&quot;16&quot;,value=&quot;0xfffffeff&quot;},
  454. {number=&quot;17&quot;,value=&quot;0xefffffed&quot;},{number=&quot;18&quot;,value=&quot;0xfffffffe&quot;},
  455. {number=&quot;19&quot;,value=&quot;0xffffffff&quot;},{number=&quot;20&quot;,value=&quot;0xffffffff&quot;},
  456. {number=&quot;21&quot;,value=&quot;0xffffffff&quot;},{number=&quot;22&quot;,value=&quot;0xfffffff7&quot;},
  457. {number=&quot;23&quot;,value=&quot;0xffffffff&quot;},{number=&quot;24&quot;,value=&quot;0xffffffff&quot;},
  458. {number=&quot;25&quot;,value=&quot;0xffffffff&quot;},{number=&quot;26&quot;,value=&quot;0xfffffffb&quot;},
  459. {number=&quot;27&quot;,value=&quot;0xffffffff&quot;},{number=&quot;28&quot;,value=&quot;0xf7bfffff&quot;},
  460. {number=&quot;29&quot;,value=&quot;0x0&quot;},{number=&quot;30&quot;,value=&quot;0xfe010000&quot;},
  461. {number=&quot;31&quot;,value=&quot;0x0&quot;},{number=&quot;32&quot;,value=&quot;0x0&quot;},
  462. {number=&quot;33&quot;,value=&quot;0x0&quot;},{number=&quot;34&quot;,value=&quot;0x0&quot;},
  463. {number=&quot;35&quot;,value=&quot;0x0&quot;},{number=&quot;36&quot;,value=&quot;0x0&quot;},
  464. {number=&quot;37&quot;,value=&quot;0x0&quot;},{number=&quot;38&quot;,value=&quot;0x0&quot;},
  465. {number=&quot;39&quot;,value=&quot;0x0&quot;},{number=&quot;40&quot;,value=&quot;0x0&quot;},
  466. {number=&quot;41&quot;,value=&quot;0x0&quot;},{number=&quot;42&quot;,value=&quot;0x0&quot;},
  467. {number=&quot;43&quot;,value=&quot;0x0&quot;},{number=&quot;44&quot;,value=&quot;0x0&quot;},
  468. {number=&quot;45&quot;,value=&quot;0x0&quot;},{number=&quot;46&quot;,value=&quot;0x0&quot;},
  469. {number=&quot;47&quot;,value=&quot;0x0&quot;},{number=&quot;48&quot;,value=&quot;0x0&quot;},
  470. {number=&quot;49&quot;,value=&quot;0x0&quot;},{number=&quot;50&quot;,value=&quot;0x0&quot;},
  471. {number=&quot;51&quot;,value=&quot;0x0&quot;},{number=&quot;52&quot;,value=&quot;0x0&quot;},
  472. {number=&quot;53&quot;,value=&quot;0x0&quot;},{number=&quot;54&quot;,value=&quot;0x0&quot;},
  473. {number=&quot;55&quot;,value=&quot;0x0&quot;},{number=&quot;56&quot;,value=&quot;0x0&quot;},
  474. {number=&quot;57&quot;,value=&quot;0x0&quot;},{number=&quot;58&quot;,value=&quot;0x0&quot;},
  475. {number=&quot;59&quot;,value=&quot;0x0&quot;},{number=&quot;60&quot;,value=&quot;0x0&quot;},
  476. {number=&quot;61&quot;,value=&quot;0x0&quot;},{number=&quot;62&quot;,value=&quot;0x0&quot;},
  477. {number=&quot;63&quot;,value=&quot;0x0&quot;},{number=&quot;64&quot;,value=&quot;0xfe00a300&quot;},
  478. {number=&quot;65&quot;,value=&quot;0x29002&quot;},{number=&quot;66&quot;,value=&quot;0x202f04b5&quot;},
  479. {number=&quot;67&quot;,value=&quot;0xfe0043b0&quot;},{number=&quot;68&quot;,value=&quot;0xfe00b3e4&quot;},
  480. {number=&quot;69&quot;,value=&quot;0x20002b03&quot;}]
  481. (gdb)
  482. </pre></div>
  483. <a name="The-_002ddata_002dread_002dmemory-Command"></a>
  484. <h4 class="subheading">The <code>-data-read-memory</code> Command</h4>
  485. <a name="index-_002ddata_002dread_002dmemory"></a>
  486. <p>This command is deprecated, use <code>-data-read-memory-bytes</code> instead.
  487. </p>
  488. <a name="Synopsis-69"></a>
  489. <h4 class="subsubheading">Synopsis</h4>
  490. <div class="smallexample">
  491. <pre class="smallexample"> -data-read-memory [ -o <var>byte-offset</var> ]
  492. <var>address</var> <var>word-format</var> <var>word-size</var>
  493. <var>nr-rows</var> <var>nr-cols</var> [ <var>aschar</var> ]
  494. </pre></div>
  495. <p>where:
  496. </p>
  497. <dl compact="compact">
  498. <dt>&lsquo;<samp><var>address</var></samp>&rsquo;</dt>
  499. <dd><p>An expression specifying the address of the first memory word to be
  500. read. Complex expressions containing embedded white space should be
  501. quoted using the C convention.
  502. </p>
  503. </dd>
  504. <dt>&lsquo;<samp><var>word-format</var></samp>&rsquo;</dt>
  505. <dd><p>The format to be used to print the memory words. The notation is the
  506. same as for <small>GDB</small>&rsquo;s <code>print</code> command (see <a href="Output-Formats.html#Output-Formats">Output Formats</a>).
  507. </p>
  508. </dd>
  509. <dt>&lsquo;<samp><var>word-size</var></samp>&rsquo;</dt>
  510. <dd><p>The size of each memory word in bytes.
  511. </p>
  512. </dd>
  513. <dt>&lsquo;<samp><var>nr-rows</var></samp>&rsquo;</dt>
  514. <dd><p>The number of rows in the output table.
  515. </p>
  516. </dd>
  517. <dt>&lsquo;<samp><var>nr-cols</var></samp>&rsquo;</dt>
  518. <dd><p>The number of columns in the output table.
  519. </p>
  520. </dd>
  521. <dt>&lsquo;<samp><var>aschar</var></samp>&rsquo;</dt>
  522. <dd><p>If present, indicates that each row should include an <small>ASCII</small> dump. The
  523. value of <var>aschar</var> is used as a padding character when a byte is not a
  524. member of the printable <small>ASCII</small> character set (printable <small>ASCII</small>
  525. characters are those whose code is between 32 and 126, inclusively).
  526. </p>
  527. </dd>
  528. <dt>&lsquo;<samp><var>byte-offset</var></samp>&rsquo;</dt>
  529. <dd><p>An offset to add to the <var>address</var> before fetching memory.
  530. </p></dd>
  531. </dl>
  532. <p>This command displays memory contents as a table of <var>nr-rows</var> by
  533. <var>nr-cols</var> words, each word being <var>word-size</var> bytes. In total,
  534. <code><var>nr-rows</var> * <var>nr-cols</var> * <var>word-size</var></code> bytes are read
  535. (returned as &lsquo;<samp>total-bytes</samp>&rsquo;). Should less than the requested number
  536. of bytes be returned by the target, the missing words are identified
  537. using &lsquo;<samp>N/A</samp>&rsquo;. The number of bytes read from the target is returned
  538. in &lsquo;<samp>nr-bytes</samp>&rsquo; and the starting address used to read memory in
  539. &lsquo;<samp>addr</samp>&rsquo;.
  540. </p>
  541. <p>The address of the next/previous row or page is available in
  542. &lsquo;<samp>next-row</samp>&rsquo; and &lsquo;<samp>prev-row</samp>&rsquo;, &lsquo;<samp>next-page</samp>&rsquo; and
  543. &lsquo;<samp>prev-page</samp>&rsquo;.
  544. </p>
  545. <a name="GDB-Command-51"></a>
  546. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  547. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>x</samp>&rsquo;. <code>gdbtk</code> has
  548. &lsquo;<samp>gdb_get_mem</samp>&rsquo; memory read command.
  549. </p>
  550. <a name="Example-57"></a>
  551. <h4 class="subsubheading">Example</h4>
  552. <p>Read six bytes of memory starting at <code>bytes+6</code> but then offset by
  553. <code>-6</code> bytes. Format as three rows of two columns. One byte per
  554. word. Display each word in hex.
  555. </p>
  556. <div class="smallexample">
  557. <pre class="smallexample">(gdb)
  558. 9-data-read-memory -o -6 -- bytes+6 x 1 3 2
  559. 9^done,addr=&quot;0x00001390&quot;,nr-bytes=&quot;6&quot;,total-bytes=&quot;6&quot;,
  560. next-row=&quot;0x00001396&quot;,prev-row=&quot;0x0000138e&quot;,next-page=&quot;0x00001396&quot;,
  561. prev-page=&quot;0x0000138a&quot;,memory=[
  562. {addr=&quot;0x00001390&quot;,data=[&quot;0x00&quot;,&quot;0x01&quot;]},
  563. {addr=&quot;0x00001392&quot;,data=[&quot;0x02&quot;,&quot;0x03&quot;]},
  564. {addr=&quot;0x00001394&quot;,data=[&quot;0x04&quot;,&quot;0x05&quot;]}]
  565. (gdb)
  566. </pre></div>
  567. <p>Read two bytes of memory starting at address <code>shorts + 64</code> and
  568. display as a single word formatted in decimal.
  569. </p>
  570. <div class="smallexample">
  571. <pre class="smallexample">(gdb)
  572. 5-data-read-memory shorts+64 d 2 1 1
  573. 5^done,addr=&quot;0x00001510&quot;,nr-bytes=&quot;2&quot;,total-bytes=&quot;2&quot;,
  574. next-row=&quot;0x00001512&quot;,prev-row=&quot;0x0000150e&quot;,
  575. next-page=&quot;0x00001512&quot;,prev-page=&quot;0x0000150e&quot;,memory=[
  576. {addr=&quot;0x00001510&quot;,data=[&quot;128&quot;]}]
  577. (gdb)
  578. </pre></div>
  579. <p>Read thirty two bytes of memory starting at <code>bytes+16</code> and format
  580. as eight rows of four columns. Include a string encoding with &lsquo;<samp>x</samp>&rsquo;
  581. used as the non-printable character.
  582. </p>
  583. <div class="smallexample">
  584. <pre class="smallexample">(gdb)
  585. 4-data-read-memory bytes+16 x 1 8 4 x
  586. 4^done,addr=&quot;0x000013a0&quot;,nr-bytes=&quot;32&quot;,total-bytes=&quot;32&quot;,
  587. next-row=&quot;0x000013c0&quot;,prev-row=&quot;0x0000139c&quot;,
  588. next-page=&quot;0x000013c0&quot;,prev-page=&quot;0x00001380&quot;,memory=[
  589. {addr=&quot;0x000013a0&quot;,data=[&quot;0x10&quot;,&quot;0x11&quot;,&quot;0x12&quot;,&quot;0x13&quot;],ascii=&quot;xxxx&quot;},
  590. {addr=&quot;0x000013a4&quot;,data=[&quot;0x14&quot;,&quot;0x15&quot;,&quot;0x16&quot;,&quot;0x17&quot;],ascii=&quot;xxxx&quot;},
  591. {addr=&quot;0x000013a8&quot;,data=[&quot;0x18&quot;,&quot;0x19&quot;,&quot;0x1a&quot;,&quot;0x1b&quot;],ascii=&quot;xxxx&quot;},
  592. {addr=&quot;0x000013ac&quot;,data=[&quot;0x1c&quot;,&quot;0x1d&quot;,&quot;0x1e&quot;,&quot;0x1f&quot;],ascii=&quot;xxxx&quot;},
  593. {addr=&quot;0x000013b0&quot;,data=[&quot;0x20&quot;,&quot;0x21&quot;,&quot;0x22&quot;,&quot;0x23&quot;],ascii=&quot; !\&quot;#&quot;},
  594. {addr=&quot;0x000013b4&quot;,data=[&quot;0x24&quot;,&quot;0x25&quot;,&quot;0x26&quot;,&quot;0x27&quot;],ascii=&quot;$%&amp;'&quot;},
  595. {addr=&quot;0x000013b8&quot;,data=[&quot;0x28&quot;,&quot;0x29&quot;,&quot;0x2a&quot;,&quot;0x2b&quot;],ascii=&quot;()*+&quot;},
  596. {addr=&quot;0x000013bc&quot;,data=[&quot;0x2c&quot;,&quot;0x2d&quot;,&quot;0x2e&quot;,&quot;0x2f&quot;],ascii=&quot;,-./&quot;}]
  597. (gdb)
  598. </pre></div>
  599. <a name="The-_002ddata_002dread_002dmemory_002dbytes-Command"></a>
  600. <h4 class="subheading">The <code>-data-read-memory-bytes</code> Command</h4>
  601. <a name="index-_002ddata_002dread_002dmemory_002dbytes"></a>
  602. <a name="Synopsis-70"></a>
  603. <h4 class="subsubheading">Synopsis</h4>
  604. <div class="smallexample">
  605. <pre class="smallexample"> -data-read-memory-bytes [ -o <var>offset</var> ]
  606. <var>address</var> <var>count</var>
  607. </pre></div>
  608. <p>where:
  609. </p>
  610. <dl compact="compact">
  611. <dt>&lsquo;<samp><var>address</var></samp>&rsquo;</dt>
  612. <dd><p>An expression specifying the address of the first addressable memory unit
  613. to be read. Complex expressions containing embedded white space should be
  614. quoted using the C convention.
  615. </p>
  616. </dd>
  617. <dt>&lsquo;<samp><var>count</var></samp>&rsquo;</dt>
  618. <dd><p>The number of addressable memory units to read. This should be an integer
  619. literal.
  620. </p>
  621. </dd>
  622. <dt>&lsquo;<samp><var>offset</var></samp>&rsquo;</dt>
  623. <dd><p>The offset relative to <var>address</var> at which to start reading. This
  624. should be an integer literal. This option is provided so that a frontend
  625. is not required to first evaluate address and then perform address
  626. arithmetics itself.
  627. </p>
  628. </dd>
  629. </dl>
  630. <p>This command attempts to read all accessible memory regions in the
  631. specified range. First, all regions marked as unreadable in the memory
  632. map (if one is defined) will be skipped. See <a href="Memory-Region-Attributes.html#Memory-Region-Attributes">Memory Region Attributes</a>. Second, <small>GDB</small> will attempt to read the remaining
  633. regions. For each one, if reading full region results in an errors,
  634. <small>GDB</small> will try to read a subset of the region.
  635. </p>
  636. <p>In general, every single memory unit in the region may be readable or not,
  637. and the only way to read every readable unit is to try a read at
  638. every address, which is not practical. Therefore, <small>GDB</small> will
  639. attempt to read all accessible memory units at either beginning or the end
  640. of the region, using a binary division scheme. This heuristic works
  641. well for reading across a memory map boundary. Note that if a region
  642. has a readable range that is neither at the beginning or the end,
  643. <small>GDB</small> will not read it.
  644. </p>
  645. <p>The result record (see <a href="GDB_002fMI-Result-Records.html#GDB_002fMI-Result-Records">GDB/MI Result Records</a>) that is output of
  646. the command includes a field named &lsquo;<samp>memory</samp>&rsquo; whose content is a
  647. list of tuples. Each tuple represent a successfully read memory block
  648. and has the following fields:
  649. </p>
  650. <dl compact="compact">
  651. <dt><code>begin</code></dt>
  652. <dd><p>The start address of the memory block, as hexadecimal literal.
  653. </p>
  654. </dd>
  655. <dt><code>end</code></dt>
  656. <dd><p>The end address of the memory block, as hexadecimal literal.
  657. </p>
  658. </dd>
  659. <dt><code>offset</code></dt>
  660. <dd><p>The offset of the memory block, as hexadecimal literal, relative to
  661. the start address passed to <code>-data-read-memory-bytes</code>.
  662. </p>
  663. </dd>
  664. <dt><code>contents</code></dt>
  665. <dd><p>The contents of the memory block, in hex.
  666. </p>
  667. </dd>
  668. </dl>
  669. <a name="GDB-Command-52"></a>
  670. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  671. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>x</samp>&rsquo;.
  672. </p>
  673. <a name="Example-58"></a>
  674. <h4 class="subsubheading">Example</h4>
  675. <div class="smallexample">
  676. <pre class="smallexample">(gdb)
  677. -data-read-memory-bytes &amp;a 10
  678. ^done,memory=[{begin=&quot;0xbffff154&quot;,offset=&quot;0x00000000&quot;,
  679. end=&quot;0xbffff15e&quot;,
  680. contents=&quot;01000000020000000300&quot;}]
  681. (gdb)
  682. </pre></div>
  683. <a name="The-_002ddata_002dwrite_002dmemory_002dbytes-Command"></a>
  684. <h4 class="subheading">The <code>-data-write-memory-bytes</code> Command</h4>
  685. <a name="index-_002ddata_002dwrite_002dmemory_002dbytes"></a>
  686. <a name="Synopsis-71"></a>
  687. <h4 class="subsubheading">Synopsis</h4>
  688. <div class="smallexample">
  689. <pre class="smallexample"> -data-write-memory-bytes <var>address</var> <var>contents</var>
  690. -data-write-memory-bytes <var>address</var> <var>contents</var> <span class="roman">[</span><var>count</var><span class="roman">]</span>
  691. </pre></div>
  692. <p>where:
  693. </p>
  694. <dl compact="compact">
  695. <dt>&lsquo;<samp><var>address</var></samp>&rsquo;</dt>
  696. <dd><p>An expression specifying the address of the first addressable memory unit
  697. to be written. Complex expressions containing embedded white space should
  698. be quoted using the C convention.
  699. </p>
  700. </dd>
  701. <dt>&lsquo;<samp><var>contents</var></samp>&rsquo;</dt>
  702. <dd><p>The hex-encoded data to write. It is an error if <var>contents</var> does
  703. not represent an integral number of addressable memory units.
  704. </p>
  705. </dd>
  706. <dt>&lsquo;<samp><var>count</var></samp>&rsquo;</dt>
  707. <dd><p>Optional argument indicating the number of addressable memory units to be
  708. written. If <var>count</var> is greater than <var>contents</var>&rsquo; length,
  709. <small>GDB</small> will repeatedly write <var>contents</var> until it fills
  710. <var>count</var> memory units.
  711. </p>
  712. </dd>
  713. </dl>
  714. <a name="GDB-Command-53"></a>
  715. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  716. <p>There&rsquo;s no corresponding <small>GDB</small> command.
  717. </p>
  718. <a name="Example-59"></a>
  719. <h4 class="subsubheading">Example</h4>
  720. <div class="smallexample">
  721. <pre class="smallexample">(gdb)
  722. -data-write-memory-bytes &amp;a &quot;aabbccdd&quot;
  723. ^done
  724. (gdb)
  725. </pre></div>
  726. <div class="smallexample">
  727. <pre class="smallexample">(gdb)
  728. -data-write-memory-bytes &amp;a &quot;aabbccdd&quot; 16e
  729. ^done
  730. (gdb)
  731. </pre></div>
  732. <hr>
  733. <div class="header">
  734. <p>
  735. Next: <a href="GDB_002fMI-Tracepoint-Commands.html#GDB_002fMI-Tracepoint-Commands" accesskey="n" rel="next">GDB/MI Tracepoint Commands</a>, Previous: <a href="GDB_002fMI-Variable-Objects.html#GDB_002fMI-Variable-Objects" accesskey="p" rel="previous">GDB/MI Variable Objects</a>, Up: <a href="GDB_002fMI.html#GDB_002fMI" accesskey="u" rel="up">GDB/MI</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>
  736. </div>
  737. </body>
  738. </html>