Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: How can I get the current OP address (akin to PC)?

by rockyb (Beadle)
on Sep 11, 2012 at 01:06 UTC ( #992887=note: print w/ replies, xml ) Need Help??


in reply to How can I get the current OP address (akin to PC)?

The answer I am seeking is Devel::Callsite, and I am grateful to Father Chrysostomos for enlightening me.

As pointed out by Eric Brine on p5p, this module currently fails on non-threaded Perl builds, but with luck we can get that fixed.

Starting with commit db2e1bc I am using this in Devel::Trepan.

Again, thanks to all that have helped me in this journey.


Comment on Re: How can I get the current OP address (akin to PC)?
Re^2: How can I get the current OP address (akin to PC)?
by rockyb (Beadle) on Mar 19, 2014 at 02:03 UTC

    Recently, with the good work of Ben Morrow, Devel::Callsite now has an optional level parameter similar to perl's builtin caller. With this you can get the OP address up the call stack.

    In the next release of Devel::Trepan, OP addresses will be shown in locations, by default if Devel::Callsite is installed. Currently they are shown only after the debugger command set display op on is run.

    But this got me thinking about this and identifiying the exact position. Given the tree structure nature the Perl program, it should be possible to narrow positions in a line further. For example, one can use words to describe a position within a line. If for example, that an op address is in the second statement of line 10, one might say just that. Or perhaps something like "second function call on line 10".

    Going further, one might take B::Concise output and decompile some fragment with a given op address

    I realize this probably has limited appeal, but still I think it cool. Any takers on an package that can take B::Concise output and an perl OP addresss, and narrow within a line where that OP is?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://992887]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2014-09-17 21:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (99 votes), past polls