Skip to content

Commit

Permalink
patch 8.1.0093: non-MS-Windows: Cannot interrupt gdb when program is …
Browse files Browse the repository at this point in the history
…running

Problem:    non-MS-Windows: Cannot interrupt gdb when program is running.
Solution:   Only use debugbreak() on MS-Windows.
  • Loading branch information
brammool committed Jun 21, 2018
1 parent 71ef1ba commit 2ed890f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 10 additions & 5 deletions runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -761,6 +761,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
93,
/**/
92,
/**/
Expand Down

0 comments on commit 2ed890f

Please sign in to comment.