NAME
ebug - A simple, extensible console Perl debugger
VERSION
version 0.67
SYNOPSIS
% ebug calc.pl
% ebug add.pl 3 "four and a half"
% 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.
Any arguments after the program name are passed to the program, each exactly as given, so an argument may contain spaces or other shell metacharacters. If the program and its arguments are given together as a single string instead, that string is interpreted by the shell.
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
LINEin the current file, optionally only breaking whenCONDITIONis true (eg:b 6,b 6 $x > 7). - b FILE LINE
- b FILE LINE CONDITION
-
Set a break point at
LINEinFILE(eg:b code.pl 6). - b SUBROUTINE
- b SUBROUTINE CONDITION
-
Set a break point at the start of
SUBROUTINE, given as a fully qualified name, optionally only breaking whenCONDITIONis true. The condition is checked as the subroutine is entered, so@_holds its arguments (eg:b Calc::fib,b Calc::fib $_[1] > 5). - bf FILE
-
Set a break point that triggers as soon as
FILEis loaded (eg:bf Calc.pm). - d LINE
- d FILE LINE
-
Delete the break point at
LINEin the current file, or inFILE. - e EXPR
-
Evaluate
EXPRas 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
Nas 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
VALUEfor 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
Ncommands. This restarts the debuggee and replays the previous session's state-changing commands. - w CONDITION
-
Set a watch point: execution stops as soon as
CONDITIONbecomes true (eg:w $t > 10). - x EXPR
-
Evaluate
EXPRand dump the result using YAML (eg:x $object). Pressing Tab afterxcompletes on the names of variables currently in the pad. - q
-
Quit ebug.
SEE ALSO
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.