Chapter 20. Controlling the Debugger

Table of Contents
20.1. Prompt
20.2. Command Editing
20.3. Command History
20.4. Screen Size
20.5. Numbers
20.6. Optional Warnings and Messages

You can alter the way the debugger interacts with you by using the set command. For commands controlling how the debugger displays data, see Section 14.7.; other settings are described here.

20.1. Prompt

The debugger 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 the debugger with the debugger, it is useful to change the prompt in one of the debugger sessions so that you can always tell which one you are talking to.

Note: set prompt no longer adds 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 newprompt

Directs the debugger to use newprompt as its prompt string henceforth.

show prompt

Prints a line of the form: “Gdb's prompt is: your-prompt