Next: Editing, Up: Controlling GDB
gdb indicates its readiness to read a command by printing a string
called the prompt. This string is normally `(gdb)'. You
can change the prompt string with the set prompt
command. For
instance, 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
does not add a space for you after the
prompt you set. This allows you to set a prompt which ends in a space
or a prompt that does not.
set prompt
newpromptshow prompt
Versions of gdb that ship with Python scripting enabled have prompt extensions. The commands for interacting with these extensions are:
set extended-prompt
promptFor example:
set extended-prompt Current working directory: \w (gdb)
Note that when an extended-prompt is set, it takes control of the prompt_hook hook. See prompt_hook, for further information.
show extended-prompt
set extended-prompt
, are replaced with the
corresponding strings each time the prompt is displayed.