Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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

by rockyb (Scribe)
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)?

Replies are listed 'Best First'.
Re^2: How can I get the current OP address (akin to PC)?
by rockyb (Scribe) 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://992887]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2018-04-20 07:47 GMT
Find Nodes?
    Voting Booth?