diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-06-21 20:31:14 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-06-21 20:31:14 +0200 |
commit | 2ed890f1f810f977ec6a235efd8bf58adddcd0e7 (patch) | |
tree | 3fb87223aca24efea774483513f12805ffc5bd7a /runtime/pack | |
parent | 71ef1ba5e996f34d3e0acbe1d89c4c6bfa5e98ba (diff) | |
download | vim-git-2ed890f1f810f977ec6a235efd8bf58adddcd0e7.tar.gz |
patch 8.1.0093: non-MS-Windows: Cannot interrupt gdb when program is runningv8.1.0093
Problem: non-MS-Windows: Cannot interrupt gdb when program is running.
Solution: Only use debugbreak() on MS-Windows.
Diffstat (limited to 'runtime/pack')
-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 d837acd8c..b6d9ac5b8 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -402,12 +402,17 @@ endfunc " Function called when pressing CTRL-C in the prompt buffer and when placing a " breakpoint. func s:PromptInterrupt() - if s:pid == 0 - echoerr 'Cannot interrupt gdb, did not find a process ID' + call ch_log('Interrupting gdb') + if has('win32') + " Using job_stop() does not work on MS-Windows, need to send SIGTRAP to + " the debugger program so that gdb responds again. + if s:pid == 0 + echoerr 'Cannot interrupt gdb, did not find a process ID' + else + call debugbreak(s:pid) + endif else - call ch_log('Interrupting gdb') - " Using job_stop(s:gdbjob, 'int') does not work. - call debugbreak(s:pid) + call job_stop(s:gdbjob, 'int') endif endfunc |