diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-12-24 13:18:38 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-12-24 13:18:38 +0000 |
commit | fa3b72348d88343390fbe212cfc230fec1602fc2 (patch) | |
tree | c0f27c44f2819613a4288bfc6ebc5c58f421d90d /runtime/pack/dist/opt/termdebug | |
parent | d3f00f54bf955bd01767db3a0af25866bc112ec7 (diff) |
Update runtime files
Diffstat (limited to 'runtime/pack/dist/opt/termdebug')
-rw-r--r-- | runtime/pack/dist/opt/termdebug/plugin/termdebug.vim | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index 2dead80aeb..76836d6c29 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -98,6 +98,10 @@ call s:Highlight(1, '', &background) hi default debugBreakpoint term=reverse ctermbg=red guibg=red hi default debugBreakpointDisabled term=reverse ctermbg=gray guibg=gray +func s:GetCommand() + return type(g:termdebugger) == v:t_list ? copy(g:termdebugger) : [g:termdebugger] +endfunc + func s:StartDebug(bang, ...) " First argument is the command to debug, second core file or process ID. call s:StartDebug_internal({'gdb_args': a:000, 'bang': a:bang}) @@ -113,8 +117,9 @@ func s:StartDebug_internal(dict) echoerr 'Terminal debugger already running, cannot run two' return endif - if !executable(g:termdebugger) - echoerr 'Cannot execute debugger program "' .. g:termdebugger .. '"' + let gdbcmd = s:GetCommand() + if !executable(gdbcmd[0]) + echoerr 'Cannot execute debugger program "' .. gdbcmd[0] .. '"' return endif @@ -188,7 +193,7 @@ endfunc func s:CheckGdbRunning() let gdbproc = term_getjob(s:gdbbuf) if gdbproc == v:null || job_status(gdbproc) !=# 'run' - echoerr string(g:termdebugger) . ' exited unexpectedly' + echoerr string(s:GetCommand()[0]) . ' exited unexpectedly' call s:CloseBuffers() return '' endif @@ -233,7 +238,7 @@ func s:StartDebug_term(dict) let gdb_args = get(a:dict, 'gdb_args', []) let proc_args = get(a:dict, 'proc_args', []) - let gdb_cmd = [g:termdebugger] + let gdb_cmd = s:GetCommand() " Add -quiet to avoid the intro message causing a hit-enter prompt. let gdb_cmd += ['-quiet'] " Disable pagination, it causes everything to stop at the gdb @@ -364,7 +369,7 @@ func s:StartDebug_prompt(dict) let gdb_args = get(a:dict, 'gdb_args', []) let proc_args = get(a:dict, 'proc_args', []) - let gdb_cmd = [g:termdebugger] + let gdb_cmd = s:GetCommand() " Add -quiet to avoid the intro message causing a hit-enter prompt. let gdb_cmd += ['-quiet'] " Disable pagination, it causes everything to stop at the gdb, needs to be run early |