Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

debugging engine features

0 views
Skip to first unread message

Ed S. Peschko

unread,
Mar 15, 2007, 9:07:18 PM3/15/07
to perl5-...@perl.org
All,

I see that the regex engine has gotten a good rewrite for 5.10 (good to see), any
work being done on the default debugger?

I've got some rather kludgy code to do the following:

bc /pattern_in_code/

which dynamically breaks the next time the code that is being executed sees
the given pattern in the code that is running, and:

bd /pattern_in_data/

which dynamically breaks when ANY lexical, global, or our variable contains
the given pattern in its value. So, eg


1 for ($xx = 0; $xx < 10; $xx++)
2 {
3 $xx++;
4 print STDERR "HERE - $xx\n"
5 $hash->{$xx}++;
6 }

bc /HERE/

would break at line 4 and

bd /6/

would break at 3 and 5 (when $xx became 6, and when $hash->{$xx} became 6 and when
$hash->{6} was assigned. )

Its got some limitations (references for example don't track), and is slow, but is
very useful. And I'd like to see something like it integrated into the standard
debugger (right now its standalone), but am hesitant to dump any more kludges on
top of it.

Ed

Joe McMahon

unread,
Mar 15, 2007, 11:17:30 PM3/15/07
to Ed S. Peschko, perl5-...@perl.org

On Mar 15, 2007, at 6:07 PM, Ed S. Peschko wrote:

> I see that the regex engine has gotten a good rewrite for 5.10
> (good to see), any
> work being done on the default debugger?

I know MJD was going to look at it, but never heard anything further.
There's also Devel::ebug, which apparently works pretty well...

If you really want to add commands to the debugger, Devel::Command
makes it pretty easy to write them as plugins. It works fine from
CPAN, so it doesn't have to be integrated into the debugger; I carry
around patched versions of DB::DB to do the external command lookup.

> I'd like to see something like it integrated into the standard
> debugger (right now its standalone), but am hesitant to dump any
> more kludges on
> top of it.

You might want to look into converting your command into a
Devel::Command plugin. As is often said, "don't put it into the core
if it can live on CPAN", which is why I've not submitted it as a
patch previously. That said, just adding the lookup hash and the
little bit of code that supports it would let me remove my DB::DB
patch kludge.

I can post a patch if there's interest in seeing how the debugger
patch code works; it's not a big deal in itself.

--- Joe M

Richard Foley

unread,
Mar 16, 2007, 5:06:13 AM3/16/07
to perl5-...@perl.org, Joe McMahon, Ed S. Peschko
On Friday 16 March 2007 04:17, Joe McMahon wrote:
>
> On Mar 15, 2007, at 6:07 PM, Ed S. Peschko wrote:
>
> > I see that the regex engine has gotten a good rewrite for 5.10
> > (good to see), any
> > work being done on the default debugger?
>
Work is always being done, it's just intermittent :-)

See Andreas's latest patch for carrying command history across sessions, so
that it behaves in a similar manner to the CPAN session history mechanism.

And Bo's MacOs fork support.

etc.

> > I'd like to see something like it integrated into the standard
> > debugger (right now its standalone), but am hesitant to dump any
> > more kludges on top of it.
>

What's one more kludge going to do? So long as it works, and doesn't
adversely effect any other code, (you have tested it, haven't you?).
Progress might be painful, and/or slow, but it's still progress. If you
don't put the patch in, you'll find no-one else will know about it, and it
will remain useful to just you. If you do put it in, it keeps the feature
set in one place for someone to rewrite the whole thing in a modular manner.
If it's a useful patch, apply and reap the benefit of p5p's benign replies...

> why I've not submitted it as a
> patch previously. That said, just adding the lookup hash and the
> little bit of code that supports it would let me remove my DB::DB
> patch kludge.
>
> I can post a patch if there's interest in seeing how the debugger
> patch code works; it's not a big deal in itself.
>

We're all waiting for perl6 to come and clean up everything anyway, so what
does it matter if the debugger's lair get's one more baby dragon?

IMHO: just patch it and be done with it.

--
Richard Foley
Ciao - shorter than aufwiedersehen


http://www.rfi.net/

0 new messages