1 _dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
2 _dnl__ This file is part of the source for the GDB manual.
4 @node Commands, Running, Invocation, Top
5 @chapter _GDBN__ Commands
8 * Command Syntax:: Command Syntax
12 @node Command Syntax, Help, Commands, Commands
13 @section Command Syntax
14 A _GDBN__ command is a single line of input. There is no limit on how long
15 it can be. It starts with a command name, which is followed by arguments
16 whose meaning depends on the command name. For example, the command
17 @code{step} accepts an argument which is the number of times to step,
18 as in @samp{step 5}. You can also use the @code{step} command with
19 no arguments. Some command names do not allow any arguments.
22 _GDBN__ command names may always be truncated if that abbreviation is
23 unambiguous. Other possible command abbreviations are listed in the
24 documentation for individual commands. Sometimes even ambiguous
25 abbreviations are allowed; for example, @code{s} is specially defined as
26 equivalent to @code{step} even though there are other commands whose
27 names start with @code{s}.
29 @cindex repeating commands
30 A blank line as input to _GDBN__ means to repeat the previous command.
31 Certain commands (for example, @code{run}) will not repeat this way;
32 these are commands for which unintentional repetition might cause
33 trouble and which you are unlikely to want to repeat.
35 The @code{list} and @code{x} commands construct new arguments when
36 repeated, rather than repeating exactly as typed, to permit easy
37 scanning of source or memory.
41 A line of input starting with @kbd{#} is a comment; it does nothing.
42 This is useful mainly in command files (@xref{Command Files}).
44 @node Help, , Command Syntax, Commands
46 @cindex online documentation
48 You can always ask _GDBN__ itself for information on its commands, using the
55 You can use @code{help} (abbreviated @code{h}) with no arguments to
56 display a short list of named categories of commands:
59 List of classes of commands:
61 running -- Running the program
62 stack -- Examining the stack
63 data -- Examining data
64 breakpoints -- Making program stop at certain points
65 files -- Specifying and examining files
66 status -- Status inquiries
67 support -- Support facilities
68 user-defined -- User-defined commands
69 aliases -- Aliases of other commands
70 obscure -- Obscure features
72 Type "help" followed by a class name for a list of commands in that class.
73 Type "help" followed by command name for full documentation.
74 Command name abbreviations are allowed if unambiguous.
78 @item help @var{category}
79 Using one of the general help categories as an argument, you can get a
80 list of the individual commands in a category. For example, here is the
81 help display for category @code{status}:
88 show -- Generic command for showing things set with "set"
89 info -- Generic command for printing status
91 Type "help" followed by command name for full documentation.
92 Command name abbreviations are allowed if unambiguous.
96 @item help @var{command}
97 With a command name as @code{help} argument, _GDBN__ will display a
98 short paragraph on how to use that command.
101 In addition to @code{help}, you can use the _GDBN__ commands @code{info}
102 and @code{show} to inquire about the state of your program, or the state
103 of _GDBN__ itself. Both commands support many topics of inquiry; this
104 manual introduces each of them in the appropriate context. The listings
105 under @code{info} and under @code{show} in the Index point to
106 all the sub-commands.
107 @c FIXME: @pxref{Index} used to be here, but even though it shows up in
108 @c FIXME...the 'aux' file with a pageno the xref can't find it.
115 This command (abbreviated @code{i}) is for describing the state of your
116 program; for example, it can list the arguments given to your program
117 (@code{info args}), the registers currently in use (@code{info
118 registers}), or the breakpoints you've set (@code{info breakpoints}).
119 You can get a complete list of the @code{info} sub-commands with
120 @w{@code{help info}}.
124 In contrast, @code{show} is for describing the state of _GDBN__ itself.
125 You can change most of the things you can @code{show}, by using the
126 related command @code{set}; for example, you can control what number
127 system is used for displays with @code{set radix}, or simply inquire
128 which is currently in use with @code{show radix}.
131 To display all the settable parameters and their current
132 values, you can use @code{show} with no arguments; you may also use
133 @code{info set}. Both commands produce the same display.
134 @c FIXME: "info set" violates the rule that "info" is for state of
135 @c FIXME...program. Ck w/ GNU: "info set" to be called something else,
136 @c FIXME...or change desc of rule---eg "state of prog and debugging session"?
140 Here are three miscellaneous @code{show} subcommands, all of which are
141 exceptional in lacking corresponding @code{set} commands:
146 Show what version of _GDBN__ is running. You should include this
147 information in _GDBN__ bug-reports. If multiple versions of _GDBN__ are
148 in use at your site, you may occasionally want to make sure what version
149 of _GDBN__ you're running; as _GDBN__ evolves, new commands are
150 introduced, and old ones may wither away. The version number is also
151 announced when you start _GDBN__ with no arguments.
155 Display information about permission for copying _GDBN__.
157 @kindex show warranty
159 Display the GNU ``NO WARRANTY'' statement.