Mercurial > vim
comparison runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @ 18217:40344f717010 v8.1.2103
patch 8.1.2103: wrong error message if "termdebugger" is not executable
Commit: https://github.com/vim/vim/commit/18223a592efa4399e3951c86deeb712a13b05ca5
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Sep 30 20:47:54 2019 +0200
patch 8.1.2103: wrong error message if "termdebugger" is not executable
Problem: wrong error message if "termdebugger" is not executable.
Solution: Check if "termdebugger" is executable and give a clear error
message. (Ozaki Kiichi, closes #5000) Fix indents.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 30 Sep 2019 21:00:04 +0200 |
parents | 1e5672da6a69 |
children | 82a28df1e2d5 |
comparison
equal
deleted
inserted
replaced
18216:e485ef959f1d | 18217:40344f717010 |
---|---|
63 " To end type "quit" in the gdb window. | 63 " To end type "quit" in the gdb window. |
64 command -nargs=* -complete=file -bang Termdebug call s:StartDebug(<bang>0, <f-args>) | 64 command -nargs=* -complete=file -bang Termdebug call s:StartDebug(<bang>0, <f-args>) |
65 command -nargs=+ -complete=file -bang TermdebugCommand call s:StartDebugCommand(<bang>0, <f-args>) | 65 command -nargs=+ -complete=file -bang TermdebugCommand call s:StartDebugCommand(<bang>0, <f-args>) |
66 | 66 |
67 " Name of the gdb command, defaults to "gdb". | 67 " Name of the gdb command, defaults to "gdb". |
68 if !exists('termdebugger') | 68 if !exists('g:termdebugger') |
69 let termdebugger = 'gdb' | 69 let g:termdebugger = 'gdb' |
70 endif | 70 endif |
71 | 71 |
72 let s:pc_id = 12 | 72 let s:pc_id = 12 |
73 let s:break_id = 13 " breakpoint number is added to this | 73 let s:break_id = 13 " breakpoint number is added to this |
74 let s:stopped = 1 | 74 let s:stopped = 1 |
102 call s:StartDebug_internal({'gdb_args': [a:1], 'proc_args': a:000[1:], 'bang': a:bang}) | 102 call s:StartDebug_internal({'gdb_args': [a:1], 'proc_args': a:000[1:], 'bang': a:bang}) |
103 endfunc | 103 endfunc |
104 | 104 |
105 func s:StartDebug_internal(dict) | 105 func s:StartDebug_internal(dict) |
106 if exists('s:gdbwin') | 106 if exists('s:gdbwin') |
107 echoerr 'Terminal debugger already running' | 107 echoerr 'Terminal debugger already running, cannot run two' |
108 return | 108 return |
109 endif | 109 endif |
110 if !executable(g:termdebugger) | |
111 echoerr 'Cannot execute debugger program "' .. g:termdebugger .. '"' | |
112 return | |
113 endif | |
114 | |
110 let s:ptywin = 0 | 115 let s:ptywin = 0 |
111 let s:pid = 0 | 116 let s:pid = 0 |
112 | 117 |
113 " Uncomment this line to write logging in "debuglog". | 118 " Uncomment this line to write logging in "debuglog". |
114 " call ch_logfile('debuglog', 'w') | 119 " call ch_logfile('debuglog', 'w') |