blob: c2b90cfbf11582f3778ae4a2573b5b8750a856d6 [file] [log] [blame]
<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, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
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>
<link rel="stylesheet" type="text/css" href="../cs.css">
</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-83"></a><a name="index-help-84"></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-85"></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-86"></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 reload
</pre>
<p class="noindent">results in:
<pre class="smallexample"> <!-- @group -->
set symbol-reloading -- Set dynamic symbol table reloading
multiple times in one run
show symbol-reloading -- Show dynamic symbol table reloading
multiple times in one run
<!-- @end group -->
</pre>
<p><a name="index-complete-87"></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 Index point to
all the sub-commands. See <a href="GDB-Index.html#GDB-Index">GDB Index</a>.
<!-- @group -->
<a name="index-info-88"></a>
<a name="index-i-_0040r_007b_0028_0040code_007binfo_007d_0029_007d-89"></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-90"></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-91"></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-92"></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 three miscellaneous <code>show</code> subcommands, all of which are
exceptional in lacking corresponding <code>set</code> commands:
<a name="index-show-version-93"></a>
<a name="index-g_t_0040value_007bGDBN_007d-version-number-94"></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-95"></a><a name="index-info-copying-96"></a><a name="index-display-_0040value_007bGDBN_007d-copyright-97"></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-98"></a><a name="index-info-warranty-99"></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.
</dl>
</body></html>