aboutsummaryrefslogtreecommitdiff
path: root/runtime/pack/dist/opt/termdebug/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/pack/dist/opt/termdebug/plugin')
-rw-r--r--runtime/pack/dist/opt/termdebug/plugin/termdebug.vim12
1 files changed, 9 insertions, 3 deletions
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index a97461ad69..b9fc77dc37 100644
--- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
+++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
@@ -67,8 +67,8 @@ command -nargs=* -complete=file -bang Termdebug call s:StartDebug(<bang>0, <f-ar
command -nargs=+ -complete=file -bang TermdebugCommand call s:StartDebugCommand(<bang>0, <f-args>)
" Name of the gdb command, defaults to "gdb".
-if !exists('termdebugger')
- let termdebugger = 'gdb'
+if !exists('g:termdebugger')
+ let g:termdebugger = 'gdb'
endif
let s:pc_id = 12
@@ -106,9 +106,14 @@ endfunc
func s:StartDebug_internal(dict)
if exists('s:gdbwin')
- echoerr 'Terminal debugger already running'
+ echoerr 'Terminal debugger already running, cannot run two'
return
endif
+ if !executable(g:termdebugger)
+ echoerr 'Cannot execute debugger program "' .. g:termdebugger .. '"'
+ return
+ endif
+
let s:ptywin = 0
let s:pid = 0
@@ -578,6 +583,7 @@ func s:HandleEvaluate(msg)
endif
let s:evalFromBalloonExprResult = split(s:evalFromBalloonExprResult, '\\n')
call s:OpenHoverPreview(s:evalFromBalloonExprResult, v:null)
+ let s:evalFromBalloonExprResult = ''
else
echomsg '"' . s:evalexpr . '": ' . value
endif