Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > perl.debugger > #1 > unrolled thread

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

Started bykes-kes@yandex.ua (KES)
First post2015-12-06 13:24 +0200
Last post2015-12-06 14:48 +0200
Articles 2 — 1 participant

Back to article view | Back to perl.debugger


Contents

  Can not get required info from 'caller' at 'DB::sub' kes-kes@yandex.ua (KES) - 2015-12-06 13:24 +0200
    Re: Can not get required info from 'caller' at 'DB::sub' kes-kes@yandex.ua (KES) - 2015-12-06 14:48 +0200

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

Fromkes-kes@yandex.ua (KES)
Date2015-12-06 13:24 +0200
SubjectCan not get required info from 'caller' at 'DB::sub'
Message-ID<434161449401082@web19g.yandex.ru>
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;

[toc] | [next] | [standalone]


#2

Fromkes-kes@yandex.ua (KES)
Date2015-12-06 14:48 +0200
Message-ID<4300861449406110@web25m.yandex.ru>
In reply to#1
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-kes@yandex.ua>:
> 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;

[toc] | [prev] | [standalone]


Back to top | Article view | perl.debugger


csiph-web