Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

With Devel::Trepan commit 263c7bfce0 I now have everything solved. There could be a better solution, but this one has certain advantages.

I can now use the debugger to fully debug a little selfloader Perl script. Since the debugger has the text of the eval string now, it writes out a temporary file. You can now list the code or set line number breakpoints in it.

The last missing problem was making sure we hooked into a debugger-enabled version of SelfLoader rather than the one that comes with Perl. In order to do this, I now trap on use statements by inserting a code reference at the beginning of %INC. See the documentation on perldoc on require and how it uses %INC.

Specifically, my code returns a file-handle glob for my debugger-enabled SelfLoader when I see that is requested. It has to be a real glob rather than a scalar reference to a file handle, or else the lookup tacitly fails.

With this custom program added to %INC I can also do other cool things. Like trace or perhaps debug into use code!

So in closing, I'll say that I am amazed at how flexible Perl is. There are lots and lots of mechanisms there. But I am equally amazed at how difficult it is to provide good debugging facility. I think most people just live with things like not being able to list lines of selfloader code or other kinds of eval'd code. Probably many (like myself too often) have to rely on just print statements.


In reply to Re^2: Modifying SelfLoader to save eval() text by rockyb
in thread Modifying SelfLoader to save eval() text 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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    [shmem]: I'm a bit scared by agile (agile imposition) - but then it is crucial how it is lived to crucified or not
    [shmem]: s/to cru/to be cru/
    [moritz]: agile itself is pretty straight forward: faster feedback loops, working in smaller increments, regularly reflect and try to improve your process
    [moritz]: it's just some implementations of agile that are scary
    [shmem]: moritz: that sound somewhat reconciling to me
    [shmem]: indeed these 3 points are the ones I'm missing most in my daily work

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (8)
    As of 2017-04-27 14:45 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      I'm a fool:











      Results (508 votes). Check out past polls.