Re: accelerated stepping
Hi Richard, Richard Foley wrote: New Plan So I would like to make a patch now, that will have 'n' short cut for ANY code block, not only subroutines. And that should be done without a regexp. Hmmm, yes but there's always exceptions... consider arriving at the following pseudocode under the debugger: DB 1 { code1; code2; code3; } code4; Do you want to step over all the three code lines above with 'n'? No, I don't want that. I probably phrased my intention unprecisely. Whenever a real subroutine is involved, it should be stepped over. Sometimes this is an argument to the sort function... Probably not if it's just a way of controlling lexical variables, for example, you would be expecting to step to the next statement (code1) rather than leap over to code4. I'm not sure what the solution is, but as you can see from the various comments, it's never quite as simple as it might seem at first. Possibly because it's Perl, there's just SMWTDI (so many ways to do it), that these kind of edge cases can become quite problematic. Agreed. Heiko
Re: accelerated stepping
Richard Foley wrote: On Friday 29 August 2008 19:28:08 Heiko Eifeldt wrote: To Richard: Afterwards I realized, $DB::single is to be used as a bitmask. So it would be 8 instead of 3, since 4 is already taken. Details, details ;-) The only difference should be the execution of grep/map/sort/... I either use 's' to do small steps or use 'n' with the intention to do bigger steps. But currently I cannot get this behaviour. It is not exactly what is documented, but this is what my expectation is (silly me). heretic mode off If you mean: 1. n - next step over everything (including grep/map/sort). 2. s - step into everything (including grep/map/sort). 3. forget nn and N. Then I would think this would be (mostly very) intuitive change, and the behaviour (most) people would expect from the debugger, most of the time. You'd have to check for unwarranted side effects of course, such that blocks other than single-line grep, map and sort, remain unaffected, but otherwise it seems to me to be a good idea. Ok, here is what I did, patch is against Perl 5.10.0. Please review, thanks. My simple tests worked so far. Greetings, Heiko -- accelerated_n_perldb.pl.diff Description: Binary data
Re: accelerated stepping
Richard Foley wrote: If you mean: 1. n - next step over everything (including grep/map/sort). 2. s - step into everything (including grep/map/sort). 3. forget nn and N. Then I would think this would be (mostly very) intuitive change, and the behaviour (most) people would expect from the debugger, most of the time. You'd have to check for unwarranted side effects of course, such that blocks other than single-line grep, map and sort, remain unaffected, but otherwise it seems to me to be a good idea. I forgot to mention, yes I agree. My patch changed only 'n' like you wrote. Heiko --
Re: accelerated stepping
On Friday 29 August 2008 19:28:08 Heiko Ei�feldt wrote: To Richard: Afterwards I realized, $DB::single is to be used as a bitmask. So it would be 8 instead of 3, since 4 is already taken. Details, details ;-) The only difference should be the execution of grep/map/sort/... I either use 's' to do small steps or use 'n' with the intention to do bigger steps. But currently I cannot get this behaviour. It is not exactly what is documented, but this is what my expectation is (silly me). heretic mode off If you mean: 1. n - next step over everything (including grep/map/sort). 2. s - step into everything (including grep/map/sort). 3. forget nn and N. Then I would think this would be (mostly very) intuitive change, and the behaviour (most) people would expect from the debugger, most of the time. You'd have to check for unwarranted side effects of course, such that blocks other than single-line grep, map and sort, remain unaffected, but otherwise it seems to me to be a good idea. -- Richard Foley Ciao - shorter than aufwiedersehen http://www.rfi.net/
Re: accelerated stepping
On Fri, Aug 29, 2008 at 3:53 PM, Richard Foley [EMAIL PROTECTED] wrote: Hi Heiko, I could imagine $DB::single can be set to 3 for this 'accelerated' stepping. It's a good idea. May I reserve the capital N for that command? Nearly :-) I only mean you could use either 'nn' or 'N', equally. To be honest, the former appeals a little more as an extention to the existing command, while the latter seems to be a bit more distinct, although I don't actually have another suggestion for the latter at the moment either. If you implement it though, I suspect you can use any letter you choose, certainly at first... Hello, +1 on that. I like the idea of `nn' rather than 'N'. It's nicely in line with `-vvv' being ridiculously verbose in many GNU utils. Spiros Denaxas -- Richard Foley Ciao - shorter than aufwiedersehen http://www.rfi.net/ On Wednesday 27 August 2008 21:33:25 Heiko Eißfeldt wrote: Hi, often during single-stepping I am missing a command like 'n' to step over not only subroutine calls, but also complete map and grep-commands. Example: Instead of main::(perldb_demo.pl:4): my @a = (1..10); DB1 n main::(perldb_demo.pl:6): if (0 scalar grep { $_ == 9 } @a) { DB1 main::(perldb_demo.pl:6): if (0 scalar grep { $_ == 9 } @a) { DB1 main::(perldb_demo.pl:6): if (0 scalar grep { $_ == 9 } @a) { DB1 main::(perldb_demo.pl:6): if (0 scalar grep { $_ == 9 } @a) { DB1 main::(perldb_demo.pl:6): if (0 scalar grep { $_ == 9 } @a) { DB1 main::(perldb_demo.pl:6): if (0 scalar grep { $_ == 9 } @a) { DB1 main::(perldb_demo.pl:6): if (0 scalar grep { $_ == 9 } @a) { DB1 main::(perldb_demo.pl:6): if (0 scalar grep { $_ == 9 } @a) { DB1 main::(perldb_demo.pl:6): if (0 scalar grep { $_ == 9 } @a) { DB1 main::(perldb_demo.pl:6): if (0 scalar grep { $_ == 9 } @a) { DB1 main::(perldb_demo.pl:6): if (0 scalar grep { $_ == 9 } @a) { DB1 main::(perldb_demo.pl:7): print found\n; I would like to use main::(perldb_demo.pl:4): my @a = (1..10); DB1 N main::(perldb_demo.pl:6): if (0 scalar grep { $_ == 9 } @a) { DB1 main::(perldb_demo.pl:7): print found\n; How could that be done? I could imagine $DB::single can be set to 3 for this 'accelerated' stepping. May I reserve the capital N for that command? Thanks, Heiko --