nindy bug fixes (function types) and opcode library inclusion
[deliverable/binutils-gdb.git] / gdb / doc / gdb.ctl-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.
9d40ea3c 3@c M4 FRAGMENT: $Id$
9bcc06ef
RP
4@node Controlling _GDBN__, Sequences, Targets, Top
5@chapter Controlling _GDBN__
6
7You can alter many aspects of _GDBN__'s interaction with you by using
8the @code{set} command. For commands controlling how _GDBN__ displays
9data, @pxref{Print Settings}; other settings are described here.
10
11@menu
12* Prompt:: Prompt
13* Editing:: Command Editing
14* History:: Command History
15* Screen Size:: Screen Size
16* Numbers:: Numbers
17* Messages/Warnings:: Optional Warnings and Messages
18@end menu
19
20@node Prompt, Editing, Controlling _GDBN__, Controlling _GDBN__
21@section Prompt
22@cindex prompt
23_GDBN__ indicates its readiness to read a command by printing a string
24called the @dfn{prompt}. This string is normally @samp{(_GDBP__)}. You
25can change the prompt string with the @code{set prompt} command. For
26instance, when debugging _GDBN__ with _GDBN__, it is useful to change
27the prompt in one of the _GDBN__<>s so that you can always tell which
28one you are talking to.
29
30@table @code
31@item set prompt @var{newprompt}
32@kindex set prompt
33Directs _GDBN__ to use @var{newprompt} as its prompt string henceforth.
34@kindex show prompt
35@item show prompt
36Prints a line of the form: @samp{Gdb's prompt is: @var{your-prompt}}
37@end table
38
39@node Editing, History, Prompt, Controlling _GDBN__
40@section Command Editing
41@cindex readline
42@cindex command line editing
43_GDBN__ reads its input commands via the @dfn{readline} interface. This
44GNU library provides consistent behavior for programs which provide a
45command line interface to the user. Advantages are @code{emacs}-style
46or @code{vi}-style inline editing of commands, @code{csh}-like history
47substitution, and a storage and recall of command history across
48debugging sessions.
49
50You may control the behavior of command line editing in _GDBN__ with the
51command @code{set}.
52
53@table @code
54@kindex set editing
55@cindex editing
56@item set editing
57@itemx set editing on
58Enable command line editing (enabled by default).
59
60@item set editing off
61Disable command line editing.
62
63@kindex show editing
64@item show editing
65Show whether command line editing is enabled.
9d40ea3c 66@end table
9bcc06ef
RP
67
68@node History, Screen Size, Editing, Controlling _GDBN__
69@section Command History
9d40ea3c 70@table @code
9bcc06ef
RP
71@cindex history substitution
72@cindex history file
73@kindex set history filename
74@item set history filename @var{fname}
75Set the name of the _GDBN__ command history file to @var{fname}. This is
76the file from which _GDBN__ will read an initial command history
77list or to which it will write this list when it exits. This list is
78accessed through history expansion or through the history
79command editing characters listed below. This file defaults to the
80value of the environment variable @code{GDBHISTFILE}, or to
81@file{./.gdb_history} if this variable is not set.
82
83@cindex history save
84@kindex set history save
85@item set history save
86@itemx set history save on
87Record command history in a file, whose name may be specified with the
88@code{set history filename} command. By default, this option is disabled.
89
90@item set history save off
91Stop recording command history in a file.
92
93@cindex history size
94@kindex set history size
95@item set history size @var{size}
96Set the number of commands which _GDBN__ will keep in its history list.
97This defaults to the value of the environment variable
98@code{HISTSIZE}, or to 256 if this variable is not set.
99@end table
100
101@cindex history expansion
102History expansion assigns special meaning to the character @kbd{!}.
103@iftex
104(@xref{Event Designators}.)
105@end iftex
106Since @kbd{!} is also the logical not operator in C, history expansion
107is off by default. If you decide to enable history expansion with the
108@code{set history expansion on} command, you may sometimes need to
109follow @kbd{!} (when it is used as logical not, in an expression) with
110a space or a tab to prevent it from being expanded. The readline
111history facilities will not attempt substitution on the strings
112@kbd{!=} and @kbd{!(}, even when history expansion is enabled.
113
114The commands to control history expansion are:
115
116@table @code
117
118@kindex set history expansion
119@item set history expansion on
120@itemx set history expansion
121Enable history expansion. History expansion is off by default.
122
123@item set history expansion off
124Disable history expansion.
125
126The readline code comes with more complete documentation of
127editing and history expansion features. Users unfamiliar with @code{emacs}
128or @code{vi} may wish to read it.
129@iftex
130@xref{Command Line Editing}.
131@end iftex
132
9d40ea3c 133@c @group
9bcc06ef
RP
134@kindex show history
135@item show history
136@itemx show history filename
137@itemx show history save
138@itemx show history size
139@itemx show history expansion
140These commands display the state of the _GDBN__ history parameters.
141@code{show history} by itself displays all four states.
9d40ea3c 142@c @end group
9bcc06ef
RP
143
144@end table
145
146@table @code
147@kindex show commands
148@item show commands
149Display the last ten commands in the command history.
150
151@item show commands @var{n}
152Print ten commands centered on command number @var{n}.
153
154@item show commands +
155Print ten commands just after the commands last printed.
156
157@end table
158
159@node Screen Size, Numbers, History, Controlling _GDBN__
160@section Screen Size
161@cindex size of screen
162@cindex pauses in output
163Certain commands to _GDBN__ may produce large amounts of information
164output to the screen. To help you read all of it, _GDBN__ pauses and
165asks you for input at the end of each page of output. Type @key{RET}
166when you want to continue the output. _GDBN__ also uses the screen
167width setting to determine when to wrap lines of output. Depending on
168what is being printed, it tries to break the line at a readable place,
169rather than simply letting it overflow onto the following line.
170
171Normally _GDBN__ knows the size of the screen from the termcap data base
172together with the value of the @code{TERM} environment variable and the
173@code{stty rows} and @code{stty cols} settings. If this is not correct,
174you can override it with the @code{set height} and @code{set
175width} commands:
176
177@table @code
178@item set height @var{lpp}
179@itemx show height
180@itemx set width @var{cpl}
181@itemx show width
182@kindex set height
183@kindex set width
184@kindex show width
185@kindex show height
186These @code{set} commands specify a screen height of @var{lpp} lines and
187a screen width of @var{cpl} characters. The associated @code{show}
188commands display the current settings.
189
190If you specify a height of zero lines, _GDBN__ will not pause during output
191no matter how long the output is. This is useful if output is to a file
192or to an editor buffer.
193@end table
194
195@node Numbers, Messages/Warnings, Screen Size, Controlling _GDBN__
196@section Numbers
197@cindex number representation
198@cindex entering numbers
199You can always enter numbers in octal, decimal, or hexadecimal in _GDBN__ by
200the usual conventions: octal numbers begin with @samp{0}, decimal
201numbers end with @samp{.}, and hexadecimal numbers begin with @samp{0x}.
202Numbers that begin with none of these are, by default, entered in base
20310; likewise, the default display for numbers---when no particular
204format is specified---is base 10. You can change the default base for
205both input and output with the @code{set radix} command.
206
207@table @code
208@kindex set radix
209@item set radix @var{base}
210Set the default base for numeric input and display. Supported choices
211for @var{base} are decimal 8, 10, 16. @var{base} must itself be
212specified either unambiguously or using the current default radix; for
213example, any of
214
215@example
216set radix 012
217set radix 10.
218set radix 0xa
219@end example
220
221@noindent
222will set the base to decimal. On the other hand, @samp{set radix 10}
223will leave the radix unchanged no matter what it was.
224
225@kindex show radix
226@item show radix
227Display the current default base for numeric input and display.
228
229@end table
230
231@node Messages/Warnings, , Numbers, Controlling _GDBN__
232@section Optional Warnings and Messages
233By default, _GDBN__ is silent about its inner workings. If you are running
234on a slow machine, you may want to use the @code{set verbose} command.
235It will make _GDBN__ tell you when it does a lengthy internal operation, so
236you won't think it has crashed.
237
238Currently, the messages controlled by @code{set verbose} are those which
239announce that the symbol table for a source file is being read
240(@pxref{Files}, in the description of the command
241@code{symbol-file}).
242@c The following is the right way to do it, but emacs 18.55 doesn't support
243@c @ref, and neither the emacs lisp manual version of texinfmt or makeinfo
244@c is released.
245@ignore
246see @code{symbol-file} in @ref{Files}).
247@end ignore
248
249@table @code
250@kindex set verbose
251@item set verbose on
252Enables _GDBN__'s output of certain informational messages.
253
254@item set verbose off
255Disables _GDBN__'s output of certain informational messages.
256
257@kindex show verbose
258@item show verbose
259Displays whether @code{set verbose} is on or off.
260@end table
261
262By default, if _GDBN__ encounters bugs in the symbol table of an object file,
263it prints a single message about each type of problem it finds, then
264shuts up (@pxref{Symbol Errors}). You can suppress these messages, or allow more than one such
265message to be printed if you want to see how frequent the problems are.
266
267@table @code
268@kindex set complaints
269@item set complaints @var{limit}
270Permits _GDBN__ to output @var{limit} complaints about each type of unusual
271symbols before becoming silent about the problem. Set @var{limit} to
272zero to suppress all complaints; set it to a large number to prevent
273complaints from being suppressed.
274
275@kindex show complaints
276@item show complaints
277Displays how many symbol complaints _GDBN__ is permitted to produce.
278@end table
279
280By default, _GDBN__ is cautious, and asks what sometimes seem to be a
281lot of stupid questions to confirm certain commands. For example, if
282you try to run a program which is already running:
283@example
284(_GDBP__) run
285The program being debugged has been started already.
286Start it from the beginning? (y or n)
287@end example
288
289If you're willing to unflinchingly face the consequences of your own
290commands, you can disable this ``feature'':
291
292@table @code
293@kindex set confirm
294@cindex flinching
295@cindex confirmation
296@cindex stupid questions
297@item set confirm off
298Disables confirmation requests.
299
300@item set confirm on
301Enables confirmation requests (the default).
302
303@item show confirm
304@kindex show confirm
305Displays state of confirmation requests.
306@end table
This page took 0.076752 seconds and 4 git commands to generate.