aboutsummaryrefslogtreecommitdiff
path: root/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2021-12-06 13:55:38 +0100
committerGitHub <noreply@github.com>2021-12-06 13:55:38 +0100
commit0a3826646f9348f9a82b9c8a79efc16dbaf3a21d (patch)
treedd90b4168838e63bd6cc71744092162a8a031c4e /runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
parent523f03b506bf577811c0e136bc852cdb89f92c00 (diff)
downloadrneovim-0a3826646f9348f9a82b9c8a79efc16dbaf3a21d.tar.gz
rneovim-0a3826646f9348f9a82b9c8a79efc16dbaf3a21d.tar.bz2
rneovim-0a3826646f9348f9a82b9c8a79efc16dbaf3a21d.zip
vim-patch:4700398e384f (#16538)
Update runtime files https://github.com/vim/vim/commit/4700398e384f38f752b432e187462f404b96847d partial skip: doc/sign.txt doc/various.txt doc/motion.txt
Diffstat (limited to 'runtime/pack/dist/opt/termdebug/plugin/termdebug.vim')
-rw-r--r--runtime/pack/dist/opt/termdebug/plugin/termdebug.vim25
1 files changed, 15 insertions, 10 deletions
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index 4a58bee8ce..67d91360d8 100644
--- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
+++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
@@ -2,7 +2,7 @@
"
" Author: Bram Moolenaar
" Copyright: Vim license applies, see ":help license"
-" Last Change: 2021 Nov 27
+" Last Change: 2021 Nov 29
"
" WORK IN PROGRESS - Only the basics work
" Note: On MS-Windows you need a recent version of gdb. The one included with
@@ -485,7 +485,7 @@ func s:StartDebugCommon(dict)
" Run the command if the bang attribute was given and got to the debug
" window.
if get(a:dict, 'bang', 0)
- call s:SendCommand('-exec-run')
+ call s:SendResumingCommand('-exec-run')
call win_gotoid(s:ptywin)
endif
endfunc
@@ -524,9 +524,14 @@ func TermDebugSendCommand(cmd)
endif
endfunc
-" Send a command only when stopped. Used for :Next and :Step.
-func s:SendCommandIfStopped(cmd)
+" Send a command that resumes the program. If the program isn't stopped the
+" command is not sent (to avoid a repeated command to cause trouble).
+" If the command is sent then reset s:stopped.
+func s:SendResumingCommand(cmd)
if s:stopped
+ " reset s:stopped here, it may take a bit of time before we get a response
+ let s:stopped = 0
+ " call ch_log('assume that program is running after this command')
call s:SendCommand(a:cmd)
" else
" call ch_log('dropping command, program is running: ' . a:cmd)
@@ -815,11 +820,11 @@ func s:InstallCommands()
command -nargs=? Break call s:SetBreakpoint(<q-args>)
command Clear call s:ClearBreakpoint()
- command Step call s:SendCommandIfStopped('-exec-step')
- command Over call s:SendCommandIfStopped('-exec-next')
- command Finish call s:SendCommandIfStopped('-exec-finish')
+ command Step call s:SendResumingCommand('-exec-step')
+ command Over call s:SendResumingCommand('-exec-next')
+ command Finish call s:SendResumingCommand('-exec-finish')
command -nargs=* Run call s:Run(<q-args>)
- command -nargs=* Arguments call s:SendCommand('-exec-arguments ' . <q-args>)
+ command -nargs=* Arguments call s:SendResumingCommand('-exec-arguments ' . <q-args>)
if s:way == 'prompt'
command Stop call s:PromptInterrupt()
@@ -978,9 +983,9 @@ endfunc
func s:Run(args)
if a:args != ''
- call s:SendCommand('-exec-arguments ' . a:args)
+ call s:SendResumingCommand('-exec-arguments ' . a:args)
endif
- call s:SendCommand('-exec-run')
+ call s:SendResumingCommand('-exec-run')
endfunc
func s:SendEval(expr)