Subject: | Console.pm: Wrong command parsing causes help to be shown |
Devel::ebug, 0.48
program: /usr/local/bin/ebug
This is a minor issue really, but since the fix appears to be trivial, I
thought I attach a patch. Basically, the problem is that any command to
the ebug console, that contains the letter 'h' is interpreted as 'help'.
In the example below, "b CGI::charset" is intended to set a breakpoint
at the subroutine 'charset' in the CGI package, but fails (and instead
the help is displayed) because 'h' is part of 'charset'.
ebug: b CGI::charset
Commands:
b Set break point at a line number (eg: b 6, b code.pl 6, b
code.pl 6 $x > 7,
b Calc::fib)
d Delete a break point (d 6, d code.pl 6)
e Eval Perl code and print the result (eg: e $x+$y)
f Show all the filenames loaded
l List codelines or set number of codelines to list (eg: l, l 20)
L List codelines always (toggle)
n Next (steps over subroutine calls)
o Output (show STDOUT, STDERR)
p Show pad
r Run until next break point or watch point
ret Return from subroutine (eg: ret, ret 3.141)
restart Restart the program
s Step (steps into subroutine calls)
T Show a stack trace
u Undo (eg: u, u 4)
w Set a watchpoint (eg: w $t > 10)
x Dump a variable using YAML (eg: x $object)
q Quit
main(-e#1):
Interactive ebugging shell
ebug: b CGI::init
main(-e#1):
Interactive ebugging shell
ebug:
Subject: | devel-ebug-console-fix-h.patch |
--- Console.pm 2007-05-01 03:49:14.000000000 +0900
+++ /usr/local/share/perl/5.8.8/Devel/ebug/Console.pm 2007-10-22 12:00:26.000000000 +0900
@@ -59,7 +59,7 @@
$command = "q" if not defined $command;
$command = $last_command if ($command eq "");
- if ($command =~ /[?h]/) {
+ if ($command =~ /^\s*[?h]/) {
print 'Commands:
b Set break point at a line number (eg: b 6, b code.pl 6, b code.pl 6 $x > 7,