Skip to content

Commit

Permalink
patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Browse files Browse the repository at this point in the history
Problem:    Vim9: breakpoint in compiled function not always checked.
Solution:   Check for breakpoint when calling compiled function from compiled
            function.
  • Loading branch information
brammool committed Jun 20, 2021
1 parent 4f8f542 commit 2ac4b25
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/testdir/test_debugger.vim
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,22 @@ func Test_debug_DefFunction()
echo "here"
echo "and"
echo "there"
breakadd func 2 LocalFunc
LocalFunc()
enddef

def LocalFunc()
echo "first"
echo "second"
breakadd func 1 LegacyFunc
LegacyFunc()
enddef

func LegacyFunc()
echo "legone"
echo "legtwo"
endfunc

breakadd func 2 g:SomeFunc
END
call writefile(file, 'XtestDebug.vim')
Expand All @@ -949,6 +964,13 @@ func Test_debug_DefFunction()

call RunDbgCmd(buf,':call SomeFunc()', ['line 2: echo "and"'])
call RunDbgCmd(buf,'next', ['line 3: echo "there"'])
call RunDbgCmd(buf,'next', ['line 4: breakadd func 2 LocalFunc'])

" continue, next breakpoint is in LocalFunc()
call RunDbgCmd(buf,'cont', ['line 2: echo "second"'])

" continue, next breakpoint is in LegacyFunc()
call RunDbgCmd(buf,'cont', ['line 1: echo "legone"'])

call RunDbgCmd(buf, 'cont')

Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3027,
/**/
3026,
/**/
Expand Down
3 changes: 3 additions & 0 deletions src/vim9execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ call_dfunc(
}
#endif

// Update uf_has_breakpoint if needed.
update_has_breakpoint(ufunc);

// When debugging and using "cont" switches to the not-debugged
// instructions, may need to still compile them.
if ((func_needs_compiling(ufunc, COMPILE_TYPE(ufunc))
Expand Down

0 comments on commit 2ac4b25

Please sign in to comment.