On Sat, Jan 31, 2015 at 09:24:26PM +0100, Christian Brabandt wrote:
> Hi Bram!
> 
> On Sa, 31 Jan 2015, Bram Moolenaar wrote:
> 
> > 
> > Christian Brabandt wrote:
> > 
> > > Bram,
> > > Charles asked me, if I could extend the vim debugger and add a watch 
> > > feature, so it would be easier for him to debug netrw issues.
> > > 
> > > So here is the patch:
> > > https://github.com/chrisbra/vim-mq-patches/blob/master/watchexpr
> > > 
> > > As far as I know, Charles has already tested it successfully.
> > > Test suite is run successfully
> > 
> > Thanks, this sounds really useful!
> > 
> > It's not quite clear to me how this works:
> > 
> > :breaka[dd] expr {string}
> >             Sets a breakpoint, that will break whenever the {string}
> >             evaluates to true. Example: >
> >                     :breakadd expr g:lnum
> > 
> > However, g:lnum is always true (non-zero).
> > 
> > Looking at the implementation, it seems that the previous value of
> > g:lnum is stored and the break happens when the value changes.
> 
> Yes, that is what happens.

That sounds like typical behavior for a watch expression on a variable.

> > Perhaps you can add a few more examples.  I would think it's also very
> > useful to check the result of any expression.   e.g.:
> > 
> >     breakadd expr &tabstop == 4
> > 
> > Which would break just after 'tabstop' was set to 4 or to another value.
> > Obviously this would be slow, evaluating the expression very many times,
> > but manually finding this spot is much slower.

This pattern I've usually seen used for a break at a specific place.
That is, something like "breakadd file 43 .vimrc &tabstop == 4" would
mean "Break on line 43 of .vimrc only if &tabstop is 4".

That being said, both capabilities have their uses and would be handy
additions.

Cheers,
-- 
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <[email protected]>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui