rockyb has asked for the wisdom of the Perl Monks concerning the following question:
Note: Since this query, I have written two Perl blog posts on the topic, and will be describing this at YAPC Glasgow 2018.
Those few of you who know me here or elsewhere, know that a pet peeve of mine is the use of a "line number" to indicate the current position in a program. See Identifying a location with finer granularity than a line number.
So to this end, in my my Perl5 debugger I give a B::OP address in addition to the line number (function name, or file name).
And there is an additional CPAN module one can install to allow disassembly of the code at that point.
All good so far. But I just realized that for multi-statement lines, what I think I want is to use B::Deparse...
So now to the question. Ideally what I'd like to do is pass it a COP address and have it deparse starting from there. Alternatively, what I had to do in in handling disassemble was to do a larger portion and then later filter it down to the part needed. (And in the process I do some colorization and mark breakpoints and indicate the current location if that appears in the display).
So its okay if I have to filter more encompassing output. But even here, the deparsed code doesn't have COP addresses for me to filter on. Or hopefully I am wrong? At worst, I suppose I could revise B::Deparse to do what I want, but that of course is drastic and not something I'd want to do if I didn't have to.
Thoughts? Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: RFC: Location via B::Deparse
by rockyb (Scribe) on Oct 27, 2015 at 17:48 UTC | |
by rockyb (Scribe) on Oct 28, 2015 at 03:34 UTC | |
by rockyb (Scribe) on Nov 01, 2015 at 01:25 UTC | |
by rockyb (Scribe) on Nov 11, 2015 at 17:16 UTC |