Devel-Command

 view release on metacpan or  search on metacpan

lib/Devel/Command/DBSub/DB_5_8_6.pm  view on Meta::CPAN

package Devel::Command::DBSub::DB_5_8_6;

sub import {
  # Includes 5.8.6, 5.8.7 and 5.8.8.
  # Also includes 5.9.2, 5.9.3 and 5.9.4.
  if( $] gt "5.008005" or 
      ( $] gt "5.009001" and
        $] lt "5.009005"
      ) 
    ) {
    return \&DB::alt_586_DB;
  }
  else {
    return;
  }
}

{
no strict;
no warnings;
package DB;

sub alt_586_DB {

    # lock the debugger and get the thread id for the prompt
	lock($DBGR);
	my $tid;
	if ($ENV{PERL5DB_THREADED}) {
		$tid = eval { "[".threads->self->tid."]" };
	}
	else {
	        $tid = "";
	}

    # Check for whether we should be running continuously or not.
    # _After_ the perl program is compiled, $single is set to 1:
    if ( $single and not $second_time++ ) {

        # Options say run non-stop. Run until we get an interrupt.
        if ($runnonstop) {    # Disable until signal
                # If there's any call stack in place, turn off single
                # stepping into subs throughout the stack.
            for ( $i = 0 ; $i <= $stack_depth ; ) {
                $stack[ $i++ ] &= ~1;
            }

            # And we are now no longer in single-step mode.
            $single = 0;

            # If we simply returned at this point, we wouldn't get
            # the trace info. Fall on through.
            # return;
        } ## end if ($runnonstop)

        elsif ($ImmediateStop) {

            # We are supposed to stop here; XXX probably a break.
            $ImmediateStop = 0;    # We've processed it; turn it off
            $signal        = 1;    # Simulate an interrupt to force
                                   # us into the command loop
        }
    } ## end if ($single and not $second_time...

    # If we're in single-step mode, or an interrupt (real or fake)
    # has occurred, turn off non-stop mode.
    $runnonstop = 0 if $single or $signal;

    # Preserve current values of $@, $!, $^E, $,, $/, $\, $^W.



( run in 1.203 second using v1.01-cache-2.11-cpan-800906f7e73 )