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.

317 lines
12KB

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