1) turned $Id: from m4 into texinfo comment
[deliverable/binutils-gdb.git] / gdb / doc / gdb.cmds-m4
CommitLineData
9bcc06ef
RP
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.
27189593 3@c M4 FRAGMENT: $Id$
9bcc06ef
RP
4@node Commands, Running, Invocation, Top
5@chapter _GDBN__ Commands
6
7@menu
8* Command Syntax:: Command Syntax
9* Help:: Getting Help
10@end menu
11
12@node Command Syntax, Help, Commands, Commands
13@section Command Syntax
14A _GDBN__ command is a single line of input. There is no limit on how long
15it can be. It starts with a command name, which is followed by arguments
16whose meaning depends on the command name. For example, the command
17@code{step} accepts an argument which is the number of times to step,
18as in @samp{step 5}. You can also use the @code{step} command with
19no arguments. Some command names do not allow any arguments.
20
21@cindex abbreviation
22_GDBN__ command names may always be truncated if that abbreviation is
23unambiguous. Other possible command abbreviations are listed in the
24documentation for individual commands. Sometimes even ambiguous
25abbreviations are allowed; for example, @code{s} is specially defined as
26equivalent to @code{step} even though there are other commands whose
27names start with @code{s}.
28
29@cindex repeating commands
30A blank line as input to _GDBN__ means to repeat the previous command.
31Certain commands (for example, @code{run}) will not repeat this way;
32these are commands for which unintentional repetition might cause
33trouble and which you are unlikely to want to repeat.
34
35The @code{list} and @code{x} commands construct new arguments when
36repeated, rather than repeating exactly as typed, to permit easy
37scanning of source or memory.
38
39@kindex #
40@cindex comment
41A line of input starting with @kbd{#} is a comment; it does nothing.
42This is useful mainly in command files (@xref{Command Files}).
43
44@node Help, , Command Syntax, Commands
45@section Getting Help
46@cindex online documentation
47@kindex help
48You can always ask _GDBN__ itself for information on its commands, using the
49command @code{help}.
50
51@table @code
52@item help
53@itemx h
54@kindex h
55You can use @code{help} (abbreviated @code{h}) with no arguments to
56display a short list of named categories of commands:
57@smallexample
58(_GDBP__) help
59List of classes of commands:
60
61running -- Running the program
62stack -- Examining the stack
63data -- Examining data
64breakpoints -- Making program stop at certain points
65files -- Specifying and examining files
66status -- Status inquiries
67support -- Support facilities
68user-defined -- User-defined commands
69aliases -- Aliases of other commands
70obscure -- Obscure features
71
72Type "help" followed by a class name for a list of commands in that class.
73Type "help" followed by command name for full documentation.
74Command name abbreviations are allowed if unambiguous.
75(_GDBP__)
76@end smallexample
77
78@item help @var{category}
79Using one of the general help categories as an argument, you can get a
80list of the individual commands in a category. For example, here is the
81help display for category @code{status}:
82@smallexample
83(_GDBP__) help status
84Status inquiries.
85
86List of commands:
87
88show -- Generic command for showing things set with "set"
89info -- Generic command for printing status
90
91Type "help" followed by command name for full documentation.
92Command name abbreviations are allowed if unambiguous.
93(_GDBP__)
94@end smallexample
95
96@item help @var{command}
97With a command name as @code{help} argument, _GDBN__ will display a
98short paragraph on how to use that command.
99@end table
100
101In addition to @code{help}, you can use the _GDBN__ commands @code{info}
102and @code{show} to inquire about the state of your program, or the state
103of _GDBN__ itself. Both commands support many topics of inquiry; this
104manual introduces each of them in the appropriate context. The listings
105under @code{info} and under @code{show} in the Index point to
106all 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.
109
27189593 110@c @group
9bcc06ef
RP
111@table @code
112@item info
113@kindex info
114@kindex i
115This command (abbreviated @code{i}) is for describing the state of your
116program; for example, it can list the arguments given to your program
117(@code{info args}), the registers currently in use (@code{info
118registers}), or the breakpoints you've set (@code{info breakpoints}).
119You can get a complete list of the @code{info} sub-commands with
120@w{@code{help info}}.
121
122@kindex show
123@item show
124In contrast, @code{show} is for describing the state of _GDBN__ itself.
125You can change most of the things you can @code{show}, by using the
126related command @code{set}; for example, you can control what number
127system is used for displays with @code{set radix}, or simply inquire
128which is currently in use with @code{show radix}.
129
130@kindex info set
131To display all the settable parameters and their current
132values, 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"?
137@end table
27189593 138@c @end group
9bcc06ef
RP
139
140Here are three miscellaneous @code{show} subcommands, all of which are
141exceptional in lacking corresponding @code{set} commands:
142
143@table @code
144@kindex show version
145@item show version
146Show what version of _GDBN__ is running. You should include this
147information in _GDBN__ bug-reports. If multiple versions of _GDBN__ are
148in use at your site, you may occasionally want to make sure what version
149of _GDBN__ you're running; as _GDBN__ evolves, new commands are
150introduced, and old ones may wither away. The version number is also
151announced when you start _GDBN__ with no arguments.
152
153@kindex show copying
154@item show copying
155Display information about permission for copying _GDBN__.
156
157@kindex show warranty
158@item show warranty
159Display the GNU ``NO WARRANTY'' statement.
160@end table
This page took 0.029537 seconds and 4 git commands to generate.