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 Controlling _GDBN__, Sequences, Targets, Top
5 @chapter Controlling _GDBN__
7 You can alter many aspects of _GDBN__'s interaction with you by using
8 the @code{set} command. For commands controlling how _GDBN__ displays
9 data, @pxref{Print Settings}; other settings are described here.
13 * Editing:: Command Editing
14 * History:: Command History
15 * Screen Size:: Screen Size
17 * Messages/Warnings:: Optional Warnings and Messages
20 @node Prompt, Editing, Controlling _GDBN__, Controlling _GDBN__
23 _GDBN__ indicates its readiness to read a command by printing a string
24 called the @dfn{prompt}. This string is normally @samp{(_GDBP__)}. You
25 can change the prompt string with the @code{set prompt} command. For
26 instance, when debugging _GDBN__ with _GDBN__, it is useful to change
27 the prompt in one of the _GDBN__<>s so that you can always tell which
28 one you are talking to.
31 @item set prompt @var{newprompt}
33 Directs _GDBN__ to use @var{newprompt} as its prompt string henceforth.
36 Prints a line of the form: @samp{Gdb's prompt is: @var{your-prompt}}
39 @node Editing, History, Prompt, Controlling _GDBN__
40 @section Command Editing
42 @cindex command line editing
43 _GDBN__ reads its input commands via the @dfn{readline} interface. This
44 GNU library provides consistent behavior for programs which provide a
45 command line interface to the user. Advantages are @code{emacs}-style
46 or @code{vi}-style inline editing of commands, @code{csh}-like history
47 substitution, and a storage and recall of command history across
50 You may control the behavior of command line editing in _GDBN__ with the
58 Enable command line editing (enabled by default).
61 Disable command line editing.
65 Show whether command line editing is enabled.
67 @node History, Screen Size, Editing, Controlling _GDBN__
68 @section Command History
69 @cindex history substitution
71 @kindex set history filename
72 @item set history filename @var{fname}
73 Set the name of the _GDBN__ command history file to @var{fname}. This is
74 the file from which _GDBN__ will read an initial command history
75 list or to which it will write this list when it exits. This list is
76 accessed through history expansion or through the history
77 command editing characters listed below. This file defaults to the
78 value of the environment variable @code{GDBHISTFILE}, or to
79 @file{./.gdb_history} if this variable is not set.
82 @kindex set history save
83 @item set history save
84 @itemx set history save on
85 Record command history in a file, whose name may be specified with the
86 @code{set history filename} command. By default, this option is disabled.
88 @item set history save off
89 Stop recording command history in a file.
92 @kindex set history size
93 @item set history size @var{size}
94 Set the number of commands which _GDBN__ will keep in its history list.
95 This defaults to the value of the environment variable
96 @code{HISTSIZE}, or to 256 if this variable is not set.
99 @cindex history expansion
100 History expansion assigns special meaning to the character @kbd{!}.
102 (@xref{Event Designators}.)
104 Since @kbd{!} is also the logical not operator in C, history expansion
105 is off by default. If you decide to enable history expansion with the
106 @code{set history expansion on} command, you may sometimes need to
107 follow @kbd{!} (when it is used as logical not, in an expression) with
108 a space or a tab to prevent it from being expanded. The readline
109 history facilities will not attempt substitution on the strings
110 @kbd{!=} and @kbd{!(}, even when history expansion is enabled.
112 The commands to control history expansion are:
116 @kindex set history expansion
117 @item set history expansion on
118 @itemx set history expansion
119 Enable history expansion. History expansion is off by default.
121 @item set history expansion off
122 Disable history expansion.
124 The readline code comes with more complete documentation of
125 editing and history expansion features. Users unfamiliar with @code{emacs}
126 or @code{vi} may wish to read it.
128 @xref{Command Line Editing}.
134 @itemx show history filename
135 @itemx show history save
136 @itemx show history size
137 @itemx show history expansion
138 These commands display the state of the _GDBN__ history parameters.
139 @code{show history} by itself displays all four states.
145 @kindex show commands
147 Display the last ten commands in the command history.
149 @item show commands @var{n}
150 Print ten commands centered on command number @var{n}.
152 @item show commands +
153 Print ten commands just after the commands last printed.
157 @node Screen Size, Numbers, History, Controlling _GDBN__
159 @cindex size of screen
160 @cindex pauses in output
161 Certain commands to _GDBN__ may produce large amounts of information
162 output to the screen. To help you read all of it, _GDBN__ pauses and
163 asks you for input at the end of each page of output. Type @key{RET}
164 when you want to continue the output. _GDBN__ also uses the screen
165 width setting to determine when to wrap lines of output. Depending on
166 what is being printed, it tries to break the line at a readable place,
167 rather than simply letting it overflow onto the following line.
169 Normally _GDBN__ knows the size of the screen from the termcap data base
170 together with the value of the @code{TERM} environment variable and the
171 @code{stty rows} and @code{stty cols} settings. If this is not correct,
172 you can override it with the @code{set height} and @code{set
176 @item set height @var{lpp}
178 @itemx set width @var{cpl}
184 These @code{set} commands specify a screen height of @var{lpp} lines and
185 a screen width of @var{cpl} characters. The associated @code{show}
186 commands display the current settings.
188 If you specify a height of zero lines, _GDBN__ will not pause during output
189 no matter how long the output is. This is useful if output is to a file
190 or to an editor buffer.
193 @node Numbers, Messages/Warnings, Screen Size, Controlling _GDBN__
195 @cindex number representation
196 @cindex entering numbers
197 You can always enter numbers in octal, decimal, or hexadecimal in _GDBN__ by
198 the usual conventions: octal numbers begin with @samp{0}, decimal
199 numbers end with @samp{.}, and hexadecimal numbers begin with @samp{0x}.
200 Numbers that begin with none of these are, by default, entered in base
201 10; likewise, the default display for numbers---when no particular
202 format is specified---is base 10. You can change the default base for
203 both input and output with the @code{set radix} command.
207 @item set radix @var{base}
208 Set the default base for numeric input and display. Supported choices
209 for @var{base} are decimal 8, 10, 16. @var{base} must itself be
210 specified either unambiguously or using the current default radix; for
220 will set the base to decimal. On the other hand, @samp{set radix 10}
221 will leave the radix unchanged no matter what it was.
225 Display the current default base for numeric input and display.
229 @node Messages/Warnings, , Numbers, Controlling _GDBN__
230 @section Optional Warnings and Messages
231 By default, _GDBN__ is silent about its inner workings. If you are running
232 on a slow machine, you may want to use the @code{set verbose} command.
233 It will make _GDBN__ tell you when it does a lengthy internal operation, so
234 you won't think it has crashed.
236 Currently, the messages controlled by @code{set verbose} are those which
237 announce that the symbol table for a source file is being read
238 (@pxref{Files}, in the description of the command
240 @c The following is the right way to do it, but emacs 18.55 doesn't support
241 @c @ref, and neither the emacs lisp manual version of texinfmt or makeinfo
244 see @code{symbol-file} in @ref{Files}).
250 Enables _GDBN__'s output of certain informational messages.
252 @item set verbose off
253 Disables _GDBN__'s output of certain informational messages.
257 Displays whether @code{set verbose} is on or off.
260 By default, if _GDBN__ encounters bugs in the symbol table of an object file,
261 it prints a single message about each type of problem it finds, then
262 shuts up (@pxref{Symbol Errors}). You can suppress these messages, or allow more than one such
263 message to be printed if you want to see how frequent the problems are.
266 @kindex set complaints
267 @item set complaints @var{limit}
268 Permits _GDBN__ to output @var{limit} complaints about each type of unusual
269 symbols before becoming silent about the problem. Set @var{limit} to
270 zero to suppress all complaints; set it to a large number to prevent
271 complaints from being suppressed.
273 @kindex show complaints
274 @item show complaints
275 Displays how many symbol complaints _GDBN__ is permitted to produce.
278 By default, _GDBN__ is cautious, and asks what sometimes seem to be a
279 lot of stupid questions to confirm certain commands. For example, if
280 you try to run a program which is already running:
283 The program being debugged has been started already.
284 Start it from the beginning? (y or n)
287 If you're willing to unflinchingly face the consequences of your own
288 commands, you can disable this ``feature'':
294 @cindex stupid questions
295 @item set confirm off
296 Disables confirmation requests.
299 Enables confirmation requests (the default).
303 Displays state of confirmation requests.