Next: , Previous: Shortcuts, Up: Interactive Perl


3.2 Debugger

Sepia uses Perl's debugger hooks and GUD mode to support conditional breakpoints and single-stepping, and overrides Perl's die() to invoke the debugger rather than unwinding the stack. This makes it possible to produce a backtrace, inspect and modify global variables, and even continue execution when a program tries to kill itself. If the PadWalker module is available, Sepia also provides functions to inspect and modify lexical variables.

The debugger has its own set of shortcuts, also prefixed by a comma.

backtrace
Show a backtrace.
break file:line [expr]
Set a breakpoint in file at line. If expr is supplied, stop only if it evaluates to true.
down n
up n
Move the current stack frame up or down by n (or one) frames.
eval n expr
Evaluate expr in the lexical environment of frame n (requires PadWalker). expr should not transfer control out of this environment, but is free to modify its lexicals.
inspect n
Inspect lexicals in frame n, counting upward from 1.
lsbreak
List breakpoints.
next [n]
Advance n (or one) lines, skipping subroutine calls.
quit
die
warn
Continue as the program would have executed without debugger intervention, dying if the debugger was called from die().
return expr
Continue execution as if die() had returned the value of expr, which is evaluated in the global environment.
step [n]
Step forward n (or one) lines, descending into subroutines.