Devel::Callsite change and getting more detail about source-code position

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 identifying the exact position. I've mentioned this topic before in a previous blog post and on PerlMonks.

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?

Leave a comment

About Rocky Bernstein

user-pic I blog about Perl.