Lines Matching defs:sub
53 sub foo {
236 sub afterinit { $trace = 1; }
246 Perl supplies the values for C<%sub>. It effectively inserts
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
276 Any other positive value causes C<DB::sub> to print return values.
296 =item * 4 - Extended messages: C<in|out> I<context>=I<fully-qualified sub name> from I<file>:I<line>>. If no other flag is on, acts like 1+4.
354 =item * 4 - print current sub depth (turned on to force this when "too much
453 =item * 'compile' - break when this sub is compiled
474 C<DB::sub> uses to tell when a program has recursed deeply. In addition, the
596 sub eval {
655 } ## end sub eval
678 # Note that no subroutine call is possible until &DB::sub is defined
717 # + `c sub' documented.
826 # cmd_b_sub($sub [, $cond]) # b sub [cond]
847 # break_subroutine($sub [, $cond]) # break on the first breakable line
848 # ($name, $from, $to) = subroutine_filename_lines($sub)
1271 sub safe_do {
1289 } ## end sub safe_do
1299 sub is_safe_file {
1307 } ## end sub is_safe_file
1671 # If there was an afterinit() sub defined, call it. It will get
1698 sub DB {
1909 $sub =~ s/\'/::/; # Swap Perl 4 package separators (') to
1913 $prefix = $sub =~ /::/ ? "" : "${'package'}::";
1914 $prefix .= "$sub($filename:";
2162 Walks through C<%sub>, checking to see whether or not to print the name.
2177 # If $nocheck is true, just print the sub name.
2180 foreach $subname (sort(keys %sub)) {
2297 # help for no arguments (old-style was return from sub).
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
2510 # sub-session anyway...
2534 # If we got a line number, we found the sub.
2543 # after the 'sub whatever' line.
2548 # We didn't find a sub by that name.
2557 # the code following the definition of the sub, looking
2734 my ($quoted, $sub, %subs, $line) = quotemeta $_;
2735 for $sub (keys %sub) {
2736 next unless $sub{$sub} =~ /^$quoted:(\d+)-(\d+)$/;
2737 $subs{$sub} = [$1, $2];
2746 # One breakpoint per sub only:
2747 my ($offset, $sub, $found);
2748 SUBS: for $sub (keys %subs) {
2750 $subs{$sub}->[1] >=
2758 $found = $sub;
2759 $offset = $line - $subs{$sub}->[0];
2762 } ## end if ($subs{$sub}->[1] >=...
2763 } ## end for $sub (keys %subs)
3177 unless (eval "sub { s\a$k\a$v\a }; 1") {
3451 } ## end sub DB
3456 =head2 sub
3458 C<sub> is called whenever a subroutine call happens in the program being
3459 debugged. The variable C<$DB::sub> contains the name of the subroutine
3462 The core function of this subroutine is to actually call the sub in the proper
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.
3470 C<sub> does all the work of printing the subroutine entry and exit messages
3471 enabled by setting C<$frame>. It notes what sub the autoloader got called for,
3477 C<$deep>, C<sub> automatically turns on printing of the current depth by
3490 The package name the sub was in
3536 sub sub {
3539 # sub's return value in (if needed), and an array to put the sub's
3544 # into AUTOLOAD for $sub.
3545 if (length($sub) > 10 && substr($sub, -10, 10) eq '::AUTOLOAD') {
3546 $al = " for $$sub";
3578 print_trace($LINEINFO, -1, 1, 1, "$sub$al")
3580 : print_lineinfo(' ' x ($stack_depth - 1), "entering $sub$al\n")
3585 # Determine the sub's return type,and capture approppriately.
3587 # Called in array context. call sub and capture output.
3589 # back here when the sub is finished.
3590 @ret = &$sub;
3600 print_trace($LINEINFO, -1, 1, 1, "$sub$al")
3602 : print_lineinfo(' ' x $stack_depth, "exited $sub$al\n")
3617 print $fh "list context return from $sub:\n";
3632 $ret = &$sub;
3636 &$sub;
3648 print_trace($LINEINFO, -1, 1, 1, "$sub$al")
3650 : print_lineinfo(' ' x $stack_depth, "exited $sub$al\n")
3662 ? "scalar context return from $sub: "
3663 : "void context return from $sub\n"
3672 } ## end sub sub
3739 the sub to call based on the value found in the hash (if it's there). I<All>
3747 sub cmd_wrapper {
3761 } ## end sub cmd_wrapper
3771 sub cmd_a {
3808 } ## end sub cmd_a
3817 sub cmd_A {
3845 } ## end sub cmd_A
3856 sub delete_action {
3883 } ## end sub delete_action
3895 sub cmd_b {
3915 # b compile|postpone <some sub> [<condition>]
3922 # Save the sub name and set $break to 1 if $1 was 'postpone', 0
3935 # Save the break type for this sub.
3939 # b <sub name> [<condition>]
3963 } ## end sub cmd_b
3973 sub break_on_load {
3987 sub report_break_on_load {
3999 sub cmd_b_load {
4025 } ## end sub cmd_b_load
4078 sub breakable_line {
4145 } ## end sub breakable_line
4153 sub breakable_line_in_filename {
4168 } ## end sub breakable_line_in_filename
4177 sub break_on_line {
4203 } ## end sub break_on_line
4212 sub cmd_b_line {
4217 } ## end sub cmd_b_line
4226 sub break_on_filename_line {
4241 } ## end sub break_on_filename_line
4250 sub break_on_filename_line_range {
4261 } ## end sub break_on_filename_line_range
4270 sub subroutine_filename_lines {
4277 } ## end sub subroutine_filename_lines
4287 sub break_subroutine {
4300 } ## end sub break_subroutine
4323 sub cmd_b_sub {
4358 } ## end sub cmd_b_sub
4371 sub cmd_B {
4401 } ## end sub cmd_B
4428 sub delete_breakpoint {
4484 } ## end sub delete_breakpoint
4494 sub cmd_stop { # As on ^C, but not signal-safy.
4512 sub cmd_h {
4565 } ## end sub cmd_h
4573 sub cmd_i {
4589 } ## end sub cmd_i
4605 sub cmd_l {
4634 # l name. Try to find a sub by that name.
4656 @pieces = split (/:/, find_sub($subname) || $sub{$subname});
4779 } ## end sub cmd_l
4796 sub cmd_L {
4906 } ## end sub cmd_L
4914 sub cmd_M {
4926 sub cmd_o {
4941 } ## end sub cmd_o
4949 sub cmd_O {
4963 sub cmd_v {
4987 } ## end sub cmd_v
5001 sub cmd_w {
5031 } ## end sub cmd_w
5049 sub cmd_W {
5094 } ## end sub cmd_W
5110 sub save {
5120 } ## end sub save
5131 sub print_lineinfo {
5137 } ## end sub print_lineinfo
5152 sub postponed_sub {
5169 # Switch to the file this sub is in, temporarily.
5189 # find_sub didn't find the sub.
5199 } ## end sub postponed_sub
5215 sub postponed {
5260 } ## end sub postponed
5301 sub dumpit {
5315 # Load dumpvar.pl unless we've already got the sub we need from it.
5344 } ## end sub dumpit
5374 sub print_trace {
5386 my @sub = dump_trace($_[0] + 1, $_[1]);
5389 my $short = $_[2]; # Print short report, next one for sub name
5393 for ($i = 0 ; $i <= $#sub ; $i++) {
5402 defined $sub[$i]{args}
5403 ? "(@{ $sub[$i]{args} })"
5410 my $file = $sub[$i]{file};
5415 # Get the actual sub's name, and shorten to $maxtrace's requirement.
5416 $s = $sub[$i]{sub};
5419 # Short report uses trimmed file and sub names.
5421 my $sub = @_ >= 4 ? $_[3] : $s;
5423 "$sub[$i]{context}=$sub$args from $file:$sub[$i]{line}\n";
5428 print $fh "$sub[$i]{context} = $s$args" . " called from $file" .
5429 " line $sub[$i]{line}\n";
5431 } ## end for ($i = 0 ; $i <= $#sub...
5432 } ## end sub print_trace
5452 =item * C<sub> - subroutine name, or C<eval> information
5464 sub dump_trace {
5481 my ($p, $file, $line, $sub, $h, $context);
5483 my ($e, $r, @a, @sub, $args);
5502 and ($p, $file, $line, $sub, $h, $context, $e, $r) = caller($i) ;
5549 # if the sub has args ($h true), make an anonymous array of the
5562 $sub = "require '$e'";
5566 $sub = "eval '$e'";
5569 # If the sub is '(eval)', this is a block eval, meaning we don't
5571 elsif ($sub eq '(eval)') {
5572 $sub = "eval {...}";
5575 # Stick the collected information into @sub as an anonymous hash.
5577 @sub,
5580 sub => $sub,
5593 @sub;
5594 } ## end sub dump_trace
5605 sub action {
5615 } ## end sub action
5629 sub unbalanced {
5642 } ## end sub unbalanced
5652 sub gets {
5668 sub system {
5699 } ## end sub system
5721 sub setterm {
5793 } ## end sub setterm
5830 sub xterm_get_fork_TTY {
5844 } ## end sub xterm_get_fork_TTY
5853 sub os2_get_fork_TTY {
5912 } ## end sub os2_get_fork_TTY
5933 sub create_IN_OUT { # Create a window with IN/OUT handles redirected there
5978 } ## end sub create_IN_OUT
5999 sub resetterm { # We forked, so we need a different TTY
6029 } ## end sub resetterm
6048 sub readline {
6105 } ## end sub readline
6119 sub dump_option {
6124 } ## end sub dump_option
6136 sub option_val {
6172 } ## end sub option_val
6195 sub parse_options {
6294 # Call the appropriate sub if it gets set via sub.
6303 } ## end sub parse_options
6319 sub set_list {
6334 } ## end sub set_list
6343 sub get_list {
6354 } ## end sub get_list
6367 sub catch {
6384 sub warn {
6389 } ## end sub warn
6401 sub reset_IN_OUT {
6427 } ## end sub reset_IN_OUT
6446 sub TTY {
6482 } ## end sub TTY
6492 sub noTTY {
6498 } ## end sub noTTY
6509 sub ReadLine {
6515 } ## end sub ReadLine
6525 sub RemotePort {
6531 } ## end sub RemotePort
6540 sub tkRunning {
6549 } ## end sub tkRunning
6558 sub NonStop {
6565 } ## end sub NonStop
6574 sub pager {
6580 } ## end sub pager
6589 sub shellBang {
6603 } ## end sub shellBang
6613 sub ornaments {
6627 } ## end sub ornaments
6636 sub recallCommand {
6650 } ## end sub recallCommand
6662 sub LineInfo {
6682 } ## end sub LineInfo
6697 sub list_modules { # versions
6722 } ## end sub list_modules
6746 sub sethelp {
6762 B<c> [I<line>|I<sub>] Continue; optionally inserts a one-time-only breakpoint
6913 B<l> [I<ln>|I<sub>] List source code B<T> Stack trace
6918 B<M> Show module versions B<c> [I<ln>|I<sub>] Continue until position
6921 B<<>[B<<>]|B<{>[B<{>]|B<>>[B<>>] [I<cmd>] Do pre/post-prompt B<b> [I<ln>|I<event>|I<sub>] [I<cnd>] Set breakpoint
6948 B<c> [I<line>|I<sub>] Continue; optionally inserts a one-time-only breakpoint
7088 B<l> [I<ln>|I<sub>] List source code B<T> Stack trace
7093 B<v> Show versions of modules B<c> [I<ln>|I<sub>] Continue until position
7096 B<<>[B<<>]|B<{>[B<{>]|B<>>[B<>>] [I<cmd>] Do pre/post-prompt B<b> [I<ln>|I<event>|I<sub>] [I<cnd>] Set breakpoint
7115 } ## end sub sethelp
7126 sub print_help {
7174 } ## end sub print_help
7184 sub fix_less {
7206 } ## end sub fix_less
7220 sub diesignal {
7255 } ## end sub diesignal
7264 sub dbwarn {
7303 } ## end sub dbwarn
7319 sub dbdie {
7326 my $sub;
7359 } ## end sub dbdie
7371 sub warnLevel {
7383 } ## end sub warnLevel
7393 sub dieLevel {
7423 } ## end sub dieLevel
7433 sub signalLevel {
7448 } ## end sub signalLevel
7466 sub CvGV_name {
7482 sub CvGV_name_or_bust {
7490 } ## end sub CvGV_name_or_bust
7497 Tries to use X<@sub> first; if it can't find it there, it tries building a
7499 loading it into X<@sub> as a side effect (XXX I think). If it can't find it
7500 this way, it brute-force searches X<%sub>, checking for identical references.
7504 sub find_sub {
7506 $sub{$subr} or do {
7510 $data = $sub{$name} if defined $name;
7516 for (keys %sub) {
7519 $sub{$s} if $s;
7521 } ## end sub find_sub
7531 sub methods {
7546 } ## end sub methods
7558 sub methods_via {
7594 } ## end sub methods_via
7602 sub setman {
7607 } ## end sub setman
7617 sub runman {
7665 ref reftut run sec style sub syn thrtut tie toc todo toot tootc
7683 } ## end sub runman
7690 debugger package globals that C<DB::sub()> requires have to be defined before
7709 =item * The fact that we're not in a sub at all right now.
7749 # We're not in any sub yet, but we need this to be a defined value.
7750 $sub = '';
7764 # DB::DB and DB::sub". We will turn it on forcibly before we try to
7810 sub db_complete {
7842 return sort grep /^\Q$text/, (keys %sub),
7844 (map { /$search/ ? ($1) : () } keys %sub)
7929 We look through all of the defined subs (the keys of C<%sub>) and
7938 return sort map "$prefix$_", grep /^\Q$text/, (keys %sub),
7941 keys %sub
8112 } ## end sub db_complete
8124 sub end_report {
8136 sub clean_ENV {
8143 } ## end sub clean_ENV
8192 sub cmd_pre580_null {
8204 sub cmd_pre580_a {
8243 } ## end sub cmd_pre580_a
8251 sub cmd_pre580_b {
8263 # b compile|postpone <some sub> [<condition>]
8270 # Save the sub name and set $break to 1 if $1 was 'postpone', 0
8284 # Save the break type for this sub.
8288 # b <sub name> [<condition>]
8301 } ## end sub cmd_pre580_b
8309 sub cmd_pre580_D {
8352 } ## end sub cmd_pre580_D
8361 sub cmd_pre580_h {
8407 } ## end sub cmd_pre580_h
8415 sub cmd_pre580_W {
8445 } ## end sub cmd_pre580_W
8462 sub cmd_pre590_prepost {
8468 } ## end sub cmd_pre590_prepost
8479 sub cmd_prepost { my $cmd = shift;
8565 } ## end sub cmd_prepost
8578 sub at_exit {