Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can not get required info from 'caller' at 'DB::sub'

0 views
Skip to first unread message

KES

unread,
Dec 6, 2015, 6:30:02 AM12/6/15
to debu...@perl.org
http://paste.scsys.co.uk/502483

Also it is strange to see the DB::DB is called twice for t3.pl (Notice the line 82, 85 at the paste)
The twice call does not occour if I remove 'caller' from t3.pl:4. Like: print 'FROM:';

The output:
...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
t3.pl:9 my $x = 3;

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
t3.pl:11 t();
SUB: main::t -
FROM: main - t3.pl - 17

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
t3.pl:4 print "FROM";
FROM
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
t3.pl:13 $x++;
3
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
t3.pl:18 print $x;

KES

unread,
Dec 6, 2015, 8:00:10 AM12/6/15
to debu...@perl.org
The calling from DB::sub to any subs does not add a stack frame <<-- good info to put into perldoc:
http://search.cpan.org/~abigail/perl-5.23.5/pod/perldebguts.pod#Writing_Your_Own_Debugger

so I am in my
DB::sub {
@caller_info = get_caller( 0 );
#instead of this: @caller_info = caller( 0 );
}
sub get_caller {
caller( @_ );
}

The question is resolved.

06.12.2015, 13:24, "KES" <kes...@yandex.ua>:
0 new messages