bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] 'watch' in gawk debugger gives wrong NR


From: Aharon Robbins
Subject: Re: [bug-gawk] 'watch' in gawk debugger gives wrong NR
Date: Mon, 23 Nov 2015 21:30:01 +0200
User-agent: Heirloom mailx 12.5 6/20/10

I wrote:

> So far, so good. First record doesn't match, nr has not been assigned
> to, and NR is correct.
>
> | gawk> continue
> | Watchpoint 1: c
> |   Old value: untyped variable
> |   New value: 0
>
> Hmm. This is a little strange. Maybe I need to look at why the
> watchpoint was triggered.

I spent some more time on this.  If you put a statement after the c =
0 in the BEGIN rule, then the watchpoint triggers and prints when you
hit statement.

Here, there's nothing after the c = 0.  The next thing that happens is
the breakpoint on the pattern. The debugger checks for breakpoints before
checking for watchpoints, so it's handled first. Upon the continue,
the watchpoint is checked for and the fact that c changed way back up
in the BEGIN rule is noted and printed.

It's a little weird, but not awful. I will experiment with changing
the order of the checks.

Thanks,

Arnold



reply via email to

[Prev in Thread] Current Thread [Next in Thread]