Padre, meet Devel::ebug

Finally I got some time to install Padre and try it. My first comment was something like ‘What, no debugger?!?’. One and a half hour later I was able to upload a very early release of a debugger plugin for Padre. And most of that time was spend on not having any idea what I was doing with wxPerl.

Only the very basic operations are implemented like ‘step’, ‘next’ and evaluating expressions in the debugger context. And don’t even think about trying to debug code in multiple files. Breakpoints are on the top of my TODO list and I will probably make a non-devloper release right after.

Access to a debugger form within Padre was already planned using Debug::Client, a (planned) client side API for perl5db.pl’s remote debugging feature.

Parsing perl5db.pls output doesn’t seem fun and hooking right into perl5db.pl is even less fun. So I choose another road: Léon Brocard has already implemented a new debugger with a programmable API, not unlike what is planned for Debug::Client.

Using this, most debugger commands should be a quite simple wrapper around Devel::ebug methods:


sub debug_step {
    my $self = shift;
    my $ebug = $self->{debugger};   
    my $main = Padre->ide->wx->main;

    unless (defined $ebug) {
        $main->error("Debugger isn't running");
        return;
    }

    $ebug->step;
    $self->mark_current_line;
}

Adding a debugger to other editors should be just as easy. Devel::ebug is cool!. Breakpoints for my Padre plugin is comming right up! (already at github)

1 Comment »

  1. peter.makholm.net » What do you need in a debugger? said,

    May 12, 2009 @ 10:21 pm

    [...] one and a half hour-debugger was very clearly just a proof of concept thingy. A week later I think I got most of the basic [...]

RSS feed for comments on this post · TrackBack URI

Leave a Comment