develooper Front page | perl.perl5.porters | Postings from April 2018

[perl #133123] eval '__PACKAGE__' in debug mode do not return rightpackage

Thread Previous | Thread Next
From:
KES via RT
Date:
April 23, 2018 08:24
Subject:
[perl #133123] eval '__PACKAGE__' in debug mode do not return rightpackage
Message ID:
rt-4.0.24-29496-1524471851-642.133123-15-0@perl.org
Yes, It is implemented in this way. But to my mind it would be more consistent 
 if __PACKAGE__, __LINE__ would be bound to COP

Thus if we look at N frames up the `p __LINE__` will show user's script line and not debugger's eval.

This is minor, but looks more expected


Also when evaluating at users context, it is eval at first non-DB frame.

Just like: 'eval EXPR, 0'. It would be cool if eval in debugger mode (-d) will accept second argument which means stack frame number from TOP. And evaluates given EXPR at given frame.

This will be not so criminal to support it, because it already support 0 frame. Also this will simplify hacks like this: https://github.com/KES777/Devel-DebugHooks/blob/master/lib/Devel/DebugHooks/Commands.pm#L716

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=133123

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About