GDB_002fMI-Variable-Objects.html 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963
  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 Variable Objects</title>
  16. <meta name="description" content="Debugging with GDB: GDB/MI Variable Objects">
  17. <meta name="keywords" content="Debugging with GDB: GDB/MI Variable Objects">
  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-Data-Manipulation.html#GDB_002fMI-Data-Manipulation" rel="next" title="GDB/MI Data Manipulation">
  27. <link href="GDB_002fMI-Stack-Manipulation.html#GDB_002fMI-Stack-Manipulation" rel="previous" title="GDB/MI Stack Manipulation">
  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-Variable-Objects"></a>
  59. <div class="header">
  60. <p>
  61. Next: <a href="GDB_002fMI-Data-Manipulation.html#GDB_002fMI-Data-Manipulation" accesskey="n" rel="next">GDB/MI Data Manipulation</a>, Previous: <a href="GDB_002fMI-Stack-Manipulation.html#GDB_002fMI-Stack-Manipulation" accesskey="p" rel="previous">GDB/MI Stack Manipulation</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-Variable-Objects-1"></a>
  65. <h3 class="section">27.15 <small>GDB/MI</small> Variable Objects</h3>
  66. <a name="Introduction-to-Variable-Objects"></a>
  67. <h4 class="subheading">Introduction to Variable Objects</h4>
  68. <a name="index-variable-objects-in-GDB_002fMI"></a>
  69. <p>Variable objects are &quot;object-oriented&quot; MI interface for examining and
  70. changing values of expressions. Unlike some other MI interfaces that
  71. work with expressions, variable objects are specifically designed for
  72. simple and efficient presentation in the frontend. A variable object
  73. is identified by string name. When a variable object is created, the
  74. frontend specifies the expression for that variable object. The
  75. expression can be a simple variable, or it can be an arbitrary complex
  76. expression, and can even involve CPU registers. After creating a
  77. variable object, the frontend can invoke other variable object
  78. operations&mdash;for example to obtain or change the value of a variable
  79. object, or to change display format.
  80. </p>
  81. <p>Variable objects have hierarchical tree structure. Any variable object
  82. that corresponds to a composite type, such as structure in C, has
  83. a number of child variable objects, for example corresponding to each
  84. element of a structure. A child variable object can itself have
  85. children, recursively. Recursion ends when we reach
  86. leaf variable objects, which always have built-in types. Child variable
  87. objects are created only by explicit request, so if a frontend
  88. is not interested in the children of a particular variable object, no
  89. child will be created.
  90. </p>
  91. <p>For a leaf variable object it is possible to obtain its value as a
  92. string, or set the value from a string. String value can be also
  93. obtained for a non-leaf variable object, but it&rsquo;s generally a string
  94. that only indicates the type of the object, and does not list its
  95. contents. Assignment to a non-leaf variable object is not allowed.
  96. </p>
  97. <p>A frontend does not need to read the values of all variable objects each time
  98. the program stops. Instead, MI provides an update command that lists all
  99. variable objects whose values has changed since the last update
  100. operation. This considerably reduces the amount of data that must
  101. be transferred to the frontend. As noted above, children variable
  102. objects are created on demand, and only leaf variable objects have a
  103. real value. As result, gdb will read target memory only for leaf
  104. variables that frontend has created.
  105. </p>
  106. <p>The automatic update is not always desirable. For example, a frontend
  107. might want to keep a value of some expression for future reference,
  108. and never update it. For another example, fetching memory is
  109. relatively slow for embedded targets, so a frontend might want
  110. to disable automatic update for the variables that are either not
  111. visible on the screen, or &ldquo;closed&rdquo;. This is possible using so
  112. called &ldquo;frozen variable objects&rdquo;. Such variable objects are never
  113. implicitly updated.
  114. </p>
  115. <p>Variable objects can be either <em>fixed</em> or <em>floating</em>. For the
  116. fixed variable object, the expression is parsed when the variable
  117. object is created, including associating identifiers to specific
  118. variables. The meaning of expression never changes. For a floating
  119. variable object the values of variables whose names appear in the
  120. expressions are re-evaluated every time in the context of the current
  121. frame. Consider this example:
  122. </p>
  123. <div class="smallexample">
  124. <pre class="smallexample">void do_work(...)
  125. {
  126. struct work_state state;
  127. if (...)
  128. do_work(...);
  129. }
  130. </pre></div>
  131. <p>If a fixed variable object for the <code>state</code> variable is created in
  132. this function, and we enter the recursive call, the variable
  133. object will report the value of <code>state</code> in the top-level
  134. <code>do_work</code> invocation. On the other hand, a floating variable
  135. object will report the value of <code>state</code> in the current frame.
  136. </p>
  137. <p>If an expression specified when creating a fixed variable object
  138. refers to a local variable, the variable object becomes bound to the
  139. thread and frame in which the variable object is created. When such
  140. variable object is updated, <small>GDB</small> makes sure that the
  141. thread/frame combination the variable object is bound to still exists,
  142. and re-evaluates the variable object in context of that thread/frame.
  143. </p>
  144. <p>The following is the complete set of <small>GDB/MI</small> operations defined to
  145. access this functionality:
  146. </p>
  147. <table>
  148. <tr><td width="40%"><strong>Operation</strong></td><td width="60%"><strong>Description</strong></td></tr>
  149. <tr><td width="40%"><code>-enable-pretty-printing</code></td><td width="60%">enable Python-based pretty-printing</td></tr>
  150. <tr><td width="40%"><code>-var-create</code></td><td width="60%">create a variable object</td></tr>
  151. <tr><td width="40%"><code>-var-delete</code></td><td width="60%">delete the variable object and/or its children</td></tr>
  152. <tr><td width="40%"><code>-var-set-format</code></td><td width="60%">set the display format of this variable</td></tr>
  153. <tr><td width="40%"><code>-var-show-format</code></td><td width="60%">show the display format of this variable</td></tr>
  154. <tr><td width="40%"><code>-var-info-num-children</code></td><td width="60%">tells how many children this object has</td></tr>
  155. <tr><td width="40%"><code>-var-list-children</code></td><td width="60%">return a list of the object&rsquo;s children</td></tr>
  156. <tr><td width="40%"><code>-var-info-type</code></td><td width="60%">show the type of this variable object</td></tr>
  157. <tr><td width="40%"><code>-var-info-expression</code></td><td width="60%">print parent-relative expression that this variable object represents</td></tr>
  158. <tr><td width="40%"><code>-var-info-path-expression</code></td><td width="60%">print full expression that this variable object represents</td></tr>
  159. <tr><td width="40%"><code>-var-show-attributes</code></td><td width="60%">is this variable editable? does it exist here?</td></tr>
  160. <tr><td width="40%"><code>-var-evaluate-expression</code></td><td width="60%">get the value of this variable</td></tr>
  161. <tr><td width="40%"><code>-var-assign</code></td><td width="60%">set the value of this variable</td></tr>
  162. <tr><td width="40%"><code>-var-update</code></td><td width="60%">update the variable and its children</td></tr>
  163. <tr><td width="40%"><code>-var-set-frozen</code></td><td width="60%">set frozenness attribute</td></tr>
  164. <tr><td width="40%"><code>-var-set-update-range</code></td><td width="60%">set range of children to display on update</td></tr>
  165. </table>
  166. <p>In the next subsection we describe each operation in detail and suggest
  167. how it can be used.
  168. </p>
  169. <a name="Description-And-Use-of-Operations-on-Variable-Objects"></a>
  170. <h4 class="subheading">Description And Use of Operations on Variable Objects</h4>
  171. <a name="The-_002denable_002dpretty_002dprinting-Command"></a>
  172. <h4 class="subheading">The <code>-enable-pretty-printing</code> Command</h4>
  173. <a name="index-_002denable_002dpretty_002dprinting"></a>
  174. <div class="smallexample">
  175. <pre class="smallexample">-enable-pretty-printing
  176. </pre></div>
  177. <p><small>GDB</small> allows Python-based visualizers to affect the output of the
  178. MI variable object commands. However, because there was no way to
  179. implement this in a fully backward-compatible way, a front end must
  180. request that this functionality be enabled.
  181. </p>
  182. <p>Once enabled, this feature cannot be disabled.
  183. </p>
  184. <p>Note that if Python support has not been compiled into <small>GDB</small>,
  185. this command will still succeed (and do nothing).
  186. </p>
  187. <p>This feature is currently (as of <small>GDB</small> 7.0) experimental, and
  188. may work differently in future versions of <small>GDB</small>.
  189. </p>
  190. <a name="The-_002dvar_002dcreate-Command"></a>
  191. <h4 class="subheading">The <code>-var-create</code> Command</h4>
  192. <a name="index-_002dvar_002dcreate"></a>
  193. <a name="Synopsis-48"></a>
  194. <h4 class="subsubheading">Synopsis</h4>
  195. <div class="smallexample">
  196. <pre class="smallexample"> -var-create {<var>name</var> | &quot;-&quot;}
  197. {<var>frame-addr</var> | &quot;*&quot; | &quot;@&quot;} <var>expression</var>
  198. </pre></div>
  199. <p>This operation creates a variable object, which allows the monitoring of
  200. a variable, the result of an expression, a memory cell or a CPU
  201. register.
  202. </p>
  203. <p>The <var>name</var> parameter is the string by which the object can be
  204. referenced. It must be unique. If &lsquo;<samp>-</samp>&rsquo; is specified, the varobj
  205. system will generate a string &ldquo;varNNNNNN&rdquo; automatically. It will be
  206. unique provided that one does not specify <var>name</var> of that format.
  207. The command fails if a duplicate name is found.
  208. </p>
  209. <p>The frame under which the expression should be evaluated can be
  210. specified by <var>frame-addr</var>. A &lsquo;<samp>*</samp>&rsquo; indicates that the current
  211. frame should be used. A &lsquo;<samp>@</samp>&rsquo; indicates that a floating variable
  212. object must be created.
  213. </p>
  214. <p><var>expression</var> is any expression valid on the current language set (must not
  215. begin with a &lsquo;<samp>*</samp>&rsquo;), or one of the following:
  216. </p>
  217. <ul>
  218. <li> &lsquo;<samp>*<var>addr</var></samp>&rsquo;, where <var>addr</var> is the address of a memory cell
  219. </li><li> &lsquo;<samp>*<var>addr</var>-<var>addr</var></samp>&rsquo; &mdash; a memory address range (TBD)
  220. </li><li> &lsquo;<samp>$<var>regname</var></samp>&rsquo; &mdash; a CPU register name
  221. </li></ul>
  222. <a name="index-dynamic-varobj"></a>
  223. <p>A varobj&rsquo;s contents may be provided by a Python-based pretty-printer. In this
  224. case the varobj is known as a <em>dynamic varobj</em>. Dynamic varobjs
  225. have slightly different semantics in some cases. If the
  226. <code>-enable-pretty-printing</code> command is not sent, then <small>GDB</small>
  227. will never create a dynamic varobj. This ensures backward
  228. compatibility for existing clients.
  229. </p>
  230. <a name="Result-5"></a>
  231. <h4 class="subsubheading">Result</h4>
  232. <p>This operation returns attributes of the newly-created varobj. These
  233. are:
  234. </p>
  235. <dl compact="compact">
  236. <dt>&lsquo;<samp>name</samp>&rsquo;</dt>
  237. <dd><p>The name of the varobj.
  238. </p>
  239. </dd>
  240. <dt>&lsquo;<samp>numchild</samp>&rsquo;</dt>
  241. <dd><p>The number of children of the varobj. This number is not necessarily
  242. reliable for a dynamic varobj. Instead, you must examine the
  243. &lsquo;<samp>has_more</samp>&rsquo; attribute.
  244. </p>
  245. </dd>
  246. <dt>&lsquo;<samp>value</samp>&rsquo;</dt>
  247. <dd><p>The varobj&rsquo;s scalar value. For a varobj whose type is some sort of
  248. aggregate (e.g., a <code>struct</code>), or for a dynamic varobj, this value
  249. will not be interesting.
  250. </p>
  251. </dd>
  252. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  253. <dd><p>The varobj&rsquo;s type. This is a string representation of the type, as
  254. would be printed by the <small>GDB</small> CLI. If &lsquo;<samp>print object</samp>&rsquo;
  255. (see <a href="Print-Settings.html#Print-Settings">set print object</a>) is set to <code>on</code>, the
  256. <em>actual</em> (derived) type of the object is shown rather than the
  257. <em>declared</em> one.
  258. </p>
  259. </dd>
  260. <dt>&lsquo;<samp>thread-id</samp>&rsquo;</dt>
  261. <dd><p>If a variable object is bound to a specific thread, then this is the
  262. thread&rsquo;s global identifier.
  263. </p>
  264. </dd>
  265. <dt>&lsquo;<samp>has_more</samp>&rsquo;</dt>
  266. <dd><p>For a dynamic varobj, this indicates whether there appear to be any
  267. children available. For a non-dynamic varobj, this will be 0.
  268. </p>
  269. </dd>
  270. <dt>&lsquo;<samp>dynamic</samp>&rsquo;</dt>
  271. <dd><p>This attribute will be present and have the value &lsquo;<samp>1</samp>&rsquo; if the
  272. varobj is a dynamic varobj. If the varobj is not a dynamic varobj,
  273. then this attribute will not be present.
  274. </p>
  275. </dd>
  276. <dt>&lsquo;<samp>displayhint</samp>&rsquo;</dt>
  277. <dd><p>A dynamic varobj can supply a display hint to the front end. The
  278. value comes directly from the Python pretty-printer object&rsquo;s
  279. <code>display_hint</code> method. See <a href="Pretty-Printing-API.html#Pretty-Printing-API">Pretty Printing API</a>.
  280. </p></dd>
  281. </dl>
  282. <p>Typical output will look like this:
  283. </p>
  284. <div class="smallexample">
  285. <pre class="smallexample"> name=&quot;<var>name</var>&quot;,numchild=&quot;<var>N</var>&quot;,type=&quot;<var>type</var>&quot;,thread-id=&quot;<var>M</var>&quot;,
  286. has_more=&quot;<var>has_more</var>&quot;
  287. </pre></div>
  288. <a name="The-_002dvar_002ddelete-Command"></a>
  289. <h4 class="subheading">The <code>-var-delete</code> Command</h4>
  290. <a name="index-_002dvar_002ddelete"></a>
  291. <a name="Synopsis-49"></a>
  292. <h4 class="subsubheading">Synopsis</h4>
  293. <div class="smallexample">
  294. <pre class="smallexample"> -var-delete [ -c ] <var>name</var>
  295. </pre></div>
  296. <p>Deletes a previously created variable object and all of its children.
  297. With the &lsquo;<samp>-c</samp>&rsquo; option, just deletes the children.
  298. </p>
  299. <p>Returns an error if the object <var>name</var> is not found.
  300. </p>
  301. <a name="The-_002dvar_002dset_002dformat-Command"></a>
  302. <h4 class="subheading">The <code>-var-set-format</code> Command</h4>
  303. <a name="index-_002dvar_002dset_002dformat"></a>
  304. <a name="Synopsis-50"></a>
  305. <h4 class="subsubheading">Synopsis</h4>
  306. <div class="smallexample">
  307. <pre class="smallexample"> -var-set-format <var>name</var> <var>format-spec</var>
  308. </pre></div>
  309. <p>Sets the output format for the value of the object <var>name</var> to be
  310. <var>format-spec</var>.
  311. </p>
  312. <a name="g_t_002dvar_002dset_002dformat"></a><p>The syntax for the <var>format-spec</var> is as follows:
  313. </p>
  314. <div class="smallexample">
  315. <pre class="smallexample"> <var>format-spec</var> &rarr;
  316. {binary | decimal | hexadecimal | octal | natural | zero-hexadecimal}
  317. </pre></div>
  318. <p>The natural format is the default format choosen automatically
  319. based on the variable type (like decimal for an <code>int</code>, hex
  320. for pointers, etc.).
  321. </p>
  322. <p>The zero-hexadecimal format has a representation similar to hexadecimal
  323. but with padding zeroes to the left of the value. For example, a 32-bit
  324. hexadecimal value of 0x1234 would be represented as 0x00001234 in the
  325. zero-hexadecimal format.
  326. </p>
  327. <p>For a variable with children, the format is set only on the
  328. variable itself, and the children are not affected.
  329. </p>
  330. <a name="The-_002dvar_002dshow_002dformat-Command"></a>
  331. <h4 class="subheading">The <code>-var-show-format</code> Command</h4>
  332. <a name="index-_002dvar_002dshow_002dformat"></a>
  333. <a name="Synopsis-51"></a>
  334. <h4 class="subsubheading">Synopsis</h4>
  335. <div class="smallexample">
  336. <pre class="smallexample"> -var-show-format <var>name</var>
  337. </pre></div>
  338. <p>Returns the format used to display the value of the object <var>name</var>.
  339. </p>
  340. <div class="smallexample">
  341. <pre class="smallexample"> <var>format</var> &rarr;
  342. <var>format-spec</var>
  343. </pre></div>
  344. <a name="The-_002dvar_002dinfo_002dnum_002dchildren-Command"></a>
  345. <h4 class="subheading">The <code>-var-info-num-children</code> Command</h4>
  346. <a name="index-_002dvar_002dinfo_002dnum_002dchildren"></a>
  347. <a name="Synopsis-52"></a>
  348. <h4 class="subsubheading">Synopsis</h4>
  349. <div class="smallexample">
  350. <pre class="smallexample"> -var-info-num-children <var>name</var>
  351. </pre></div>
  352. <p>Returns the number of children of a variable object <var>name</var>:
  353. </p>
  354. <div class="smallexample">
  355. <pre class="smallexample"> numchild=<var>n</var>
  356. </pre></div>
  357. <p>Note that this number is not completely reliable for a dynamic varobj.
  358. It will return the current number of children, but more children may
  359. be available.
  360. </p>
  361. <a name="The-_002dvar_002dlist_002dchildren-Command"></a>
  362. <h4 class="subheading">The <code>-var-list-children</code> Command</h4>
  363. <a name="index-_002dvar_002dlist_002dchildren"></a>
  364. <a name="Synopsis-53"></a>
  365. <h4 class="subsubheading">Synopsis</h4>
  366. <div class="smallexample">
  367. <pre class="smallexample"> -var-list-children [<var>print-values</var>] <var>name</var> [<var>from</var> <var>to</var>]
  368. </pre></div>
  369. <a name="g_t_002dvar_002dlist_002dchildren"></a>
  370. <p>Return a list of the children of the specified variable object and
  371. create variable objects for them, if they do not already exist. With
  372. a single argument or if <var>print-values</var> has a value of 0 or
  373. <code>--no-values</code>, print only the names of the variables; if
  374. <var>print-values</var> is 1 or <code>--all-values</code>, also print their
  375. values; and if it is 2 or <code>--simple-values</code> print the name and
  376. value for simple data types and just the name for arrays, structures
  377. and unions.
  378. </p>
  379. <p><var>from</var> and <var>to</var>, if specified, indicate the range of children
  380. to report. If <var>from</var> or <var>to</var> is less than zero, the range is
  381. reset and all children will be reported. Otherwise, children starting
  382. at <var>from</var> (zero-based) and up to and excluding <var>to</var> will be
  383. reported.
  384. </p>
  385. <p>If a child range is requested, it will only affect the current call to
  386. <code>-var-list-children</code>, but not future calls to <code>-var-update</code>.
  387. For this, you must instead use <code>-var-set-update-range</code>. The
  388. intent of this approach is to enable a front end to implement any
  389. update approach it likes; for example, scrolling a view may cause the
  390. front end to request more children with <code>-var-list-children</code>, and
  391. then the front end could call <code>-var-set-update-range</code> with a
  392. different range to ensure that future updates are restricted to just
  393. the visible items.
  394. </p>
  395. <p>For each child the following results are returned:
  396. </p>
  397. <dl compact="compact">
  398. <dt><var>name</var></dt>
  399. <dd><p>Name of the variable object created for this child.
  400. </p>
  401. </dd>
  402. <dt><var>exp</var></dt>
  403. <dd><p>The expression to be shown to the user by the front end to designate this child.
  404. For example this may be the name of a structure member.
  405. </p>
  406. <p>For a dynamic varobj, this value cannot be used to form an
  407. expression. There is no way to do this at all with a dynamic varobj.
  408. </p>
  409. <p>For C/C<tt>++</tt> structures there are several pseudo children returned to
  410. designate access qualifiers. For these pseudo children <var>exp</var> is
  411. &lsquo;<samp>public</samp>&rsquo;, &lsquo;<samp>private</samp>&rsquo;, or &lsquo;<samp>protected</samp>&rsquo;. In this case the
  412. type and value are not present.
  413. </p>
  414. <p>A dynamic varobj will not report the access qualifying
  415. pseudo-children, regardless of the language. This information is not
  416. available at all with a dynamic varobj.
  417. </p>
  418. </dd>
  419. <dt><var>numchild</var></dt>
  420. <dd><p>Number of children this child has. For a dynamic varobj, this will be
  421. 0.
  422. </p>
  423. </dd>
  424. <dt><var>type</var></dt>
  425. <dd><p>The type of the child. If &lsquo;<samp>print object</samp>&rsquo;
  426. (see <a href="Print-Settings.html#Print-Settings">set print object</a>) is set to <code>on</code>, the
  427. <em>actual</em> (derived) type of the object is shown rather than the
  428. <em>declared</em> one.
  429. </p>
  430. </dd>
  431. <dt><var>value</var></dt>
  432. <dd><p>If values were requested, this is the value.
  433. </p>
  434. </dd>
  435. <dt><var>thread-id</var></dt>
  436. <dd><p>If this variable object is associated with a thread, this is the
  437. thread&rsquo;s global thread id. Otherwise this result is not present.
  438. </p>
  439. </dd>
  440. <dt><var>frozen</var></dt>
  441. <dd><p>If the variable object is frozen, this variable will be present with a value of 1.
  442. </p>
  443. </dd>
  444. <dt><var>displayhint</var></dt>
  445. <dd><p>A dynamic varobj can supply a display hint to the front end. The
  446. value comes directly from the Python pretty-printer object&rsquo;s
  447. <code>display_hint</code> method. See <a href="Pretty-Printing-API.html#Pretty-Printing-API">Pretty Printing API</a>.
  448. </p>
  449. </dd>
  450. <dt><var>dynamic</var></dt>
  451. <dd><p>This attribute will be present and have the value &lsquo;<samp>1</samp>&rsquo; if the
  452. varobj is a dynamic varobj. If the varobj is not a dynamic varobj,
  453. then this attribute will not be present.
  454. </p>
  455. </dd>
  456. </dl>
  457. <p>The result may have its own attributes:
  458. </p>
  459. <dl compact="compact">
  460. <dt>&lsquo;<samp>displayhint</samp>&rsquo;</dt>
  461. <dd><p>A dynamic varobj can supply a display hint to the front end. The
  462. value comes directly from the Python pretty-printer object&rsquo;s
  463. <code>display_hint</code> method. See <a href="Pretty-Printing-API.html#Pretty-Printing-API">Pretty Printing API</a>.
  464. </p>
  465. </dd>
  466. <dt>&lsquo;<samp>has_more</samp>&rsquo;</dt>
  467. <dd><p>This is an integer attribute which is nonzero if there are children
  468. remaining after the end of the selected range.
  469. </p></dd>
  470. </dl>
  471. <a name="Example-46"></a>
  472. <h4 class="subsubheading">Example</h4>
  473. <div class="smallexample">
  474. <pre class="smallexample">(gdb)
  475. -var-list-children n
  476. ^done,numchild=<var>n</var>,children=[child={name=<var>name</var>,exp=<var>exp</var>,
  477. numchild=<var>n</var>,type=<var>type</var>},<span class="roman">(repeats N times)</span>]
  478. (gdb)
  479. -var-list-children --all-values n
  480. ^done,numchild=<var>n</var>,children=[child={name=<var>name</var>,exp=<var>exp</var>,
  481. numchild=<var>n</var>,value=<var>value</var>,type=<var>type</var>},<span class="roman">(repeats N times)</span>]
  482. </pre></div>
  483. <a name="The-_002dvar_002dinfo_002dtype-Command"></a>
  484. <h4 class="subheading">The <code>-var-info-type</code> Command</h4>
  485. <a name="index-_002dvar_002dinfo_002dtype"></a>
  486. <a name="Synopsis-54"></a>
  487. <h4 class="subsubheading">Synopsis</h4>
  488. <div class="smallexample">
  489. <pre class="smallexample"> -var-info-type <var>name</var>
  490. </pre></div>
  491. <p>Returns the type of the specified variable <var>name</var>. The type is
  492. returned as a string in the same format as it is output by the
  493. <small>GDB</small> CLI:
  494. </p>
  495. <div class="smallexample">
  496. <pre class="smallexample"> type=<var>typename</var>
  497. </pre></div>
  498. <a name="The-_002dvar_002dinfo_002dexpression-Command"></a>
  499. <h4 class="subheading">The <code>-var-info-expression</code> Command</h4>
  500. <a name="index-_002dvar_002dinfo_002dexpression"></a>
  501. <a name="Synopsis-55"></a>
  502. <h4 class="subsubheading">Synopsis</h4>
  503. <div class="smallexample">
  504. <pre class="smallexample"> -var-info-expression <var>name</var>
  505. </pre></div>
  506. <p>Returns a string that is suitable for presenting this
  507. variable object in user interface. The string is generally
  508. not valid expression in the current language, and cannot be evaluated.
  509. </p>
  510. <p>For example, if <code>a</code> is an array, and variable object
  511. <code>A</code> was created for <code>a</code>, then we&rsquo;ll get this output:
  512. </p>
  513. <div class="smallexample">
  514. <pre class="smallexample">(gdb) -var-info-expression A.1
  515. ^done,lang=&quot;C&quot;,exp=&quot;1&quot;
  516. </pre></div>
  517. <p>Here, the value of <code>lang</code> is the language name, which can be
  518. found in <a href="Supported-Languages.html#Supported-Languages">Supported Languages</a>.
  519. </p>
  520. <p>Note that the output of the <code>-var-list-children</code> command also
  521. includes those expressions, so the <code>-var-info-expression</code> command
  522. is of limited use.
  523. </p>
  524. <a name="The-_002dvar_002dinfo_002dpath_002dexpression-Command"></a>
  525. <h4 class="subheading">The <code>-var-info-path-expression</code> Command</h4>
  526. <a name="index-_002dvar_002dinfo_002dpath_002dexpression"></a>
  527. <a name="Synopsis-56"></a>
  528. <h4 class="subsubheading">Synopsis</h4>
  529. <div class="smallexample">
  530. <pre class="smallexample"> -var-info-path-expression <var>name</var>
  531. </pre></div>
  532. <p>Returns an expression that can be evaluated in the current
  533. context and will yield the same value that a variable object has.
  534. Compare this with the <code>-var-info-expression</code> command, which
  535. result can be used only for UI presentation. Typical use of
  536. the <code>-var-info-path-expression</code> command is creating a
  537. watchpoint from a variable object.
  538. </p>
  539. <p>This command is currently not valid for children of a dynamic varobj,
  540. and will give an error when invoked on one.
  541. </p>
  542. <p>For example, suppose <code>C</code> is a C<tt>++</tt> class, derived from class
  543. <code>Base</code>, and that the <code>Base</code> class has a member called
  544. <code>m_size</code>. Assume a variable <code>c</code> is has the type of
  545. <code>C</code> and a variable object <code>C</code> was created for variable
  546. <code>c</code>. Then, we&rsquo;ll get this output:
  547. </p><div class="smallexample">
  548. <pre class="smallexample">(gdb) -var-info-path-expression C.Base.public.m_size
  549. ^done,path_expr=((Base)c).m_size)
  550. </pre></div>
  551. <a name="The-_002dvar_002dshow_002dattributes-Command"></a>
  552. <h4 class="subheading">The <code>-var-show-attributes</code> Command</h4>
  553. <a name="index-_002dvar_002dshow_002dattributes"></a>
  554. <a name="Synopsis-57"></a>
  555. <h4 class="subsubheading">Synopsis</h4>
  556. <div class="smallexample">
  557. <pre class="smallexample"> -var-show-attributes <var>name</var>
  558. </pre></div>
  559. <p>List attributes of the specified variable object <var>name</var>:
  560. </p>
  561. <div class="smallexample">
  562. <pre class="smallexample"> status=<var>attr</var> [ ( ,<var>attr</var> )* ]
  563. </pre></div>
  564. <p>where <var>attr</var> is <code>{ { editable | noneditable } | TBD }</code>.
  565. </p>
  566. <a name="The-_002dvar_002devaluate_002dexpression-Command"></a>
  567. <h4 class="subheading">The <code>-var-evaluate-expression</code> Command</h4>
  568. <a name="index-_002dvar_002devaluate_002dexpression"></a>
  569. <a name="Synopsis-58"></a>
  570. <h4 class="subsubheading">Synopsis</h4>
  571. <div class="smallexample">
  572. <pre class="smallexample"> -var-evaluate-expression [-f <var>format-spec</var>] <var>name</var>
  573. </pre></div>
  574. <p>Evaluates the expression that is represented by the specified variable
  575. object and returns its value as a string. The format of the string
  576. can be specified with the &lsquo;<samp>-f</samp>&rsquo; option. The possible values of
  577. this option are the same as for <code>-var-set-format</code>
  578. (see <a href="#g_t_002dvar_002dset_002dformat">-var-set-format</a>). If the &lsquo;<samp>-f</samp>&rsquo; option is not specified,
  579. the current display format will be used. The current display format
  580. can be changed using the <code>-var-set-format</code> command.
  581. </p>
  582. <div class="smallexample">
  583. <pre class="smallexample"> value=<var>value</var>
  584. </pre></div>
  585. <p>Note that one must invoke <code>-var-list-children</code> for a variable
  586. before the value of a child variable can be evaluated.
  587. </p>
  588. <a name="The-_002dvar_002dassign-Command"></a>
  589. <h4 class="subheading">The <code>-var-assign</code> Command</h4>
  590. <a name="index-_002dvar_002dassign"></a>
  591. <a name="Synopsis-59"></a>
  592. <h4 class="subsubheading">Synopsis</h4>
  593. <div class="smallexample">
  594. <pre class="smallexample"> -var-assign <var>name</var> <var>expression</var>
  595. </pre></div>
  596. <p>Assigns the value of <var>expression</var> to the variable object specified
  597. by <var>name</var>. The object must be &lsquo;<samp>editable</samp>&rsquo;. If the variable&rsquo;s
  598. value is altered by the assign, the variable will show up in any
  599. subsequent <code>-var-update</code> list.
  600. </p>
  601. <a name="Example-47"></a>
  602. <h4 class="subsubheading">Example</h4>
  603. <div class="smallexample">
  604. <pre class="smallexample">(gdb)
  605. -var-assign var1 3
  606. ^done,value=&quot;3&quot;
  607. (gdb)
  608. -var-update *
  609. ^done,changelist=[{name=&quot;var1&quot;,in_scope=&quot;true&quot;,type_changed=&quot;false&quot;}]
  610. (gdb)
  611. </pre></div>
  612. <a name="The-_002dvar_002dupdate-Command"></a>
  613. <h4 class="subheading">The <code>-var-update</code> Command</h4>
  614. <a name="index-_002dvar_002dupdate"></a>
  615. <a name="Synopsis-60"></a>
  616. <h4 class="subsubheading">Synopsis</h4>
  617. <div class="smallexample">
  618. <pre class="smallexample"> -var-update [<var>print-values</var>] {<var>name</var> | &quot;*&quot;}
  619. </pre></div>
  620. <p>Reevaluate the expressions corresponding to the variable object
  621. <var>name</var> and all its direct and indirect children, and return the
  622. list of variable objects whose values have changed; <var>name</var> must
  623. be a root variable object. Here, &ldquo;changed&rdquo; means that the result of
  624. <code>-var-evaluate-expression</code> before and after the
  625. <code>-var-update</code> is different. If &lsquo;<samp>*</samp>&rsquo; is used as the variable
  626. object names, all existing variable objects are updated, except
  627. for frozen ones (see <a href="#g_t_002dvar_002dset_002dfrozen">-var-set-frozen</a>). The option
  628. <var>print-values</var> determines whether both names and values, or just
  629. names are printed. The possible values of this option are the same
  630. as for <code>-var-list-children</code> (see <a href="#g_t_002dvar_002dlist_002dchildren">-var-list-children</a>). It is
  631. recommended to use the &lsquo;<samp>--all-values</samp>&rsquo; option, to reduce the
  632. number of MI commands needed on each program stop.
  633. </p>
  634. <p>With the &lsquo;<samp>*</samp>&rsquo; parameter, if a variable object is bound to a
  635. currently running thread, it will not be updated, without any
  636. diagnostic.
  637. </p>
  638. <p>If <code>-var-set-update-range</code> was previously used on a varobj, then
  639. only the selected range of children will be reported.
  640. </p>
  641. <p><code>-var-update</code> reports all the changed varobjs in a tuple named
  642. &lsquo;<samp>changelist</samp>&rsquo;.
  643. </p>
  644. <p>Each item in the change list is itself a tuple holding:
  645. </p>
  646. <dl compact="compact">
  647. <dt>&lsquo;<samp>name</samp>&rsquo;</dt>
  648. <dd><p>The name of the varobj.
  649. </p>
  650. </dd>
  651. <dt>&lsquo;<samp>value</samp>&rsquo;</dt>
  652. <dd><p>If values were requested for this update, then this field will be
  653. present and will hold the value of the varobj.
  654. </p>
  655. </dd>
  656. <dt>&lsquo;<samp>in_scope</samp>&rsquo;</dt>
  657. <dd><a name="g_t_002dvar_002dupdate"></a><p>This field is a string which may take one of three values:
  658. </p>
  659. <dl compact="compact">
  660. <dt><code>&quot;true&quot;</code></dt>
  661. <dd><p>The variable object&rsquo;s current value is valid.
  662. </p>
  663. </dd>
  664. <dt><code>&quot;false&quot;</code></dt>
  665. <dd><p>The variable object does not currently hold a valid value but it may
  666. hold one in the future if its associated expression comes back into
  667. scope.
  668. </p>
  669. </dd>
  670. <dt><code>&quot;invalid&quot;</code></dt>
  671. <dd><p>The variable object no longer holds a valid value.
  672. This can occur when the executable file being debugged has changed,
  673. either through recompilation or by using the <small>GDB</small> <code>file</code>
  674. command. The front end should normally choose to delete these variable
  675. objects.
  676. </p></dd>
  677. </dl>
  678. <p>In the future new values may be added to this list so the front should
  679. be prepared for this possibility. See <a href="GDB_002fMI-Development-and-Front-Ends.html#GDB_002fMI-Development-and-Front-Ends"><small>GDB/MI</small> Development and Front Ends</a>.
  680. </p>
  681. </dd>
  682. <dt>&lsquo;<samp>type_changed</samp>&rsquo;</dt>
  683. <dd><p>This is only present if the varobj is still valid. If the type
  684. changed, then this will be the string &lsquo;<samp>true</samp>&rsquo;; otherwise it will
  685. be &lsquo;<samp>false</samp>&rsquo;.
  686. </p>
  687. <p>When a varobj&rsquo;s type changes, its children are also likely to have
  688. become incorrect. Therefore, the varobj&rsquo;s children are automatically
  689. deleted when this attribute is &lsquo;<samp>true</samp>&rsquo;. Also, the varobj&rsquo;s update
  690. range, when set using the <code>-var-set-update-range</code> command, is
  691. unset.
  692. </p>
  693. </dd>
  694. <dt>&lsquo;<samp>new_type</samp>&rsquo;</dt>
  695. <dd><p>If the varobj&rsquo;s type changed, then this field will be present and will
  696. hold the new type.
  697. </p>
  698. </dd>
  699. <dt>&lsquo;<samp>new_num_children</samp>&rsquo;</dt>
  700. <dd><p>For a dynamic varobj, if the number of children changed, or if the
  701. type changed, this will be the new number of children.
  702. </p>
  703. <p>The &lsquo;<samp>numchild</samp>&rsquo; field in other varobj responses is generally not
  704. valid for a dynamic varobj &ndash; it will show the number of children that
  705. <small>GDB</small> knows about, but because dynamic varobjs lazily
  706. instantiate their children, this will not reflect the number of
  707. children which may be available.
  708. </p>
  709. <p>The &lsquo;<samp>new_num_children</samp>&rsquo; attribute only reports changes to the
  710. number of children known by <small>GDB</small>. This is the only way to
  711. detect whether an update has removed children (which necessarily can
  712. only happen at the end of the update range).
  713. </p>
  714. </dd>
  715. <dt>&lsquo;<samp>displayhint</samp>&rsquo;</dt>
  716. <dd><p>The display hint, if any.
  717. </p>
  718. </dd>
  719. <dt>&lsquo;<samp>has_more</samp>&rsquo;</dt>
  720. <dd><p>This is an integer value, which will be 1 if there are more children
  721. available outside the varobj&rsquo;s update range.
  722. </p>
  723. </dd>
  724. <dt>&lsquo;<samp>dynamic</samp>&rsquo;</dt>
  725. <dd><p>This attribute will be present and have the value &lsquo;<samp>1</samp>&rsquo; if the
  726. varobj is a dynamic varobj. If the varobj is not a dynamic varobj,
  727. then this attribute will not be present.
  728. </p>
  729. </dd>
  730. <dt>&lsquo;<samp>new_children</samp>&rsquo;</dt>
  731. <dd><p>If new children were added to a dynamic varobj within the selected
  732. update range (as set by <code>-var-set-update-range</code>), then they will
  733. be listed in this attribute.
  734. </p></dd>
  735. </dl>
  736. <a name="Example-48"></a>
  737. <h4 class="subsubheading">Example</h4>
  738. <div class="smallexample">
  739. <pre class="smallexample">(gdb)
  740. -var-assign var1 3
  741. ^done,value=&quot;3&quot;
  742. (gdb)
  743. -var-update --all-values var1
  744. ^done,changelist=[{name=&quot;var1&quot;,value=&quot;3&quot;,in_scope=&quot;true&quot;,
  745. type_changed=&quot;false&quot;}]
  746. (gdb)
  747. </pre></div>
  748. <a name="The-_002dvar_002dset_002dfrozen-Command"></a>
  749. <h4 class="subheading">The <code>-var-set-frozen</code> Command</h4>
  750. <a name="index-_002dvar_002dset_002dfrozen"></a>
  751. <a name="g_t_002dvar_002dset_002dfrozen"></a>
  752. <a name="Synopsis-61"></a>
  753. <h4 class="subsubheading">Synopsis</h4>
  754. <div class="smallexample">
  755. <pre class="smallexample"> -var-set-frozen <var>name</var> <var>flag</var>
  756. </pre></div>
  757. <p>Set the frozenness flag on the variable object <var>name</var>. The
  758. <var>flag</var> parameter should be either &lsquo;<samp>1</samp>&rsquo; to make the variable
  759. frozen or &lsquo;<samp>0</samp>&rsquo; to make it unfrozen. If a variable object is
  760. frozen, then neither itself, nor any of its children, are
  761. implicitly updated by <code>-var-update</code> of
  762. a parent variable or by <code>-var-update *</code>. Only
  763. <code>-var-update</code> of the variable itself will update its value and
  764. values of its children. After a variable object is unfrozen, it is
  765. implicitly updated by all subsequent <code>-var-update</code> operations.
  766. Unfreezing a variable does not update it, only subsequent
  767. <code>-var-update</code> does.
  768. </p>
  769. <a name="Example-49"></a>
  770. <h4 class="subsubheading">Example</h4>
  771. <div class="smallexample">
  772. <pre class="smallexample">(gdb)
  773. -var-set-frozen V 1
  774. ^done
  775. (gdb)
  776. </pre></div>
  777. <a name="The-_002dvar_002dset_002dupdate_002drange-command"></a>
  778. <h4 class="subheading">The <code>-var-set-update-range</code> command</h4>
  779. <a name="index-_002dvar_002dset_002dupdate_002drange"></a>
  780. <a name="g_t_002dvar_002dset_002dupdate_002drange"></a>
  781. <a name="Synopsis-62"></a>
  782. <h4 class="subsubheading">Synopsis</h4>
  783. <div class="smallexample">
  784. <pre class="smallexample"> -var-set-update-range <var>name</var> <var>from</var> <var>to</var>
  785. </pre></div>
  786. <p>Set the range of children to be returned by future invocations of
  787. <code>-var-update</code>.
  788. </p>
  789. <p><var>from</var> and <var>to</var> indicate the range of children to report. If
  790. <var>from</var> or <var>to</var> is less than zero, the range is reset and all
  791. children will be reported. Otherwise, children starting at <var>from</var>
  792. (zero-based) and up to and excluding <var>to</var> will be reported.
  793. </p>
  794. <a name="Example-50"></a>
  795. <h4 class="subsubheading">Example</h4>
  796. <div class="smallexample">
  797. <pre class="smallexample">(gdb)
  798. -var-set-update-range V 1 2
  799. ^done
  800. </pre></div>
  801. <a name="The-_002dvar_002dset_002dvisualizer-command"></a>
  802. <h4 class="subheading">The <code>-var-set-visualizer</code> command</h4>
  803. <a name="index-_002dvar_002dset_002dvisualizer"></a>
  804. <a name="g_t_002dvar_002dset_002dvisualizer"></a>
  805. <a name="Synopsis-63"></a>
  806. <h4 class="subsubheading">Synopsis</h4>
  807. <div class="smallexample">
  808. <pre class="smallexample"> -var-set-visualizer <var>name</var> <var>visualizer</var>
  809. </pre></div>
  810. <p>Set a visualizer for the variable object <var>name</var>.
  811. </p>
  812. <p><var>visualizer</var> is the visualizer to use. The special value
  813. &lsquo;<samp>None</samp>&rsquo; means to disable any visualizer in use.
  814. </p>
  815. <p>If not &lsquo;<samp>None</samp>&rsquo;, <var>visualizer</var> must be a Python expression.
  816. This expression must evaluate to a callable object which accepts a
  817. single argument. <small>GDB</small> will call this object with the value of
  818. the varobj <var>name</var> as an argument (this is done so that the same
  819. Python pretty-printing code can be used for both the CLI and MI).
  820. When called, this object must return an object which conforms to the
  821. pretty-printing interface (see <a href="Pretty-Printing-API.html#Pretty-Printing-API">Pretty Printing API</a>).
  822. </p>
  823. <p>The pre-defined function <code>gdb.default_visualizer</code> may be used to
  824. select a visualizer by following the built-in process
  825. (see <a href="Selecting-Pretty_002dPrinters.html#Selecting-Pretty_002dPrinters">Selecting Pretty-Printers</a>). This is done automatically when
  826. a varobj is created, and so ordinarily is not needed.
  827. </p>
  828. <p>This feature is only available if Python support is enabled. The MI
  829. command <code>-list-features</code> (see <a href="GDB_002fMI-Support-Commands.html#GDB_002fMI-Support-Commands">GDB/MI Support Commands</a>)
  830. can be used to check this.
  831. </p>
  832. <a name="Example-51"></a>
  833. <h4 class="subsubheading">Example</h4>
  834. <p>Resetting the visualizer:
  835. </p>
  836. <div class="smallexample">
  837. <pre class="smallexample">(gdb)
  838. -var-set-visualizer V None
  839. ^done
  840. </pre></div>
  841. <p>Reselecting the default (type-based) visualizer:
  842. </p>
  843. <div class="smallexample">
  844. <pre class="smallexample">(gdb)
  845. -var-set-visualizer V gdb.default_visualizer
  846. ^done
  847. </pre></div>
  848. <p>Suppose <code>SomeClass</code> is a visualizer class. A lambda expression
  849. can be used to instantiate this class for a varobj:
  850. </p>
  851. <div class="smallexample">
  852. <pre class="smallexample">(gdb)
  853. -var-set-visualizer V &quot;lambda val: SomeClass()&quot;
  854. ^done
  855. </pre></div>
  856. <hr>
  857. <div class="header">
  858. <p>
  859. Next: <a href="GDB_002fMI-Data-Manipulation.html#GDB_002fMI-Data-Manipulation" accesskey="n" rel="next">GDB/MI Data Manipulation</a>, Previous: <a href="GDB_002fMI-Stack-Manipulation.html#GDB_002fMI-Stack-Manipulation" accesskey="p" rel="previous">GDB/MI Stack Manipulation</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>
  860. </div>
  861. </body>
  862. </html>