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.
68 @node History, Screen Size, Editing, Controlling _GDBN__
69 @section Command History
71 @cindex history substitution
73 @kindex set history filename
74 @item set history filename @var{fname}
75 Set the name of the _GDBN__ command history file to @var{fname}. This is
76 the file from which _GDBN__ will read an initial command history
77 list or to which it will write this list when it exits. This list is
78 accessed through history expansion or through the history
79 command editing characters listed below. This file defaults to the
80 value of the environment variable @code{GDBHISTFILE}, or to
81 @file{./.gdb_history} if this variable is not set.
84 @kindex set history save
85 @item set history save
86 @itemx set history save on
87 Record command history in a file, whose name may be specified with the
88 @code{set history filename} command. By default, this option is disabled.
90 @item set history save off
91 Stop recording command history in a file.
94 @kindex set history size
95 @item set history size @var{size}
96 Set the number of commands which _GDBN__ will keep in its history list.
97 This defaults to the value of the environment variable
98 @code{HISTSIZE}, or to 256 if this variable is not set.
101 @cindex history expansion
102 History expansion assigns special meaning to the character @kbd{!}.
104 (@xref{Event Designators}.)
106 Since @kbd{!} is also the logical not operator in C, history expansion
107 is off by default. If you decide to enable history expansion with the
108 @code{set history expansion on} command, you may sometimes need to
109 follow @kbd{!} (when it is used as logical not, in an expression) with
110 a space or a tab to prevent it from being expanded. The readline
111 history facilities will not attempt substitution on the strings
112 @kbd{!=} and @kbd{!(}, even when history expansion is enabled.
114 The commands to control history expansion are:
118 @kindex set history expansion
119 @item set history expansion on
120 @itemx set history expansion
121 Enable history expansion. History expansion is off by default.
123 @item set history expansion off
124 Disable history expansion.
126 The readline code comes with more complete documentation of
127 editing and history expansion features. Users unfamiliar with @code{emacs}
128 or @code{vi} may wish to read it.
130 @xref{Command Line Editing}.
136 @itemx show history filename
137 @itemx show history save
138 @itemx show history size
139 @itemx show history expansion
140 These commands display the state of the _GDBN__ history parameters.
141 @code{show history} by itself displays all four states.
147 @kindex show commands
149 Display the last ten commands in the command history.
151 @item show commands @var{n}
152 Print ten commands centered on command number @var{n}.
154 @item show commands +
155 Print ten commands just after the commands last printed.
159 @node Screen Size, Numbers, History, Controlling _GDBN__
161 @cindex size of screen
162 @cindex pauses in output
163 Certain commands to _GDBN__ may produce large amounts of information
164 output to the screen. To help you read all of it, _GDBN__ pauses and
165 asks you for input at the end of each page of output. Type @key{RET}
166 when you want to continue the output. _GDBN__ also uses the screen
167 width setting to determine when to wrap lines of output. Depending on
168 what is being printed, it tries to break the line at a readable place,
169 rather than simply letting it overflow onto the following line.
171 Normally _GDBN__ knows the size of the screen from the termcap data base
172 together 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,
174 you can override it with the @code{set height} and @code{set
178 @item set height @var{lpp}
180 @itemx set width @var{cpl}
186 These @code{set} commands specify a screen height of @var{lpp} lines and
187 a screen width of @var{cpl} characters. The associated @code{show}
188 commands display the current settings.
190 If you specify a height of zero lines, _GDBN__ will not pause during output
191 no matter how long the output is. This is useful if output is to a file
192 or to an editor buffer.
195 @node Numbers, Messages/Warnings, Screen Size, Controlling _GDBN__
197 @cindex number representation
198 @cindex entering numbers
199 You can always enter numbers in octal, decimal, or hexadecimal in _GDBN__ by
200 the usual conventions: octal numbers begin with @samp{0}, decimal
201 numbers end with @samp{.}, and hexadecimal numbers begin with @samp{0x}.
202 Numbers that begin with none of these are, by default, entered in base
203 10; likewise, the default display for numbers---when no particular
204 format is specified---is base 10. You can change the default base for
205 both input and output with the @code{set radix} command.
209 @item set radix @var{base}
210 Set the default base for numeric input and display. Supported choices
211 for @var{base} are decimal 8, 10, 16. @var{base} must itself be
212 specified either unambiguously or using the current default radix; for
222 will set the base to decimal. On the other hand, @samp{set radix 10}
223 will leave the radix unchanged no matter what it was.
227 Display the current default base for numeric input and display.
231 @node Messages/Warnings, , Numbers, Controlling _GDBN__
232 @section Optional Warnings and Messages
233 By default, _GDBN__ is silent about its inner workings. If you are running
234 on a slow machine, you may want to use the @code{set verbose} command.
235 It will make _GDBN__ tell you when it does a lengthy internal operation, so
236 you won't think it has crashed.
238 Currently, the messages controlled by @code{set verbose} are those which
239 announce that the symbol table for a source file is being read
240 (@pxref{Files}, in the description of the command
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
246 see @code{symbol-file} in @ref{Files}).
252 Enables _GDBN__'s output of certain informational messages.
254 @item set verbose off
255 Disables _GDBN__'s output of certain informational messages.
259 Displays whether @code{set verbose} is on or off.
262 By default, if _GDBN__ encounters bugs in the symbol table of an object file,
263 it prints a single message about each type of problem it finds, then
264 shuts up (@pxref{Symbol Errors}). You can suppress these messages, or allow more than one such
265 message to be printed if you want to see how frequent the problems are.
268 @kindex set complaints
269 @item set complaints @var{limit}
270 Permits _GDBN__ to output @var{limit} complaints about each type of unusual
271 symbols before becoming silent about the problem. Set @var{limit} to
272 zero to suppress all complaints; set it to a large number to prevent
273 complaints from being suppressed.
275 @kindex show complaints
276 @item show complaints
277 Displays how many symbol complaints _GDBN__ is permitted to produce.
280 By default, _GDBN__ is cautious, and asks what sometimes seem to be a
281 lot of stupid questions to confirm certain commands. For example, if
282 you try to run a program which is already running:
285 The program being debugged has been started already.
286 Start it from the beginning? (y or n)
289 If you're willing to unflinchingly face the consequences of your own
290 commands, you can disable this ``feature'':
296 @cindex stupid questions
297 @item set confirm off
298 Disables confirmation requests.
301 Enables confirmation requests (the default).
305 Displays state of confirmation requests.