$cmd =~ m{\A(\S*)};
- $obj->i_cmd($1);
+ $obj->cmd_verb($1);
return;
}
if (my ($new_i) = $cmd =~ m#\Ac\b\s*([\w:]*)\s*\z#) {
- $obj->i_cmd($new_i);
+ $obj->cmd_verb($new_i);
# Hey, show's over. The debugged program finished
# executing already.
next CMD if _DB__is_finished();
# Capture the place to put a one-time break.
- $subname = $obj->i_cmd;
+ $subname = $obj->cmd_verb;
# Probably not needed, since we finish an interactive
# sub-session anyway...
( $file, $new_i ) = ( find_sub($subname) =~ /^(.*):(.*)$/ );
# Force the line number to be numeric.
- $obj->i_cmd($new_i + 0);
+ $obj->cmd_verb($new_i + 0);
# If we got a line number, we found the sub.
- if ($obj->i_cmd) {
+ if ($obj->cmd_verb) {
# Switch all the debugger's internals around so
# we're actually working with that file.
# Scan forward to the first executable line
# after the 'sub whatever' line.
$max = $#dbline;
- my $ii = $obj->i_cmd;
+ my $ii = $obj->cmd_verb;
++$ii while $dbline[$ii] == 0 && $ii < $max;
- $obj->i_cmd($ii);
+ $obj->cmd_verb($ii);
} ## end if ($i)
# We didn't find a sub by that name.
# On the gripping hand, we can't do anything unless the
# current value of $i points to a valid breakable line.
# Check that.
- if ($obj->i_cmd) {
+ if ($obj->cmd_verb) {
# Breakable?
- if ( $dbline[$obj->i_cmd] == 0 ) {
- print $OUT "Line " . $obj->i_cmd . " not breakable.\n";
+ if ( $dbline[$obj->cmd_verb] == 0 ) {
+ print $OUT "Line " . $obj->cmd_verb . " not breakable.\n";
next CMD;
}
# Yes. Set up the one-time-break sigil.
- $dbline{$obj->i_cmd} =~ s/($|\0)/;9$1/; # add one-time-only b.p.
- _enable_breakpoint_temp_enabled_status($filename, $obj->i_cmd);
+ $dbline{$obj->cmd_verb} =~ s/($|\0)/;9$1/; # add one-time-only b.p.
+ _enable_breakpoint_temp_enabled_status($filename, $obj->cmd_verb);
} ## end if ($i)
# Turn off stack tracing from here up.
$tid = eval { "[".threads->tid."]" };
}
- my $i;
+ my $cmd_verb;
my $obj = DB::Obj->new(
{
after => \$after,
explicit_stop => \$explicit_stop,
infix => \$infix,
- i_cmd => \$i,
+ cmd_verb => \$cmd_verb,
pat => \$pat,
piped => \$piped,
selected => \$selected,
=cut
# See if there's an alias for the command, and set it up if so.
- if ( $alias{$i} ) {
+ if ( $alias{$cmd_verb} ) {
# Squelch signal handling; we want to keep control here
# if something goes loco during the alias eval.
# scope! Otherwise, we can't see the special debugger
# variables, or get to the debugger's subs. (Well, we
# _could_, but why make it even more complicated?)
- eval "\$cmd =~ $alias{$i}";
+ eval "\$cmd =~ $alias{$cmd_verb}";
if ($@) {
local $\ = '';
- print $OUT "Couldn't evaluate '$i' alias: $@";
+ print $OUT "Couldn't evaluate '$cmd_verb' alias: $@";
next CMD;
}
_DB__trim_command_and_return_first_component($obj);
- } ## end if ($alias{$i})
+ } ## end if ($alias{$cmd_verb})
=head3 MAIN-LINE COMMANDS
$obj->_handle_special_char_cmd_wrapper_commands;
_DB__trim_command_and_return_first_component($obj);
- if (my $cmd_rec = $cmd_lookup{$i}) {
+ if (my $cmd_rec = $cmd_lookup{$cmd_verb}) {
my $type = $cmd_rec->{t};
my $val = $cmd_rec->{v};
if ($type eq 'm') {
{
no strict 'refs';
foreach my $slot_name (qw(
- after explicit_stop infix pat piped position prefix selected i_cmd
+ after explicit_stop infix pat piped position prefix selected cmd_verb
)) {
my $slot = $slot_name;
*{$slot} = sub {
# thing if nothing following.
my $new_i = $minus ? ( $#hist - ( $arg || 1 ) ) : ( $arg || $#hist );
- $self->i_cmd($new_i);
+ $self->cmd_verb($new_i);
# Pick out the command desired.
- $DB::cmd = $hist[$self->i_cmd];
+ $DB::cmd = $hist[$self->cmd_verb];
# Print the command to be executed and restart the loop
# with that command in the buffer.
# Toss off last entry if length is >1 (and it always is).
pop(@hist) if length($DB::cmd) > 1;
- my $i = $self->i_cmd;
+ my $i = $self->cmd_verb;
# Look backward through the history.
SEARCH_HIST:
last SEARCH_HIST if $hist[$i] =~ /$pat/;
}
- $self->i_cmd($i);
+ $self->cmd_verb($i);
- if ( !$self->i_cmd ) {
+ if ( !$self->cmd_verb ) {
# 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->i_cmd];
+ $DB::cmd = $hist[$self->cmd_verb];
print $OUT $DB::cmd, "\n";
redo CMD;
}
unless $hist[$i] =~ /^.?$/;
}
- $self->i_cmd($i);
+ $self->cmd_verb($i);
next CMD;
}