Mailing List Archive

Implement debugger command to skip expression execution
Hello Perl5-porters,

1. Here is a problem
Time to time while debugging I want to skip function execution without restarting application.

line 1: some_code();
line 2: # I reach function I do not want to be called:
line 3: this_should_not_be_called();
line 4: next


2. Here is the syntax that I'm proposing
Would be very helpful if I could run some 'goto line4' command to skip expression execution at line 3.

3. Here are the benefits of this
This will save huge of time, becaue I will not stop debugging, comment out line 3 and start application and debugging from begining.

4. Here are potential problems
None.

Thanks.
--
Best regards,
Eugen Konkov
Re: Implement debugger command to skip expression execution [ In reply to ]
On Mon, 10 Apr 2023 21:28:59 +0200, Eugen Konkov <e@konkov.top> wrote:

> 1. Here is a problem
> Time to time while debugging I want to skip function execution without restarting application.
>
> line 1: some_code();
> line 2: # I reach function I do not want to be called:
> line 3: this_should_not_be_called();
> line 4: next
>
> 2. Here is the syntax that I'm proposing
> Would be very helpful if I could run some 'goto line4' command to skip expression execution at line 3.

Please check these out. :)

https://perldoc.perl.org/perldebug#b-%5Bline%5D-%5Bcondition%5D

https://perldoc.perl.org/perldebug#b-%5Bfile%5D:%5Bline%5D-%5Bcondition%5D

--
With regards,
Christian Walde
Re: Implement debugger command to skip expression execution [ In reply to ]
Doesn't that just break at that line if the condition is true, not actually
skip the line?

I was looking through the POD and I didn't find anything that would help
the OP with that exact request.

Avery

On Tue, 11 Apr 2023 at 21:09, Christian Walde <walde.christian@gmail.com>
wrote:

> On Mon, 10 Apr 2023 21:28:59 +0200, Eugen Konkov <e@konkov.top> wrote:
>
> > 1. Here is a problem
> > Time to time while debugging I want to skip function execution without
> restarting application.
> >
> > line 1: some_code();
> > line 2: # I reach function I do not want to be called:
> > line 3: this_should_not_be_called();
> > line 4: next
> >
> > 2. Here is the syntax that I'm proposing
> > Would be very helpful if I could run some 'goto line4' command to skip
> expression execution at line 3.
>
> Please check these out. :)
>
> https://perldoc.perl.org/perldebug#b-%5Bline%5D-%5Bcondition%5D
>
> https://perldoc.perl.org/perldebug#b-%5Bfile%5D:%5Bline%5D-%5Bcondition%5D
>
> --
> With regards,
> Christian Walde
>
Re: Implement debugger command to skip expression execution [ In reply to ]
On Tue, 11 Apr 2023 13:25:47 +0200, Avery Adams <oldtechaa@gmail.com> wrote:

> Doesn't that just break at that line if the condition is true, not actually skip the line?
>
> I was looking through the POD and I didn't find anything that would help the OP with that exact request.
>
> Avery
>
> On Tue, 11 Apr 2023 at 21:09, Christian Walde <walde.christian@gmail.com> wrote:
>> On Mon, 10 Apr 2023 21:28:59 +0200, Eugen Konkov <e@konkov.top> wrote:
>>
>>> 1. Here is a problem
>>> Time to time while debugging I want to skip function execution without restarting application.
>>>
>>> line 1: some_code();
>>> line 2: # I reach function I do not want to be called:
>>> line 3: this_should_not_be_called();
>>> line 4: next
>>>
>>> 2. Here is the syntax that I'm proposing
>>> Would be very helpful if I could run some 'goto line4' command to skip expression execution at line 3.
>>
>> Please check these out. :)
>>
>> https://perldoc.perl.org/perldebug#b-%5Bline%5D-%5Bcondition%5D
>>
>> https://perldoc.perl.org/perldebug#b-%5Bfile%5D:%5Bline%5D-%5Bcondition%5D

You're right. I misunderstood it as asking to "skip over" in terms of debug flow. Those commands do indeed not help there.

--
With regards,
Christian Walde