toolchain/share/doc/gdb/Help.html

209 lines
10 KiB
HTML

<html lang="en">
<head>
<title>Help - Debugging with GDB</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Debugging with GDB">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Commands.html#Commands" title="Commands">
<link rel="prev" href="Completion.html#Completion" title="Completion">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Free Software'' and ``Free Software Needs
Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,''
and with the Back-Cover Texts as in (a) below.
(a) The FSF's Back-Cover Text is: ``You are free to copy and modify
this GNU Manual. Buying copies from GNU Press supports the FSF in
developing GNU and promoting software freedom.''
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="Help"></a>
<p>
Previous:&nbsp;<a rel="previous" accesskey="p" href="Completion.html#Completion">Completion</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Commands.html#Commands">Commands</a>
<hr>
</div>
<h3 class="section">3.3 Getting Help</h3>
<p><a name="index-online-documentation-94"></a><a name="index-help-95"></a>
You can always ask <span class="sc">gdb</span> itself for information on its commands,
using the command <code>help</code>.
<a name="index-h-_0040r_007b_0028_0040code_007bhelp_007d_0029_007d-96"></a>
<dl><dt><code>help</code><dt><code>h</code><dd>You can use <code>help</code> (abbreviated <code>h</code>) with no arguments to
display a short list of named classes of commands:
<pre class="smallexample"> (gdb) help
List of classes of commands:
aliases -- Aliases of other commands
breakpoints -- Making program stop at certain points
data -- Examining data
files -- Specifying and examining files
internals -- Maintenance commands
obscure -- Obscure features
running -- Running the program
stack -- Examining the stack
status -- Status inquiries
support -- Support facilities
tracepoints -- Tracing of program execution without
stopping the program
user-defined -- User-defined commands
Type "help" followed by a class name for a list of
commands in that class.
Type "help" followed by command name for full
documentation.
Command name abbreviations are allowed if unambiguous.
(gdb)
</pre>
<!-- the above line break eliminates huge line overfull... -->
<br><dt><code>help </code><var>class</var><dd>Using one of the general help classes as an argument, you can get a
list of the individual commands in that class. For example, here is the
help display for the class <code>status</code>:
<pre class="smallexample"> (gdb) help status
Status inquiries.
List of commands:
<!-- Line break in "show" line falsifies real output, but needed -->
<!-- to fit in smallbook page size. -->
info -- Generic command for showing things
about the program being debugged
show -- Generic command for showing things
about the debugger
Type "help" followed by command name for full
documentation.
Command name abbreviations are allowed if unambiguous.
(gdb)
</pre>
<br><dt><code>help </code><var>command</var><dd>With a command name as <code>help</code> argument, <span class="sc">gdb</span> displays a
short paragraph on how to use that command.
<p><a name="index-apropos-97"></a><br><dt><code>apropos </code><var>args</var><dd>The <code>apropos</code> command searches through all of the <span class="sc">gdb</span>
commands, and their documentation, for the regular expression specified in
<var>args</var>. It prints out all matches found. For example:
<pre class="smallexample"> apropos alias
</pre>
<p class="noindent">results in:
<pre class="smallexample"> <!-- @group -->
alias -- Define a new command that is an alias of an existing command
aliases -- Aliases of other commands
d -- Delete some breakpoints or auto-display expressions
del -- Delete some breakpoints or auto-display expressions
delete -- Delete some breakpoints or auto-display expressions
<!-- @end group -->
</pre>
<p><a name="index-complete-98"></a><br><dt><code>complete </code><var>args</var><dd>The <code>complete </code><var>args</var> command lists all the possible completions
for the beginning of a command. Use <var>args</var> to specify the beginning of the
command you want completed. For example:
<pre class="smallexample"> complete i
</pre>
<p class="noindent">results in:
<pre class="smallexample"> if
ignore
info
inspect
</pre>
<p class="noindent">This is intended for use by <span class="sc">gnu</span> Emacs.
</dl>
<p>In addition to <code>help</code>, you can use the <span class="sc">gdb</span> commands <code>info</code>
and <code>show</code> to inquire about the state of your program, or the state
of <span class="sc">gdb</span> itself. Each command supports many topics of inquiry; this
manual introduces each of them in the appropriate context. The listings
under <code>info</code> and under <code>show</code> in the Command, Variable, and
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>.
<!-- @group -->
<a name="index-info-99"></a>
<a name="index-i-_0040r_007b_0028_0040code_007binfo_007d_0029_007d-100"></a>
<dl><dt><code>info</code><dd>This command (abbreviated <code>i</code>) is for describing the state of your
program. For example, you can show the arguments passed to a function
with <code>info args</code>, list the registers currently in use with <code>info
registers</code>, or list the breakpoints you have set with <code>info breakpoints</code>.
You can get a complete list of the <code>info</code> sub-commands with
<code>help&nbsp;info</code><!-- /@w -->.
<p><a name="index-set-101"></a><br><dt><code>set</code><dd>You can assign the result of an expression to an environment variable with
<code>set</code>. For example, you can set the <span class="sc">gdb</span> prompt to a $-sign with
<code>set prompt $</code>.
<p><a name="index-show-102"></a><br><dt><code>show</code><dd>In contrast to <code>info</code>, <code>show</code> is for describing the state of
<span class="sc">gdb</span> itself.
You can change most of the things you can <code>show</code>, by using the
related command <code>set</code>; for example, you can control what number
system is used for displays with <code>set radix</code>, or simply inquire
which is currently in use with <code>show radix</code>.
<p><a name="index-info-set-103"></a>To display all the settable parameters and their current
values, you can use <code>show</code> with no arguments; you may also use
<code>info set</code>. Both commands produce the same display.
<!-- FIXME: "info set" violates the rule that "info" is for state of -->
<!-- FIXME...program. Ck w/ GNU: "info set" to be called something else, -->
<!-- FIXME...or change desc of rule-eg "state of prog and debugging session"? -->
</dl>
<!-- @end group -->
<p>Here are several miscellaneous <code>show</code> subcommands, all of which are
exceptional in lacking corresponding <code>set</code> commands:
<a name="index-show-version-104"></a>
<a name="index-g_t_0040value_007bGDBN_007d-version-number-105"></a>
<dl><dt><code>show version</code><dd>Show what version of <span class="sc">gdb</span> is running. You should include this
information in <span class="sc">gdb</span> bug-reports. If multiple versions of
<span class="sc">gdb</span> are in use at your site, you may need to determine which
version of <span class="sc">gdb</span> you are running; as <span class="sc">gdb</span> evolves, new
commands are introduced, and old ones may wither away. Also, many
system vendors ship variant versions of <span class="sc">gdb</span>, and there are
variant versions of <span class="sc">gdb</span> in <span class="sc">gnu</span>/Linux distributions as well.
The version number is the same as the one announced when you start
<span class="sc">gdb</span>.
<p><a name="index-show-copying-106"></a><a name="index-info-copying-107"></a><a name="index-display-_0040value_007bGDBN_007d-copyright-108"></a><br><dt><code>show copying</code><dt><code>info copying</code><dd>Display information about permission for copying <span class="sc">gdb</span>.
<p><a name="index-show-warranty-109"></a><a name="index-info-warranty-110"></a><br><dt><code>show warranty</code><dt><code>info warranty</code><dd>Display the <span class="sc">gnu</span> &ldquo;NO WARRANTY&rdquo; statement, or a warranty,
if your version of <span class="sc">gdb</span> comes with one.
<p><a name="index-show-configuration-111"></a><br><dt><code>show configuration</code><dd>Display detailed information about the way <span class="sc">gdb</span> was configured
when it was built. This displays the optional arguments passed to the
<samp><span class="file">configure</span></samp> script and also configuration parameters detected
automatically by <samp><span class="command">configure</span></samp>. When reporting a <span class="sc">gdb</span>
bug (see <a href="GDB-Bugs.html#GDB-Bugs">GDB Bugs</a>), it is important to include this information in
your report.
</dl>
</body></html>