Reply to message «Re: Debugging numbered functions (or anonymous dictionary 
functions)», 
sent 20:21:22 24 May 2011, Tuesday
by [email protected]:

> > Is there a better way to debug these functions, i.e., like setting a
> > breakpoint on them. The numbers change everytime the functions are
> > sourced, and setting a breakpoint based on a file/linenum seems to be
> > off as well (I'm not sure if that is because of comment lines)
You may always write

    execute 'breakadd func 1 '.string(Fref)[10:-3]
. I guess it will work if you put it into custom command.

Note that you must explicitely specify line number here or will catch E475 
error. I do not know more advanced techniques at this point (though I guess I 
am 
able to create a frawor module that resets breakpoints to new function numbers 
when plugin is reloaded... but, of course, if your plugin uses frawor and you 
use `frawor#Reload()' and not resourcing (which should not work at all due to 
the guard)). It is interesting, but now instead of using reloading I rerun my 
test.zsh script (which recreates test enviroment on each run) with other 
parameters instead of reloading though reloading was initially designed to help 
me to debug plugins. The advantage of clean test enviroment is that if some 
function has number 10 on first run, it will have just the same number on all 
consequent runs unless some function declarations were added before it.

Original message:
> Maybe, vim_dev is a better forum to ask this question:
> 
> Vim help mentions:
> > If you get an error for a numbered function, you can find out what it is
> > with
> > a trick.  Assuming the function is 42, the command is: >
> > 
> >         :function {42}
> > 
> > Is there a better way to debug these functions, i.e., like setting a
> > breakpoint on them. The numbers change everytime the functions are
> > sourced, and setting a breakpoint based on a file/linenum seems to be
> > off as well (I'm not sure if that is because of comment lines)
> > 
> > Any help will be appreciated.
> > 
> > Thanks much!
> > Hari

Attachment: signature.asc
Description: This is a digitally signed message part.

Raspunde prin e-mail lui