GDB_002fMI-Program-Context.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  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 Program Context</title>
  16. <meta name="description" content="Debugging with GDB: GDB/MI Program Context">
  17. <meta name="keywords" content="Debugging with GDB: GDB/MI Program Context">
  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-Thread-Commands.html#GDB_002fMI-Thread-Commands" rel="next" title="GDB/MI Thread Commands">
  27. <link href="C_002b_002b-Exception-GDB_002fMI-Catchpoint-Commands.html#C_002b_002b-Exception-GDB_002fMI-Catchpoint-Commands" rel="previous" title="C++ Exception GDB/MI Catchpoint Commands">
  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-Program-Context"></a>
  59. <div class="header">
  60. <p>
  61. Next: <a href="GDB_002fMI-Thread-Commands.html#GDB_002fMI-Thread-Commands" accesskey="n" rel="next">GDB/MI Thread Commands</a>, Previous: <a href="GDB_002fMI-Catchpoint-Commands.html#GDB_002fMI-Catchpoint-Commands" accesskey="p" rel="previous">GDB/MI Catchpoint Commands</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-Program-Context-1"></a>
  65. <h3 class="section">27.10 <small>GDB/MI</small> Program Context</h3>
  66. <a name="The-_002dexec_002darguments-Command"></a>
  67. <h4 class="subheading">The <code>-exec-arguments</code> Command</h4>
  68. <a name="index-_002dexec_002darguments"></a>
  69. <a name="Synopsis-21"></a>
  70. <h4 class="subsubheading">Synopsis</h4>
  71. <div class="smallexample">
  72. <pre class="smallexample"> -exec-arguments <var>args</var>
  73. </pre></div>
  74. <p>Set the inferior program arguments, to be used in the next
  75. &lsquo;<samp>-exec-run</samp>&rsquo;.
  76. </p>
  77. <a name="GDB-Command-20"></a>
  78. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  79. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>set args</samp>&rsquo;.
  80. </p>
  81. <a name="Example-20"></a>
  82. <h4 class="subsubheading">Example</h4>
  83. <div class="smallexample">
  84. <pre class="smallexample">(gdb)
  85. -exec-arguments -v word
  86. ^done
  87. (gdb)
  88. </pre></div>
  89. <a name="The-_002denvironment_002dcd-Command"></a>
  90. <h4 class="subheading">The <code>-environment-cd</code> Command</h4>
  91. <a name="index-_002denvironment_002dcd"></a>
  92. <a name="Synopsis-22"></a>
  93. <h4 class="subsubheading">Synopsis</h4>
  94. <div class="smallexample">
  95. <pre class="smallexample"> -environment-cd <var>pathdir</var>
  96. </pre></div>
  97. <p>Set <small>GDB</small>&rsquo;s working directory.
  98. </p>
  99. <a name="GDB-Command-21"></a>
  100. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  101. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>cd</samp>&rsquo;.
  102. </p>
  103. <a name="Example-21"></a>
  104. <h4 class="subsubheading">Example</h4>
  105. <div class="smallexample">
  106. <pre class="smallexample">(gdb)
  107. -environment-cd /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
  108. ^done
  109. (gdb)
  110. </pre></div>
  111. <a name="The-_002denvironment_002ddirectory-Command"></a>
  112. <h4 class="subheading">The <code>-environment-directory</code> Command</h4>
  113. <a name="index-_002denvironment_002ddirectory"></a>
  114. <a name="Synopsis-23"></a>
  115. <h4 class="subsubheading">Synopsis</h4>
  116. <div class="smallexample">
  117. <pre class="smallexample"> -environment-directory [ -r ] [ <var>pathdir</var> ]+
  118. </pre></div>
  119. <p>Add directories <var>pathdir</var> to beginning of search path for source files.
  120. If the &lsquo;<samp>-r</samp>&rsquo; option is used, the search path is reset to the default
  121. search path. If directories <var>pathdir</var> are supplied in addition to the
  122. &lsquo;<samp>-r</samp>&rsquo; option, the search path is first reset and then addition
  123. occurs as normal.
  124. Multiple directories may be specified, separated by blanks. Specifying
  125. multiple directories in a single command
  126. results in the directories added to the beginning of the
  127. search path in the same order they were presented in the command.
  128. If blanks are needed as
  129. part of a directory name, double-quotes should be used around
  130. the name. In the command output, the path will show up separated
  131. by the system directory-separator character. The directory-separator
  132. character must not be used
  133. in any directory name.
  134. If no directories are specified, the current search path is displayed.
  135. </p>
  136. <a name="GDB-Command-22"></a>
  137. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  138. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>dir</samp>&rsquo;.
  139. </p>
  140. <a name="Example-22"></a>
  141. <h4 class="subsubheading">Example</h4>
  142. <div class="smallexample">
  143. <pre class="smallexample">(gdb)
  144. -environment-directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
  145. ^done,source-path=&quot;/kwikemart/marge/ezannoni/flathead-dev/devo/gdb:$cdir:$cwd&quot;
  146. (gdb)
  147. -environment-directory &quot;&quot;
  148. ^done,source-path=&quot;/kwikemart/marge/ezannoni/flathead-dev/devo/gdb:$cdir:$cwd&quot;
  149. (gdb)
  150. -environment-directory -r /home/jjohnstn/src/gdb /usr/src
  151. ^done,source-path=&quot;/home/jjohnstn/src/gdb:/usr/src:$cdir:$cwd&quot;
  152. (gdb)
  153. -environment-directory -r
  154. ^done,source-path=&quot;$cdir:$cwd&quot;
  155. (gdb)
  156. </pre></div>
  157. <a name="The-_002denvironment_002dpath-Command"></a>
  158. <h4 class="subheading">The <code>-environment-path</code> Command</h4>
  159. <a name="index-_002denvironment_002dpath"></a>
  160. <a name="Synopsis-24"></a>
  161. <h4 class="subsubheading">Synopsis</h4>
  162. <div class="smallexample">
  163. <pre class="smallexample"> -environment-path [ -r ] [ <var>pathdir</var> ]+
  164. </pre></div>
  165. <p>Add directories <var>pathdir</var> to beginning of search path for object files.
  166. If the &lsquo;<samp>-r</samp>&rsquo; option is used, the search path is reset to the original
  167. search path that existed at gdb start-up. If directories <var>pathdir</var> are
  168. supplied in addition to the
  169. &lsquo;<samp>-r</samp>&rsquo; option, the search path is first reset and then addition
  170. occurs as normal.
  171. Multiple directories may be specified, separated by blanks. Specifying
  172. multiple directories in a single command
  173. results in the directories added to the beginning of the
  174. search path in the same order they were presented in the command.
  175. If blanks are needed as
  176. part of a directory name, double-quotes should be used around
  177. the name. In the command output, the path will show up separated
  178. by the system directory-separator character. The directory-separator
  179. character must not be used
  180. in any directory name.
  181. If no directories are specified, the current path is displayed.
  182. </p>
  183. <a name="GDB-Command-23"></a>
  184. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  185. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>path</samp>&rsquo;.
  186. </p>
  187. <a name="Example-23"></a>
  188. <h4 class="subsubheading">Example</h4>
  189. <div class="smallexample">
  190. <pre class="smallexample">(gdb)
  191. -environment-path
  192. ^done,path=&quot;/usr/bin&quot;
  193. (gdb)
  194. -environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb /bin
  195. ^done,path=&quot;/kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb:/bin:/usr/bin&quot;
  196. (gdb)
  197. -environment-path -r /usr/local/bin
  198. ^done,path=&quot;/usr/local/bin:/usr/bin&quot;
  199. (gdb)
  200. </pre></div>
  201. <a name="The-_002denvironment_002dpwd-Command"></a>
  202. <h4 class="subheading">The <code>-environment-pwd</code> Command</h4>
  203. <a name="index-_002denvironment_002dpwd"></a>
  204. <a name="Synopsis-25"></a>
  205. <h4 class="subsubheading">Synopsis</h4>
  206. <div class="smallexample">
  207. <pre class="smallexample"> -environment-pwd
  208. </pre></div>
  209. <p>Show the current working directory.
  210. </p>
  211. <a name="GDB-Command-24"></a>
  212. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  213. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>pwd</samp>&rsquo;.
  214. </p>
  215. <a name="Example-24"></a>
  216. <h4 class="subsubheading">Example</h4>
  217. <div class="smallexample">
  218. <pre class="smallexample">(gdb)
  219. -environment-pwd
  220. ^done,cwd=&quot;/kwikemart/marge/ezannoni/flathead-dev/devo/gdb&quot;
  221. (gdb)
  222. </pre></div>
  223. <hr>
  224. <div class="header">
  225. <p>
  226. Next: <a href="GDB_002fMI-Thread-Commands.html#GDB_002fMI-Thread-Commands" accesskey="n" rel="next">GDB/MI Thread Commands</a>, Previous: <a href="GDB_002fMI-Catchpoint-Commands.html#GDB_002fMI-Catchpoint-Commands" accesskey="p" rel="previous">GDB/MI Catchpoint Commands</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>
  227. </div>
  228. </body>
  229. </html>