Help.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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: Help</title>
  16. <meta name="description" content="Debugging with GDB: Help">
  17. <meta name="keywords" content="Debugging with GDB: Help">
  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="Commands.html#Commands" rel="up" title="Commands">
  26. <link href="Running.html#Running" rel="next" title="Running">
  27. <link href="Command-aliases-default-args.html#Command-aliases-default-args" rel="previous" title="Command aliases default args">
  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="Help"></a>
  59. <div class="header">
  60. <p>
  61. Previous: <a href="Command-aliases-default-args.html#Command-aliases-default-args" accesskey="p" rel="previous">Command aliases default args</a>, Up: <a href="Commands.html#Commands" accesskey="u" rel="up">Commands</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="Getting-Help"></a>
  65. <h3 class="section">3.6 Getting Help</h3>
  66. <a name="index-online-documentation"></a>
  67. <a name="index-help"></a>
  68. <p>You can always ask <small>GDB</small> itself for information on its commands,
  69. using the command <code>help</code>.
  70. </p>
  71. <dl compact="compact">
  72. <dd><a name="index-h-_0028help_0029"></a>
  73. </dd>
  74. <dt><code>help</code></dt>
  75. <dt><code>h</code></dt>
  76. <dd><p>You can use <code>help</code> (abbreviated <code>h</code>) with no arguments to
  77. display a short list of named classes of commands:
  78. </p>
  79. <div class="smallexample">
  80. <pre class="smallexample">(gdb) help
  81. List of classes of commands:
  82. aliases -- User-defined aliases of other commands
  83. breakpoints -- Making program stop at certain points
  84. data -- Examining data
  85. files -- Specifying and examining files
  86. internals -- Maintenance commands
  87. obscure -- Obscure features
  88. running -- Running the program
  89. stack -- Examining the stack
  90. status -- Status inquiries
  91. support -- Support facilities
  92. tracepoints -- Tracing of program execution without
  93. stopping the program
  94. user-defined -- User-defined commands
  95. Type &quot;help&quot; followed by a class name for a list of
  96. commands in that class.
  97. Type &quot;help&quot; followed by command name for full
  98. documentation.
  99. Command name abbreviations are allowed if unambiguous.
  100. (gdb)
  101. </pre></div>
  102. </dd>
  103. <dt><code>help <var>class</var></code></dt>
  104. <dd><p>Using one of the general help classes as an argument, you can get a
  105. list of the individual commands in that class. If a command has
  106. aliases, the aliases are given after the command name, separated by
  107. commas. If an alias has default arguments, the full definition of
  108. the alias is given after the first line.
  109. For example, here is the help display for the class <code>status</code>:
  110. </p>
  111. <div class="smallexample">
  112. <pre class="smallexample">(gdb) help status
  113. Status inquiries.
  114. List of commands:
  115. info, inf, i -- Generic command for showing things
  116. about the program being debugged
  117. info address, iamain -- Describe where symbol SYM is stored.
  118. alias iamain = info address main
  119. info all-registers -- List of all registers and their contents,
  120. for selected stack frame.
  121. ...
  122. show, info set -- Generic command for showing things
  123. about the debugger
  124. Type &quot;help&quot; followed by command name for full
  125. documentation.
  126. Command name abbreviations are allowed if unambiguous.
  127. (gdb)
  128. </pre></div>
  129. </dd>
  130. <dt><code>help <var>command</var></code></dt>
  131. <dd><p>With a command name as <code>help</code> argument, <small>GDB</small> displays a
  132. short paragraph on how to use that command. If that command has
  133. one or more aliases, <small>GDB</small> will display a first line with
  134. the command name and all its aliases separated by commas.
  135. This first line will be followed by the full definition of all aliases
  136. having default arguments.
  137. </p>
  138. <a name="index-apropos"></a>
  139. </dd>
  140. <dt><code>apropos [-v] <var>regexp</var></code></dt>
  141. <dd><p>The <code>apropos</code> command searches through all of the <small>GDB</small>
  142. commands, and their documentation, for the regular expression specified in
  143. <var>args</var>. It prints out all matches found. The optional flag &lsquo;<samp>-v</samp>&rsquo;,
  144. which stands for &lsquo;<samp>verbose</samp>&rsquo;, indicates to output the full documentation
  145. of the matching commands and highlight the parts of the documentation
  146. matching <var>regexp</var>. For example:
  147. </p>
  148. <div class="smallexample">
  149. <pre class="smallexample">apropos alias
  150. </pre></div>
  151. <p>results in:
  152. </p>
  153. <div class="smallexample">
  154. <pre class="smallexample">alias -- Define a new command that is an alias of an existing command
  155. aliases -- User-defined aliases of other commands
  156. </pre></div>
  157. <p>while
  158. </p>
  159. <div class="smallexample">
  160. <pre class="smallexample">apropos -v cut.*thread apply
  161. </pre></div>
  162. <p>results in the below output, where &lsquo;<samp>cut for 'thread apply</samp>&rsquo;
  163. is highlighted if styling is enabled.
  164. </p>
  165. <div class="smallexample">
  166. <pre class="smallexample">taas -- Apply a command to all threads (ignoring errors
  167. and empty output).
  168. Usage: taas COMMAND
  169. shortcut for 'thread apply all -s COMMAND'
  170. tfaas -- Apply a command to all frames of all threads
  171. (ignoring errors and empty output).
  172. Usage: tfaas COMMAND
  173. shortcut for 'thread apply all -s frame apply all -s COMMAND'
  174. </pre></div>
  175. <a name="index-complete"></a>
  176. </dd>
  177. <dt><code>complete <var>args</var></code></dt>
  178. <dd><p>The <code>complete <var>args</var></code> command lists all the possible completions
  179. for the beginning of a command. Use <var>args</var> to specify the beginning of the
  180. command you want completed. For example:
  181. </p>
  182. <div class="smallexample">
  183. <pre class="smallexample">complete i
  184. </pre></div>
  185. <p>results in:
  186. </p>
  187. <div class="smallexample">
  188. <pre class="smallexample">if
  189. ignore
  190. info
  191. inspect
  192. </pre></div>
  193. <p>This is intended for use by <small>GNU</small> Emacs.
  194. </p></dd>
  195. </dl>
  196. <p>In addition to <code>help</code>, you can use the <small>GDB</small> commands <code>info</code>
  197. and <code>show</code> to inquire about the state of your program, or the state
  198. of <small>GDB</small> itself. Each command supports many topics of inquiry; this
  199. manual introduces each of them in the appropriate context. The listings
  200. under <code>info</code> and under <code>show</code> in the Command, Variable, and
  201. Function Index point to all the sub-commands. See <a href="Command-and-Variable-Index.html#Command-and-Variable-Index">Command and Variable Index</a>.
  202. </p>
  203. <dl compact="compact">
  204. <dd><a name="index-info"></a>
  205. <a name="index-i-_0028info_0029"></a>
  206. </dd>
  207. <dt><code>info</code></dt>
  208. <dd><p>This command (abbreviated <code>i</code>) is for describing the state of your
  209. program. For example, you can show the arguments passed to a function
  210. with <code>info args</code>, list the registers currently in use with <code>info
  211. registers</code>, or list the breakpoints you have set with <code>info breakpoints</code>.
  212. You can get a complete list of the <code>info</code> sub-commands with
  213. <code>help&nbsp;info</code><!-- /@w -->.
  214. </p>
  215. <a name="index-set"></a>
  216. </dd>
  217. <dt><code>set</code></dt>
  218. <dd><p>You can assign the result of an expression to an environment variable with
  219. <code>set</code>. For example, you can set the <small>GDB</small> prompt to a $-sign with
  220. <code>set prompt $</code>.
  221. </p>
  222. <a name="index-show"></a>
  223. </dd>
  224. <dt><code>show</code></dt>
  225. <dd><p>In contrast to <code>info</code>, <code>show</code> is for describing the state of
  226. <small>GDB</small> itself.
  227. You can change most of the things you can <code>show</code>, by using the
  228. related command <code>set</code>; for example, you can control what number
  229. system is used for displays with <code>set radix</code>, or simply inquire
  230. which is currently in use with <code>show radix</code>.
  231. </p>
  232. <a name="index-info-set"></a>
  233. <p>To display all the settable parameters and their current
  234. values, you can use <code>show</code> with no arguments; you may also use
  235. <code>info set</code>. Both commands produce the same display.
  236. </p></dd>
  237. </dl>
  238. <p>Here are several miscellaneous <code>show</code> subcommands, all of which are
  239. exceptional in lacking corresponding <code>set</code> commands:
  240. </p>
  241. <dl compact="compact">
  242. <dd><a name="index-show-version"></a>
  243. <a name="index-GDB-version-number"></a>
  244. </dd>
  245. <dt><code>show version</code></dt>
  246. <dd><p>Show what version of <small>GDB</small> is running. You should include this
  247. information in <small>GDB</small> bug-reports. If multiple versions of
  248. <small>GDB</small> are in use at your site, you may need to determine which
  249. version of <small>GDB</small> you are running; as <small>GDB</small> evolves, new
  250. commands are introduced, and old ones may wither away. Also, many
  251. system vendors ship variant versions of <small>GDB</small>, and there are
  252. variant versions of <small>GDB</small> in <small>GNU</small>/Linux distributions as well.
  253. The version number is the same as the one announced when you start
  254. <small>GDB</small>.
  255. </p>
  256. <a name="index-show-copying"></a>
  257. <a name="index-info-copying"></a>
  258. <a name="index-display-GDB-copyright"></a>
  259. </dd>
  260. <dt><code>show copying</code></dt>
  261. <dt><code>info copying</code></dt>
  262. <dd><p>Display information about permission for copying <small>GDB</small>.
  263. </p>
  264. <a name="index-show-warranty"></a>
  265. <a name="index-info-warranty"></a>
  266. </dd>
  267. <dt><code>show warranty</code></dt>
  268. <dt><code>info warranty</code></dt>
  269. <dd><p>Display the <small>GNU</small> &ldquo;NO WARRANTY&rdquo; statement, or a warranty,
  270. if your version of <small>GDB</small> comes with one.
  271. </p>
  272. <a name="index-show-configuration"></a>
  273. </dd>
  274. <dt><code>show configuration</code></dt>
  275. <dd><p>Display detailed information about the way <small>GDB</small> was configured
  276. when it was built. This displays the optional arguments passed to the
  277. <samp>configure</samp> script and also configuration parameters detected
  278. automatically by <code>configure</code>. When reporting a <small>GDB</small>
  279. bug (see <a href="GDB-Bugs.html#GDB-Bugs">GDB Bugs</a>), it is important to include this information in
  280. your report.
  281. </p>
  282. </dd>
  283. </dl>
  284. <hr>
  285. <div class="header">
  286. <p>
  287. Previous: <a href="Command-aliases-default-args.html#Command-aliases-default-args" accesskey="p" rel="previous">Command aliases default args</a>, Up: <a href="Commands.html#Commands" accesskey="u" rel="up">Commands</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>
  288. </div>
  289. </body>
  290. </html>