1.2.5 Examining Data (print, pprint, examine, info globals)

display [format] expression

Print value of expression expression each time the program stops. format may be used before expression as in the "print" command. format "i" or "s" or including a size-letter is allowed, and then expression is used to get the address to examine.

With no argument, display all currently requested auto-display expressions. Use "undisplay" to cancel display requests previously made.

undisplay [format] expression

Evaluate the expression in the current context and print its value. Note: "print" can also be used, but is not a debugger command--it executes the Python print statement.

p expression

Evaluate the expression in the current context and print its value. Note: "print" can also be used, but is not a debugger command--it executes the Python print statement.

pp expression

Like the "p" command, except the value of the expression is pretty-printed using the pprint module.

examine expression

Print the type of the expression and pretty-print its value. For functions, methods, classes, and modules print out the documentation string if any. For functions also show the argument list.

The examine debugger command in Perl is the model here, however much more work is needed. Note that "x" is not a short name for ``expression'' (as it is in Perl's debugger), although you could easily make it be via an alias.

info globals

Show all global variables. These variables are not just the variables that a programs sees via a global statement, but all of them that can be accessible.

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