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


In reply to RFC: Location via B::Deparse by rockyb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.