Lines Matching defs:DB

64 The debugger uses this trick a I<lot>. Of particular note is C<DB::eval>, 
67 keep C<$@> safe until it C<DB::eval> returns, at which point the previous
247 a C<&DB'DB();> in front of each place that can have a
248 breakpoint. At each subroutine call, it calls C<&DB::sub> with
249 C<$DB::sub> set to the called subroutine. It also inserts a C<BEGIN
253 call to C<&DB::postponed($main::{'_<'.$filename})> is done. C<$filename>
276 Any other positive value causes C<DB::sub> to print return values.
280 The item to be eval'ed by C<DB::eval>. Used to prevent messing with the current
281 contents of C<@_> when C<DB::eval> is called.
317 Controls what (if anything) C<DB::eval()> will print after evaluating an
337 Used to track whether or not an C<INT> signal has been detected. C<DB::DB()>,
379 Stack of filehandles that C<DB::readline()> will read commands from.
380 Manipulated by the debugger's C<source> command and C<DB::readline()> itself.
410 The typeahead buffer, used by C<DB::readline>.
474 C<DB::sub> uses to tell when a program has recursed deeply. In addition, the
490 package DB;
501 =head2 C<DB::eval()>
507 C<$DB::evalarg>; this is done to avoid fiddling with the contents of C<@_>.
511 C<$^E>, C<$,>, C<$/>, C<$\>, and C<$^W>, grabbed when C<DB::DB> got control,
532 =head3 Parameters and variables influencing execution of DB::eval()
534 C<DB::eval> isn't parameterized in the standard way; this is to keep the
535 debugger's calls to C<DB::eval()> from mucking with C<@_>, among other things.
536 The variables listed below influence C<DB::eval()>'s execution directly.
552 The following variables are altered by C<DB::eval()> during its execution. They
553 are "stacked" via C<local()>, enabling recursive calls to C<DB::eval()>.
573 The context of C<DB::eval()> presents us with some problems. Obviously,
578 We can't use local, because the code inside C<DB::eval> can see localized
600 # Remember: this localizes @DB::res, not @main::res.
615 # $usercontext built in DB::DB near the comment
616 # "set up the context for DB::eval ..."
634 eval { &DB::save };
678 # Note that no subroutine call is possible until &DB::sub is defined
679 # (for subroutines defined outside of the package DB). In fact the same is
894 # + Added missing local()s -- DB::DB is called recursively.
1622 # Unbuffer DB::OUT. We need to see responses right away.
1624 $| = 1; # for DB::OUT
1647 print $OUT "\nDaughter DB session started...\n";
1650 print $OUT "\nLoading DB routines from $header\n";
1683 =head2 DB
1698 sub DB {
1734 # Since DB::DB gets called after every line, we can use caller() to
1741 # set up the context for DB::eval, so it can properly execute
1771 $evalarg = "\$DB::signal |= 1 if do {$stop}";
1785 local $onetimeDump; # Tell DB::eval() to not output results
1787 # Fix context DB::eval() wants to return an array, but
1810 function which will be run on each entry to C<DB::DB>; it gets the
1838 # If there's a user-defined DB::watchfunction, call it with the
1840 # the DB:: package.
1876 Special check: if we're in package C<DB::fake>, we've gone through the
1882 elsif ($package eq 'DB::fake') {
1891 # Set the DB::eval context appropriately.
1896 } ## end elsif ($package eq 'DB::fake')
2020 Most of C<DB::DB> is actually a command parsing and dispatch loop. It comes
2054 "$pidprompt DB" . ('<' x $level) . ($#hist + 1) .
2258 Hands the expression off to C<DB::eval>, setting it up to print the value
2263 $cmd =~ s/^x\b/ / && do { # Remainder gets done by DB::eval()
2275 Just uses C<DB::methods> to determine what methods are available.
2284 # m expr - set up DB::eval to do the work
2285 $cmd =~ s/^m\b/ / && do { # Rest gets done by DB::eval()
2457 when entered (see X<DB::sub>). We also save the C<n> command in C<$laststep>,
2474 Sets C<$single> to 1, which causes X<DB::sub> to continue tracing inside
2668 the debugger's status in environment variables. The C<DB::set_list> routine
2697 variable via C<DB::set_list>.
2814 Just calls C<DB::print_trace>.
2819 print_trace($OUT, 1); # skip DB
2825 Just calls C<DB::cmd_w>.
2833 Just calls C<DB::cmd_W>.
3016 Calls the C<DB::system()> to handle the command. This keeps the C<STDIN> and
3064 Uses C<DB::system> to invoke a shell.
3079 C<DB::system> to avoid problems with C<STDIN> and C<STDOUT>.
3139 $cmd =~ s/^p$/print {\$DB::OUT} \$_/;
3142 $cmd =~ s/^p\b/print {\$DB::OUT} /;
3215 Opens a lexical filehandle and stacks it on C<@cmdfhs>; C<DB::readline> will
3270 # || - run command in the pager, with output to DB::OUT.
3281 open(SAVEOUT, ">&OUT") || &warn("Can't save DB::OUT");
3293 || &warn("Can't restore DB::OUT");
3301 || &warn("Can't restore DB::OUT");
3307 $SIG{PIPE} = \&DB::catch
3328 any variables we might want to address in the C<DB> package.
3333 $cmd =~ s/^t\s/\$DB::trace |= 1;\n/;
3336 $cmd =~ s/^s\s/\$DB::single = 1;\n/ && do { $laststep = 's' };
3340 $cmd =~ s/^n\s/\$DB::single = 2;\n/ && do { $laststep = 'n' };
3346 $evalarg = "\$^D = \$^D | \$DB::db_stop;\n$cmd";
3382 close(OUT) || print SAVEOUT "\nCan't close DB::OUT\n";
3403 open(OUT, ">&STDOUT") || &warn("Can't restore DB::OUT");
3408 $SIG{PIPE} = "DEFAULT" if $SIG{PIPE} eq \&DB::catch;
3415 open(OUT, ">&SAVEOUT") || &warn("Can't restore DB::OUT");
3451 } ## end sub DB
3459 debugged. The variable C<$DB::sub> contains the name of the subroutine
3463 context, capturing its output. This of course causes C<DB::DB> to get called
3464 again, repeating until the subroutine ends and returns control to C<DB::sub>
3465 again. Once control returns, C<DB::sub> figures out whether or not to dump the
3468 C<DB::sub> hadn't been there at all.
3483 If C<caller()> is called from the package C<DB>, it provides some
3528 =item * C<@DB::args>
3588 # DB::DB will recursively get control again if appropriate; we'll come
4618 # Set up for DB::eval() - evaluate in *user* context.
5012 # Parameterize DB::eval and call it to get the expression's value
5142 For breakpoints, we use C<DB::find_sub> to locate the source file and line
5221 # Enter the command loop when DB::DB gets called.
5656 =head2 C<DB::system()> - handle calls to<system()> without messing up the debugger
5662 C<DB::system()> socks away the program's STDIN and STDOUT, and then substitutes
5964 in B<\$DB::fork_TTY>, or define a function B<DB::get_fork_TTY()> returning this.
6706 s/^perl5db$/DB/; # Special case: debugger
6707 # moves to package DB
6841 B<$psh$psh> I<cmd> Run cmd in a subprocess (reads from DB::IN, writes to DB::OUT)"
6853 B<p> I<expr> Same as \"I<print {DB::OUT} expr>\" in current package.
6854 B<|>I<dbcmd> Run debugger command, piping DB::OUT to current pager.
6855 B<||>I<dbcmd> Same as B<|>I<dbcmd> but DB::OUT is temporarilly select()ed as well.
6898 B<q> or B<^D> Quit. Set B<\$DB::finished = 0> to debug global destruction.
6904 Set B<\$DB::doccmd> to change viewer.
7017 B<$psh$psh> I<cmd> Run cmd in a subprocess (reads from DB::IN, writes to DB::OUT)"
7028 B<p> I<expr> Same as \"I<print {DB::OUT} expr>\" in current package.
7029 B<|>I<dbcmd> Run debugger command, piping DB::OUT to current pager.
7030 B<||>I<dbcmd> Same as B<|>I<dbcmd> but DB::OUT is temporarilly select()ed as well.
7074 B<q> or B<^D> Quit. Set B<\$DB::finished = 0> to debug global destruction.
7079 Set B<\$DB::doccmd> to change viewer.
7250 print $DB::OUT "Got signal @_\n";
7260 be able to get a stack trace, and output the warning message vi C<DB::dbwarn()>.
7345 # inside DB::DB, but not in Carp). Save $single and $trace, turn them off,
7363 Set the C<$DB::warnLevel> variable that stores the value of the
7376 $SIG{__WARN__} = \&DB::dbwarn;
7388 C<DB::dbdie()> function overriding any other C<die()> handler. Setting it to
7400 $SIG{__DIE__} = \&DB::dbdie; # if $dieLevel < 2;
7403 #$SIG{__DIE__} = \&DB::diehard if $dieLevel >= 2;
7429 takes over and handles them with C<DB::diesignal()>.
7439 $SIG{SEGV} = \&DB::diesignal;
7440 $SIG{BUS} = \&DB::diesignal;
7580 print $DB::OUT "$prepend$name\n";
7612 during debugger initialization). Uses C<DB::system> to avoid mucking up the
7690 debugger package globals that C<DB::sub()> requires have to be defined before
7728 $IN = \*STDIN; # For bugs before DB::OUT has been opened
7729 $OUT = \*STDERR; # For errors before DB::OUT has been opened
7753 # ($signal) that DB::DB() will check before each command is executed.
7754 $SIG{INT} = \&DB::catch;
7764 # DB::DB and DB::sub". We will turn it on forcibly before we try to
8158 We then call C<DB::fake::at_exit()>, which returns the C<Use 'q' to quit ...">
8172 $DB::single = !$fall_off_end && !$runnonstop;
8173 DB::fake::at_exit() unless $fall_off_end or $runnonstop;
8568 =head1 C<DB::fake>
8576 package DB::fake;
8582 package DB; # Do not trace this 1; below!