You can alter the way gdb interacts with you by using the
how gdb displays data, (refer to Section 10.7 Print settings. Other settings are described here.
21.1. Prompt
gdb indicates its readiness to read a command by printing a string called the prompt. This string is
normally
. You can change the prompt string with the
(gdb)
when debugging gdb with gdb, it is useful to change the prompt in one of the gdb sessions so that you
can always tell which one you are talking to.
Note:
set prompt
prompt which ends in a space or a prompt that does not.
set prompt
newprompt
Directs gdb to use
show prompt
Prints a line of the form:
21.2. Command editing
gdb reads its input commands via the readline interface. This gnu library provides consistent behavior
for programs which provide a command line interface to the user. Advantages are gnu Emacs-style
or vi-style inline editing of commands,
mand history across debugging sessions.
You may control the behavior of command line editing in gdb with the command
set editing
set editing on
Enable command line editing (enabled by default).
set editing off
Disable command line editing.
show editing
Show whether command line editing is enabled.
21.3. Command history
gdb can keep track of the commands you type during your debugging sessions, so that you can be
certain of precisely what happened. Use these commands to manage the gdb command history facility.
does not add a space for you after the prompt you set. This allows you to set a
as its prompt string henceforth.
newprompt
Gdb's prompt is:
csh
command. For commands controlling
set
set prompt
your-prompt
-like history substitution, and a storage and recall of com-
Chapter 21.
Controlling gdb
command. For instance,
.
set