Console Window Help

## The Console Window

The Console Window provides the traditional command-line interface to GDB. It is very similar to the command-line you get when GDB is run with "-nw".

- Console Display
- Editing Commands
- History Commands
- Getting Help

#### Console Display

The Console Display is simply a scrolled window in which the debugger prompt appears. By default, the prompt is set to "(gdb) ", but it may be changed via a command line option.

To execute commands in the console window, simply enter the command in the display. If the debugger is busy, the message "Error: The debugger is busy." appears informing the user that the command was not accepted.

Whenever a command is executed, the debugger's windows will update to display any new state information. Any output from the command is also echoed to the Console Window for ease of use. If an error occurs, an error message is printed to the Console Window. All error messages appear in the Console Window using a red typeface.

#### Editing Commands

The Console Window shell has many powerful features to help edit commands.

- Return or Enter causes the command to be executed.
- Control-A moves the cursor to the beginning of the line.
- Control-E moves the cursor to the end of the line.
- Control-D or DELETE delete the character to the right of the cursor.
- BACKSPACE deletes the character to the left of the cursor.
- Control-B or LeftArrow moves the cursor to the left.
- Control-F or RightArrow moves the cursor to the right.
- Control-K deletes everything to the right of the cursor.
- Control-U deletes the text between the cursor and the start of the line.
- Control-W deletes the previous word
- END deletes the whole line.
- The mouse may also be used to position the cursor and cut and paste.

#### History Commands

- Conrol-P or UpArrow recalls the previous command.
- Conrol-N or DownArrow recalls the next command.
- Shift-UpArrow or Control-UpArrow will search through previous commands for commands that start with the same characters as the current line. For example, if you type "pr" and hit Shift-UpArrow, it may find commands in the history such as "print foo" or "print sol[x]". Each time you search it will go back further in the history. If nothing is on the current line, it acts just like Control-P or UpArrow.
- Shift-DownArrow or Control-DownArrow work in the opposite direction of Shift-UpArrow and Control-DownArrow.

#### Getting Help

The Console Window has its own online help system. To access the help system, enter "help" at the prompt and follow the on-screen instructions. For more help, please consult the GDB User's Guide.