Skip to content

Commit

Permalink
Add more commands to the lookup table.
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomif authored and rjbs committed Nov 12, 2012
1 parent 47e3b8c commit d478d7a
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions lib/perl5db.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2423,7 +2423,15 @@ sub _DB__at_end_of_every_command {
# 's' is subroutine.
my %cmd_lookup =
(
'q' => { t => 'm', v => '_handle_q_command' },
'.' => { t => 's', v => \&_DB__handle_dot_command, },
'f' => { t => 's', v => \&_DB__handle_f_command, },
'm' => { t => 's', v => \&_DB__handle_m_command, },
'q' => { t => 'm', v => '_handle_q_command', },
'S' => { t => 'm', v => '_handle_S_command', },
't' => { t => 'm', v => '_handle_t_command', },
'x' => { t => 'm', v => '_handle_x_command', },
(map { $_ => { t => 'm', v => '_handle_V_command_and_X_command', }, }
('X', 'V')),
);

sub DB {
Expand Down Expand Up @@ -2763,16 +2771,12 @@ =head4 C<t> - trace [n]
=cut

$obj->_handle_t_command;

=head4 C<S> - list subroutines matching/not matching a pattern
Walks through C<%sub>, checking to see whether or not to print the name.
=cut

$obj->_handle_S_command;

=head4 C<X> - list variables in current package
Since the C<V> command actually processes this, just change this to the
Expand All @@ -2784,40 +2788,30 @@ =head4 C<V> - list variables
=cut

$obj->_handle_V_command_and_X_command;

=head4 C<x> - evaluate and print an expression
Hands the expression off to C<DB::eval>, setting it up to print the value
via C<dumpvar.pl> instead of just printing it directly.
=cut

$obj->_handle_x_command;

=head4 C<m> - print methods
Just uses C<DB::methods> to determine what methods are available.
=cut

_DB__handle_m_command($obj);

=head4 C<f> - switch files
=cut

_DB__handle_f_command($obj);

=head4 C<.> - return to last-executed line.
We set C<$incr> to -1 to indicate that the debugger shouldn't move ahead,
and then we look up the line in the magical C<%dbline> hash.
=cut

_DB__handle_dot_command($obj);

=head4 C<-> - back one window
We change C<$start> to be one window back; if we go back past the first line,
Expand Down

0 comments on commit d478d7a

Please sign in to comment.