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

GDB_002fMI-Program-Context.html 10KB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Free Software" and "Free Software Needs
  8. Free Documentation", with the Front-Cover Texts being "A GNU Manual,"
  9. and with the Back-Cover Texts as in (a) below.
  10. (a) The FSF's Back-Cover Text is: "You are free to copy and modify
  11. this GNU Manual. Buying copies from GNU Press supports the FSF in
  12. developing GNU and promoting software freedom." -->
  13. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  16. <title>GDB/MI Program Context (Debugging with GDB)</title>
  17. <meta name="description" content="GDB/MI Program Context (Debugging with GDB)">
  18. <meta name="keywords" content="GDB/MI Program Context (Debugging with GDB)">
  19. <meta name="resource-type" content="document">
  20. <meta name="distribution" content="global">
  21. <meta name="Generator" content="makeinfo">
  22. <link href="index.html#Top" rel="start" title="Top">
  23. <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
  24. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  25. <link href="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="prev" title="C++ Exception GDB/MI Catchpoint Commands">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.indentedblock {margin-right: 0em}
  32. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  33. blockquote.smallquotation {font-size: smaller}
  34. div.display {margin-left: 3.2em}
  35. div.example {margin-left: 3.2em}
  36. div.lisp {margin-left: 3.2em}
  37. div.smalldisplay {margin-left: 3.2em}
  38. div.smallexample {margin-left: 3.2em}
  39. div.smalllisp {margin-left: 3.2em}
  40. kbd {font-style: oblique}
  41. pre.display {font-family: inherit}
  42. pre.format {font-family: inherit}
  43. pre.menu-comment {font-family: serif}
  44. pre.menu-preformatted {font-family: serif}
  45. pre.smalldisplay {font-family: inherit; font-size: smaller}
  46. pre.smallexample {font-size: smaller}
  47. pre.smallformat {font-family: inherit; font-size: smaller}
  48. pre.smalllisp {font-size: smaller}
  49. span.nolinebreak {white-space: nowrap}
  50. span.roman {font-family: initial; font-weight: normal}
  51. span.sansserif {font-family: sans-serif; font-weight: normal}
  52. ul.no-bullet {list-style: none}
  53. -->
  54. </style>
  55. </head>
  56. <body lang="en">
  57. <a name="GDB_002fMI-Program-Context"></a>
  58. <div class="header">
  59. <p>
  60. 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="prev">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>
  61. </div>
  62. <hr>
  63. <a name="GDB_002fMI-Program-Context-1"></a>
  64. <h3 class="section">27.10 <small>GDB/MI</small> Program Context</h3>
  65. <a name="The-_002dexec_002darguments-Command"></a>
  66. <h4 class="subheading">The <code>-exec-arguments</code> Command</h4>
  67. <a name="index-_002dexec_002darguments"></a>
  68. <a name="Synopsis-21"></a>
  69. <h4 class="subsubheading">Synopsis</h4>
  70. <div class="smallexample">
  71. <pre class="smallexample"> -exec-arguments <var>args</var>
  72. </pre></div>
  73. <p>Set the inferior program arguments, to be used in the next
  74. &lsquo;<samp>-exec-run</samp>&rsquo;.
  75. </p>
  76. <a name="GDB-Command-20"></a>
  77. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  78. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>set args</samp>&rsquo;.
  79. </p>
  80. <a name="Example-20"></a>
  81. <h4 class="subsubheading">Example</h4>
  82. <div class="smallexample">
  83. <pre class="smallexample">(gdb)
  84. -exec-arguments -v word
  85. ^done
  86. (gdb)
  87. </pre></div>
  88. <a name="The-_002denvironment_002dcd-Command"></a>
  89. <h4 class="subheading">The <code>-environment-cd</code> Command</h4>
  90. <a name="index-_002denvironment_002dcd"></a>
  91. <a name="Synopsis-22"></a>
  92. <h4 class="subsubheading">Synopsis</h4>
  93. <div class="smallexample">
  94. <pre class="smallexample"> -environment-cd <var>pathdir</var>
  95. </pre></div>
  96. <p>Set <small>GDB</small>&rsquo;s working directory.
  97. </p>
  98. <a name="GDB-Command-21"></a>
  99. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  100. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>cd</samp>&rsquo;.
  101. </p>
  102. <a name="Example-21"></a>
  103. <h4 class="subsubheading">Example</h4>
  104. <div class="smallexample">
  105. <pre class="smallexample">(gdb)
  106. -environment-cd /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
  107. ^done
  108. (gdb)
  109. </pre></div>
  110. <a name="The-_002denvironment_002ddirectory-Command"></a>
  111. <h4 class="subheading">The <code>-environment-directory</code> Command</h4>
  112. <a name="index-_002denvironment_002ddirectory"></a>
  113. <a name="Synopsis-23"></a>
  114. <h4 class="subsubheading">Synopsis</h4>
  115. <div class="smallexample">
  116. <pre class="smallexample"> -environment-directory [ -r ] [ <var>pathdir</var> ]+
  117. </pre></div>
  118. <p>Add directories <var>pathdir</var> to beginning of search path for source files.
  119. If the &lsquo;<samp>-r</samp>&rsquo; option is used, the search path is reset to the default
  120. search path. If directories <var>pathdir</var> are supplied in addition to the
  121. &lsquo;<samp>-r</samp>&rsquo; option, the search path is first reset and then addition
  122. occurs as normal.
  123. Multiple directories may be specified, separated by blanks. Specifying
  124. multiple directories in a single command
  125. results in the directories added to the beginning of the
  126. search path in the same order they were presented in the command.
  127. If blanks are needed as
  128. part of a directory name, double-quotes should be used around
  129. the name. In the command output, the path will show up separated
  130. by the system directory-separator character. The directory-separator
  131. character must not be used
  132. in any directory name.
  133. If no directories are specified, the current search path is displayed.
  134. </p>
  135. <a name="GDB-Command-22"></a>
  136. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  137. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>dir</samp>&rsquo;.
  138. </p>
  139. <a name="Example-22"></a>
  140. <h4 class="subsubheading">Example</h4>
  141. <div class="smallexample">
  142. <pre class="smallexample">(gdb)
  143. -environment-directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
  144. ^done,source-path=&quot;/kwikemart/marge/ezannoni/flathead-dev/devo/gdb:$cdir:$cwd&quot;
  145. (gdb)
  146. -environment-directory &quot;&quot;
  147. ^done,source-path=&quot;/kwikemart/marge/ezannoni/flathead-dev/devo/gdb:$cdir:$cwd&quot;
  148. (gdb)
  149. -environment-directory -r /home/jjohnstn/src/gdb /usr/src
  150. ^done,source-path=&quot;/home/jjohnstn/src/gdb:/usr/src:$cdir:$cwd&quot;
  151. (gdb)
  152. -environment-directory -r
  153. ^done,source-path=&quot;$cdir:$cwd&quot;
  154. (gdb)
  155. </pre></div>
  156. <a name="The-_002denvironment_002dpath-Command"></a>
  157. <h4 class="subheading">The <code>-environment-path</code> Command</h4>
  158. <a name="index-_002denvironment_002dpath"></a>
  159. <a name="Synopsis-24"></a>
  160. <h4 class="subsubheading">Synopsis</h4>
  161. <div class="smallexample">
  162. <pre class="smallexample"> -environment-path [ -r ] [ <var>pathdir</var> ]+
  163. </pre></div>
  164. <p>Add directories <var>pathdir</var> to beginning of search path for object files.
  165. If the &lsquo;<samp>-r</samp>&rsquo; option is used, the search path is reset to the original
  166. search path that existed at gdb start-up. If directories <var>pathdir</var> are
  167. supplied in addition to the
  168. &lsquo;<samp>-r</samp>&rsquo; option, the search path is first reset and then addition
  169. occurs as normal.
  170. Multiple directories may be specified, separated by blanks. Specifying
  171. multiple directories in a single command
  172. results in the directories added to the beginning of the
  173. search path in the same order they were presented in the command.
  174. If blanks are needed as
  175. part of a directory name, double-quotes should be used around
  176. the name. In the command output, the path will show up separated
  177. by the system directory-separator character. The directory-separator
  178. character must not be used
  179. in any directory name.
  180. If no directories are specified, the current path is displayed.
  181. </p>
  182. <a name="GDB-Command-23"></a>
  183. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  184. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>path</samp>&rsquo;.
  185. </p>
  186. <a name="Example-23"></a>
  187. <h4 class="subsubheading">Example</h4>
  188. <div class="smallexample">
  189. <pre class="smallexample">(gdb)
  190. -environment-path
  191. ^done,path=&quot;/usr/bin&quot;
  192. (gdb)
  193. -environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb /bin
  194. ^done,path=&quot;/kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb:/bin:/usr/bin&quot;
  195. (gdb)
  196. -environment-path -r /usr/local/bin
  197. ^done,path=&quot;/usr/local/bin:/usr/bin&quot;
  198. (gdb)
  199. </pre></div>
  200. <a name="The-_002denvironment_002dpwd-Command"></a>
  201. <h4 class="subheading">The <code>-environment-pwd</code> Command</h4>
  202. <a name="index-_002denvironment_002dpwd"></a>
  203. <a name="Synopsis-25"></a>
  204. <h4 class="subsubheading">Synopsis</h4>
  205. <div class="smallexample">
  206. <pre class="smallexample"> -environment-pwd
  207. </pre></div>
  208. <p>Show the current working directory.
  209. </p>
  210. <a name="GDB-Command-24"></a>
  211. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  212. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>pwd</samp>&rsquo;.
  213. </p>
  214. <a name="Example-24"></a>
  215. <h4 class="subsubheading">Example</h4>
  216. <div class="smallexample">
  217. <pre class="smallexample">(gdb)
  218. -environment-pwd
  219. ^done,cwd=&quot;/kwikemart/marge/ezannoni/flathead-dev/devo/gdb&quot;
  220. (gdb)
  221. </pre></div>
  222. <hr>
  223. <div class="header">
  224. <p>
  225. 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="prev">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>
  226. </div>
  227. </body>
  228. </html>