forked from aniani/vim
runtime(termdebug: Fix errors in using the latest termdebug.vim
closes: #14941 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
9c4389acc3
commit
03a3df15ca
@@ -618,6 +618,27 @@ def SendCommand(cmd: string)
|
|||||||
endif
|
endif
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
|
# Interrupt or stop the program
|
||||||
|
def StopCommand()
|
||||||
|
if way == 'prompt'
|
||||||
|
PromptInterrupt()
|
||||||
|
else
|
||||||
|
SendCommand('-exec-interrupt')
|
||||||
|
endif
|
||||||
|
enddef
|
||||||
|
|
||||||
|
# Continue the program
|
||||||
|
def ContinueCommand()
|
||||||
|
if way == 'prompt'
|
||||||
|
SendCommand('continue')
|
||||||
|
else
|
||||||
|
# using -exec-continue results in CTRL-C in the gdb window not working,
|
||||||
|
# communicating via commbuf (= use of SendCommand) has the same result
|
||||||
|
SendCommand('-exec-continue')
|
||||||
|
# command Continue term_sendkeys(gdbbuf, "continue\r")
|
||||||
|
endif
|
||||||
|
enddef
|
||||||
|
|
||||||
# This is global so that a user can create their mappings with this.
|
# This is global so that a user can create their mappings with this.
|
||||||
def TermDebugSendCommand(cmd: string)
|
def TermDebugSendCommand(cmd: string)
|
||||||
if way == 'prompt'
|
if way == 'prompt'
|
||||||
@@ -626,13 +647,13 @@ def TermDebugSendCommand(cmd: string)
|
|||||||
var do_continue = 0
|
var do_continue = 0
|
||||||
if !stopped
|
if !stopped
|
||||||
do_continue = 1
|
do_continue = 1
|
||||||
Stop
|
StopCommand()
|
||||||
sleep 10m
|
sleep 10m
|
||||||
endif
|
endif
|
||||||
# TODO: should we prepend CTRL-U to clear the command?
|
# TODO: should we prepend CTRL-U to clear the command?
|
||||||
term_sendkeys(gdbbuf, cmd .. "\r")
|
term_sendkeys(gdbbuf, cmd .. "\r")
|
||||||
if do_continue
|
if do_continue
|
||||||
Continue
|
ContinueCommand()
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
enddef
|
enddef
|
||||||
@@ -1037,17 +1058,8 @@ def InstallCommands()
|
|||||||
command Finish SendResumingCommand('-exec-finish')
|
command Finish SendResumingCommand('-exec-finish')
|
||||||
command -nargs=* Run Run(<q-args>)
|
command -nargs=* Run Run(<q-args>)
|
||||||
command -nargs=* Arguments SendResumingCommand('-exec-arguments ' .. <q-args>)
|
command -nargs=* Arguments SendResumingCommand('-exec-arguments ' .. <q-args>)
|
||||||
|
command Stop StopCommand()
|
||||||
if way == 'prompt'
|
command Continue ContinueCommand()
|
||||||
command Stop PromptInterrupt()
|
|
||||||
command Continue SendCommand('continue')
|
|
||||||
else
|
|
||||||
command Stop SendCommand('-exec-interrupt')
|
|
||||||
# using -exec-continue results in CTRL-C in the gdb window not working,
|
|
||||||
# communicating via commbuf (= use of SendCommand) has the same result
|
|
||||||
command Continue SendCommand('-exec-continue')
|
|
||||||
# command Continue term_sendkeys(gdbbuf, "continue\r")
|
|
||||||
endif
|
|
||||||
|
|
||||||
command -nargs=* Frame Frame(<q-args>)
|
command -nargs=* Frame Frame(<q-args>)
|
||||||
command -count=1 Up Up(<count>)
|
command -count=1 Up Up(<count>)
|
||||||
@@ -1211,11 +1223,15 @@ def DeleteCommands()
|
|||||||
if exists('saved_mousemodel')
|
if exists('saved_mousemodel')
|
||||||
&mousemodel = saved_mousemodel
|
&mousemodel = saved_mousemodel
|
||||||
saved_mousemodel = null_string
|
saved_mousemodel = null_string
|
||||||
|
try
|
||||||
aunmenu PopUp.-SEP3-
|
aunmenu PopUp.-SEP3-
|
||||||
aunmenu PopUp.Set\ breakpoint
|
aunmenu PopUp.Set\ breakpoint
|
||||||
aunmenu PopUp.Clear\ breakpoint
|
aunmenu PopUp.Clear\ breakpoint
|
||||||
aunmenu PopUp.Run\ until
|
aunmenu PopUp.Run\ until
|
||||||
aunmenu PopUp.Evaluate
|
aunmenu PopUp.Evaluate
|
||||||
|
catch
|
||||||
|
# ignore any errors in removing the PopUp menu
|
||||||
|
endtry
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -1253,7 +1269,7 @@ def SetBreakpoint(at: string, tbreak=false)
|
|||||||
var do_continue = 0
|
var do_continue = 0
|
||||||
if !stopped
|
if !stopped
|
||||||
do_continue = 1
|
do_continue = 1
|
||||||
Stop
|
StopCommand()
|
||||||
sleep 10m
|
sleep 10m
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -1270,7 +1286,7 @@ def SetBreakpoint(at: string, tbreak=false)
|
|||||||
# echom "cmsd: " .. cmd
|
# echom "cmsd: " .. cmd
|
||||||
SendCommand(cmd)
|
SendCommand(cmd)
|
||||||
if do_continue
|
if do_continue
|
||||||
Continue
|
ContinueCommand()
|
||||||
endif
|
endif
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user