Yeah, thanks!

If eval_variable (via lookup_debug_var) or similar would return function args 
for def functions, then that would be pretty neat and we can watch and inspect 
them. 

For my side I would need to add a list of locals and script vars for vim9 
script contexts (for the scopes window) and fix up the stack trace (which 
contains the <SNR> literally at the moment).

For breakpoints, I haven’t looked at that yet, but it think that would be the 
next thing. For legacy vim script I modified the way breakpoints are triggered 
such that a line breakpoint within the body of a function triggers both when 
defining the function _and_ when executing it the function (this allows setting 
line breakpoints within function bodies); for this I use 
dbg_find_breakpoint_in_func (here: 
https://github.com/puremourning/vim/blob/debugger/src/debugger.c#L954). 

I’d probably look to do the same for def functions. Something like calling  
dbg_find_breakpoint_in_func from the ISN_DEBUG handler, though I only looked at 
it really really briefly.

The remaining thing would be whether or not we can support arbitrary execution 
of def functions while debugging, e.g. to print the return of some def function 
call.

> On 15 Jun 2021, at 11:36, Bram Moolenaar <[email protected]> wrote:
> 
> 
>> Waking up this thread, just to say that this is still work in progress. I 
>> actually use it quite often for my own debugging, but I'm holding off on 
>> patches for now while vim9script develops. I think it makes logical sense 
>> for this all to happen after vim9script is mature.
>> 
>> But as a teaser, I noticed that Bram added support for debugging vim9script 
>> statements yesterday, and so I've hooked that in to my prototype. So here's 
>> a demo of Vimspector debugging a simple vim9 script:
>> 
>> https://asciinema.org/a/25SLL99WepcubhweLoQblz2Cg
>> 
>> Lots more to do on this, but now the framework is in place.
> 
> I'm glad the Vim9 debugger features work for you.  I plan to add the
> possibility to inspect function arguments next.  Not sure if I add more
> now, it should be sufficient for basic debugging.  Perhaps we need
> to be able setting a breakpoint?
> 
> -- 
> You can test a person's importance in the organization by asking how much RAM
> his computer has.  Anybody who knows the answer to that question is not a
> decision-maker.
>                               (Scott Adams - The Dilbert principle)
> 
> /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
> ///                                                                      \\\
> \\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
> \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/98FF2DF1-F968-4CE3-A561-C9264E7F3319%40gmail.com.

Raspunde prin e-mail lui