Is it possible to move the debugger context up and down the stack?

I am mainly looking for the perl equivalent of the up and down gdb commands. If I open a subroutine barand I have a call stack that looks like this:

foo
  \
   baz
    \
     bar

I would like to be able (without coming back from baror baz) to move around the frame fooand see what he was doing, manipulating the variables, since I usually used the arguments for por x.

+5
source share
1 answer

Use the command y.

$ cat frames.pl
sub bar {
    my $fnord = 42;
    1
}
sub baz { bar }
sub foo {
    my $fnord = 23;
    baz
};
foo;
$ perl -d frames.pl

Loading DB routines from perl5db.pl version 1.37
Editor support available.

Enter h or 'h h' for help, or 'man perldebug' for more help.

main::(frames.pl:10):   foo;
DB<1> c 3
main::bar(frames.pl:3):     1
DB<2> y 2 fnord
$fnord = 23
DB<3> T
. = main::bar() called from file 'frames.pl' line 5
. = main::baz() called from file 'frames.pl' line 8
. = main::foo() called from file 'frames.pl' line 10
+5
source

All Articles