sub _DB__handle_c_command {
my ($obj) = @_;
- if (my ($new_i) = $cmd =~ m#\Ac\b\s*([\w:]*)\s*\z#) {
+ if (my ($new_verb) = $cmd =~ m#\Ac\b\s*([\w:]*)\s*\z#) {
- $obj->cmd_verb($new_i);
+ $obj->cmd_verb($new_verb);
# Hey, show's over. The debugged program finished
# executing already.
# to where the subroutine is defined; we call find_sub,
# break up the return value, and assign it in one
# operation.
- ( $file, $new_i ) = ( find_sub($subname) =~ /^(.*):(.*)$/ );
+ ( $file, $new_verb ) = ( find_sub($subname) =~ /^(.*):(.*)$/ );
# Force the line number to be numeric.
- $obj->cmd_verb($new_i + 0);
+ $obj->cmd_verb($new_verb + 0);
# If we got a line number, we found the sub.
if ($obj->cmd_verb) {
# Scan forward to the first executable line
# after the 'sub whatever' line.
$max = $#dbline;
- my $ii = $obj->cmd_verb;
- ++$ii while $dbline[$ii] == 0 && $ii < $max;
- $obj->cmd_verb($ii);
+ my $_line_num = $obj->cmd_verb;
+ while ($dbline[$_line_num] == 0 && $_line_num< $max)
+ {
+ $_line_num++;
+ }
+ $obj->cmd_verb($_line_num);
} ## end if ($i)
# We didn't find a sub by that name.
# Y - index back from most recent (by 1 if bare minus)
# N - go to that particular command slot or the last
# thing if nothing following.
- my $new_i = $minus ? ( $#hist - ( $arg || 1 ) ) : ( $arg || $#hist );
- $self->cmd_verb($new_i);
+ $self->cmd_verb(
+ scalar($minus ? ( $#hist - ( $arg || 1 ) ) : ( $arg || $#hist ))
+ );
# Pick out the command desired.
$DB::cmd = $hist[$self->cmd_verb];
# Toss off last entry if length is >1 (and it always is).
pop(@hist) if length($DB::cmd) > 1;
- my $i = $self->cmd_verb;
+ my $i;
# Look backward through the history.
SEARCH_HIST:
last SEARCH_HIST if $hist[$i] =~ /$pat/;
}
- $self->cmd_verb($i);
-
- if ( !$self->cmd_verb ) {
+ if ( !$i ) {
# Never found it.
print $OUT "No such command!\n\n";
}
# Found it. Put it in the buffer, print it, and process it.
- $DB::cmd = $hist[$self->cmd_verb];
+ $DB::cmd = $hist[$i];
print $OUT $DB::cmd, "\n";
redo CMD;
}
unless $hist[$i] =~ /^.?$/;
}
- $self->cmd_verb($i);
-
next CMD;
}