Debugger : Debugger Commands : Entering Debugger Commands

Entering Debugger Commands

You can enter Debugger commands any time the Debugger prompt is displayed:

There are two ways of entering commands. One way is by interactively typing them at the terminal’s keyboard. Each command can be up to 256 characters long. No special symbol is required in order to continue the command on a new line. You can use abbreviations of command keywords. Complete the command by pressing carriage return.

Another way of entering commands is via pre-existing command files. If there is a sequence of Debugger commands that you frequently use, you can collect them in a file and invoke the file from the Debugger using the LOAD command:

Pdb > LOAD file_name

The Debugger reads the commands in the given file and executes them. After reading the last command of the file, the Debugger displays its prompt - at which point you can type in more commands.

You may LOAD as many command files in one session as you desire. Command files can themselves load other command files, up to a nested level of ten calls.

The argument file_name can be a full pathname explicitly specifying the directory in which the file resides. If no pathname is provided, the Debugger searches for the file in the current directory (the one from which the debugging prototype was started).