Chapter 9. Debugger Commands

Table of Contents
9.1. Command Syntax
9.2. Command Completion
9.3. Getting Help

You can abbreviate a debugger command to the first few letters of the command name, if that abbreviation is unambiguous; and you can repeat certain debugger commands by typing just Enter. You can also use the Tab key to get the debugger to fill out the rest of a word in a command (or to show you the alternatives available, if there is more than one possibility).

9.1. Command Syntax

A debugger command is a single line of input. There is no limit on how long it can be. It starts with a command name, which is followed by arguments whose meaning depends on the command name. For example, the command step accepts an argument which is the number of times to step, as in step 5. You can also use the step command with no arguments. Some command names do not allow any arguments.

Debugger command names may always be truncated if that abbreviation is unambiguous. Other possible command abbreviations are listed in the documentation for individual commands. In some cases, even ambiguous abbreviations are allowed; for example, s is specially defined as equivalent to step even though there are other commands whose names start with s. You can test abbreviations by using them as arguments to the help command.

A blank line as input to the debugger (typing just Enter) means to repeat the previous command. Certain commands (for example, run) will not repeat this way; these are commands whose unintentional repetition might cause trouble and which you are unlikely to want to repeat.

The list and x commands, when you repeat them with Enter, construct new arguments rather than repeating exactly as typed. This permits easy scanning of source or memory.

The debugger can also use Enter in another way: to partition lengthy output, in a way similar to the common utility more (see Section 20.4.). Since it is easy to press one Enter too many in this situation, the debugger disables command repetition after any command that generates this sort of display.

Any text from a # to the end of the line is a comment; it does nothing. This is useful mainly in command files (see Section 21.3.).