Thanks for the encouragement...! 8-)

I've indeed looked into the debugger (perl5db.pl) where it's reading the caller info (near the beginning of sub DB) and I've patched my script into it right there. I didn't even have to change the $line variable as it's present with that name there already. ;-)

Of course it's still a dirty hack in its current form, but it suits me for the moment: The editor cursor indeed follows the debugger in lockstep, now even without having to insert a pre-prompt command.

Cool! :-)

Especially since the debugger now always points to the code in the editor right where it's ready to get fixed right away, just like a regular IDE. (I still have to switch windows in the editor when tracing into a different file for now, but the application window always remains in the background and updates there while I'm tracing Perl in the Terminal, so that's bearable for the moment.)

At a cursory glance I haven't seen an obvious "official" hook for this purpose in the debugger source yet, so even if my immediate need has now been satisfied, a cleaner way would still be interesting to know if somebody should happen to know one.


In reply to Re^2: Perl Debugger: Is there a variable with the current source line number being traced? by Shoveler
in thread Update: homespun GUI Wrapper for the Perl Debugger with an auto-refreshing editor (BBEdit on Mac OS X) (was: Perl Debugger: Is there a variable with the current source line number being traced?) by Shoveler

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.