Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of jjore (6662)

Monday December 24, 2007
01:35 AM

Obstacles to porting SmallTalk debugger in Perl

[ #35197 ]

I've been playing in Squeak recently and it has the best debugger I've ever seen before. Not only can I inspect any part of the running system, I can modify the code for anything, let the absence of methods or other exceptions serve as breakpoints, pop up a level (or many) in the stack and restart a function.

It's sweet. To make this happen in Perl 5 I'd need the following facilities that

"find the source for the thing that is executing"
"project an editor somewhere useful"
"be able to accept the edited code and replace it in the original file (this is difficult. maybe requires PPI)"
"Merge newly compiled block into running program. (trivial? for non-closures. needs rebinding for closures)"
"pop the stack to some arbitrary point. be able to restart the block"

This is just off the top of my head. Maybe it's not worth doing in Perl 5 but it'd be hella nice to have.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • A custom runloop plus a little optional B::Op magic would fix up step one nice. If you can't do it in ten lines of code, that's because making B::Op's blessing code reusable is a lot more work than it should be.

  • You'd be my hero!

    I remember programming in VisualWorks for Smalltalk in the 90's where we'd start coding by putting a halt in the source code and then just debug the program until it was done.

  • might be Devel::ebug.
  • ``"Merge newly compiled block into running program. (trivial? for non-closures. needs rebinding for closures)"''

    Code::Splice. Cross your fingers, though.

    Should work for closures. There's a fun bit of code in there that looks up the pad entries for variables in the source and target pads and changes the t_args to whatever the variable is named in the target. With the right t_arg and Perl providing the right pad for the closure, it should just kinda go.

    Something that's been nagging me is how utterly cool d