Re: accelerated stepping
[email protected] (Richard Foley) Fri, 5 Sep 2008 14:43:48 +0200
| Newsgroups | perl.debugger |
|---|---|
| Message-ID | <[email protected]> |
On Thursday 04 September 2008 21:33:41 Heiko Ei=DFfeldt wrote:
> Hello Richard,
>=20
> I discussed this topic and patch on PerlMonks, and got a general
> agreement, that the patch would have great merit.
>=20
Hi Heiko,
Good to hear that - I found the thread and appended my half'pen'th.
> New Plan
> =3D=3D=3D=3D=3D=3D=3D=3D
> So I would like to make a patch now, that will have 'n' short cut for=20
> ANY code block, not only subroutines. And that should be done without a
> regexp.
>=20
Hmmm, yes but there's always exceptions... consider arriving at the follow=
ing=20
pseudocode under the debugger:
<DB 1>=20
{
code1;
code2;
code3;
}
code4;
Do you want to step over all the three code lines above with 'n'? Probably=
=20
not if it's just a way of controlling lexical variables, for example, you=20
would be expecting to step to the next statement (code1) rather than leap=20
over to code4. I'm not sure what the solution is, but as you can see from =
the=20
various comments, it's never quite as simple as it might seem at first. =20
Possibly because it's Perl, there's just SMWTDI (so many ways to do it), th=
at=20
these kind of edge cases can become quite problematic.
> the special treatment of 'n' regarding subroutines only needs to be exten=
ded=20
> to general code blocks like those in grep/map/sort, ...
>
It's perl which provides the hook for the debugger, calling DB::sub on each=
=20
subroutine, just as DB::DB gets called for each line, so I'm not sure how=20
easy it's going to be to extend that handling for map{} and grep{} and sort=
{}=20
blocks, unless you modify Perl's source too. You may still have to emulate=
=20
it in the way you started to...
> Help is of course very much appreciated!!
>=20
If I can help, I'll be happy to do so.
=2D-=20
Richard Foley
Ciao - shorter than aufwiedersehen
http://www.rfi.net/