1.1.1 Debugger Command Options (-trace, -output, -command, -nx, ...)

Many options have both a short and a long version. For example, "-x" is the short version while "--command" is the long version.

--annotate=level
]

This option sets the "annotation level" inside the debugger. Its effect is identical to using "set annotate level". The annotation levelL controls how much information the debugger prints together with its prompt, values of expressions, source lines, and other types of output. Level 0 is the normal, level 1 is for use when GDB is run as a subprocess of GNU Emacs.

--basename

Report file locations as only the base filename, and omit the directory name. This is useful in running regression tests.

--batch

Normally the debugger is entered before the debugged script is executed. The user sets breakpoints or starts interactively stepping through the program. However, if you want to start the script running without any interactive behavior from the debugger, use this option for example, if you know that a script will terminate with an exception which causes the debugger to be entered at that point. The --trace option implicitly sets this option.

--cd directory

Run pydb using directory as its working directory, instead of the current directory.

--command=filename|-x filename

Run debugger script filename. This script is run after the user's .pydbrc file.

--exec=command-list|-e command-list

Run debugger commands command-list. Commands should be separated by ``;;''--the same as you would do inside the debugger. You may need to quote this option to prevent command shell interpretation, e.g. --exec "break 20;; continue".

--n| -nx

Before execution is started, a debugger configuration file .pydbrc is run. In some situations, for example regression testing the debugger, you want to make sure that such configuration files are not run and this option will do that.

--output=filename

Write the normal output ("stdout") to the file filename. Useful when running a Python script without access to a terminal.

--error=filename

Write the error output ("stderr") to file filename. Useful in running a Python script without access to a terminal.

--threading
Allow thread debugging. See 1.2.14.

--trace |-X

POSIX-style line tracing is available. In POSIX shells the short option for this is -x; however since we follow gdb conventions -x is used as a short option for --command. When line tracing is turned on, each location (file name and line number) is printed before the command is executed. This option can be used in conjunction with the --output and --error options described above when a terminal is not available or when not running interactively. The corresponding debugger command is "set linetrace on". See 1.2.3 for an example of output from such a trace.

--fntrace |-F

If line tracing produces too much output, there is also function call/return tracing. When function tracing is turned on, each call and return are printed with the nesting level. On a return we show a return type and/or return value if it is a scalar or string. See 1.2.3 for an example of such a trace.

See About this document... for information on suggesting changes.