NAME

ebug - A simple, extensible console Perl debugger

VERSION

version 0.65

SYNOPSIS

% ebug calc.pl
% ebug "add.pl 3 4"

DESCRIPTION

ebug is an interactive command-line front end to Devel::ebug. It is a simple Perl debugger, much like perl5db.pl.

COMMANDS

At the ebug: prompt, type one of the following commands and press return. Pressing return with an empty line repeats the last command (handy for repeatedly pressing s or n to step through code). Anything that isn't recognized as a command below is evaluated as Perl code in the debuggee, the same as the e command.

? or h

Show this list of commands.

b LINE
b LINE CONDITION

Set a break point at LINE in the current file, optionally only breaking when CONDITION is true (eg: b 6, b 6 $x > 7).

b FILE LINE
b FILE LINE CONDITION

Set a break point at LINE in FILE (eg: b code.pl 6).

b SUBROUTINE

Set a break point at the start of SUBROUTINE, given as a fully qualified name (eg: b Calc::fib).

bf FILE

Set a break point that triggers as soon as FILE is loaded (eg: bf Calc.pm).

d LINE
d FILE LINE

Delete the break point at LINE in the current file, or in FILE.

e EXPR

Evaluate EXPR as Perl code in the debuggee and print the result (eg: e $x+$y).

f

Show all the filenames currently loaded.

l

List code lines around the current line.

l N

List code lines around the current line, and remember N as the number of lines to show from now on.

L

Toggle always listing code lines before each prompt.

n

Next: step onto the next line, stepping over any subroutine calls.

o

Show the debuggee's captured STDOUT and STDERR.

p

Show the pad: all lexical (my) variables in scope.

r

Run until the next break point or watch point. Pressing Ctrl-C (SIGINT) while running stops the debuggee and drops back into the ebug: prompt instead of killing the console.

ret
ret VALUE

Return from the current subroutine, optionally forcing the return value to VALUE for testing purposes (eg: ret 3.141).

restart

Restart the program from the beginning.

s

Step: step onto the next line, stepping into any subroutine calls.

T

Show a stack trace.

u
u N

Undo the last command, or the last N commands. This restarts the debuggee and replays the previous session's state-changing commands.

w CONDITION

Set a watch point: execution stops as soon as CONDITION becomes true (eg: w $t > 10).

x EXPR

Evaluate EXPR and dump the result using YAML (eg: x $object). Pressing Tab after x completes on the names of variables currently in the pad.

q

Quit ebug.

SEE ALSO

Devel::ebug

AUTHOR

Original author: Leon Brocard <acme@astray.com>

Current maintainer: Graham Ollis <plicease@cpan.org>

Contributors:

Brock Wilcox <awwaiid@thelackthereof.org>

Taisuke Yamada

COPYRIGHT AND LICENSE

This software is copyright (c) 2005-2026 by Leon Brocard.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.