Watch expression doesn't work properly

6 views
Skip to first unread message

Yegappan Lakshmanan

unread,
Aug 12, 2020, 10:21:14 PM8/12/20
to vim_dev
Hi,

When a breakpoint is set on an expression, the breakpoint works sometimes
and doesn't work other times. For example, save the following code into
a file and source it:

let g:Count = 0
breakadd expr g:Count
func T()
  let g:Count += 1
endfunc
call T()
call T()
call T()

The breakpoint should be hit three times. But it is hit only twice and if some
other script runs later, then the breakpoint is hit. For example, after sourcing
the above script, try editing a file.

The has_watchexpr() function in debugger.c always returns 0. This problem
may be related to this. I see that in the original patch from Christian, the
debug_expr variable is incremented (https://github.com/vim/vim/pull/859).
in dbg_parsearg(). But in the latest Vim code, this variable is never incremented.

- Yegappan

Reply all
Reply to author
Forward
0 new messages