diff options
| author | erw7 <erw7.github@gmail.com> | 2019-05-25 11:14:35 +0900 |
|---|---|---|
| committer | erw7 <erw7.github@gmail.com> | 2020-02-12 16:03:45 +0900 |
| commit | aec3d7915c55fc0b7dc73f6186cf0ae45d416d33 (patch) | |
| tree | 54d83b901dd4b31126b0cb250b84a062a61c086e /runtime/pack/dist/opt/termdebug/plugin | |
| parent | b015c4741caef37b3f89661e1d5d6a4a033b2856 (diff) | |
| download | rneovim-aec3d7915c55fc0b7dc73f6186cf0ae45d416d33.tar.gz rneovim-aec3d7915c55fc0b7dc73f6186cf0ae45d416d33.tar.bz2 rneovim-aec3d7915c55fc0b7dc73f6186cf0ae45d416d33.zip | |
vim-patch:8.1.0091: MS-Windows: Cannot interrupt gdb when program is running
Problem: MS-Windows: Cannot interrupt gdb when program is running.
Solution: Add debugbreak() and use it in the terminal debugger.
Respect 'modified' in a prompt buffer.
https://github.com/vim/vim/commit/4551c0a9fcdbdef52836d4852686d54b5e47fdaf
Diffstat (limited to 'runtime/pack/dist/opt/termdebug/plugin')
| -rw-r--r-- | runtime/pack/dist/opt/termdebug/plugin/termdebug.vim | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index 63c167d79a..aa2b69ad97 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -462,10 +462,16 @@ func s:PromptCallback(text) call s:SendCommand(a:text) endfunc -" Function called when pressing CTRL-C in the prompt buffer. +" Function called when pressing CTRL-C in the prompt buffer and when placing a +" breakpoint. func s:PromptInterrupt() - "call ch_log('Interrupting gdb') - call system('kill -SIGINT ' . s:pid) + if s:pid == 0 + echoerr 'Cannot interrupt gdb, did not find a process ID' + else + "call ch_log('Interrupting gdb') + " Using job_stop(s:gdbjob, 'int') does not work. + call debugbreak(s:pid) + endif endfunc " Function called when gdb outputs text. @@ -691,7 +697,11 @@ func s:SetBreakpoint() let do_continue = 0 if !s:stopped let do_continue = 1 - call s:SendCommand('-exec-interrupt') + if s:way == 'prompt' + call s:PromptInterrupt() + else + call s:SendCommand('-exec-interrupt') + endif sleep 10m endif " Use the fname:lnum format, older gdb can't handle --source. |