Skip to content

Commit 2ed890f

Browse files
committed
patch 8.1.0093: non-MS-Windows: Cannot interrupt gdb when program is running
Problem: non-MS-Windows: Cannot interrupt gdb when program is running. Solution: Only use debugbreak() on MS-Windows.
1 parent 71ef1ba commit 2ed890f

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

runtime/pack/dist/opt/termdebug/plugin/termdebug.vim

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -402,12 +402,17 @@ endfunc
402402
" Function called when pressing CTRL-C in the prompt buffer and when placing a
403403
" breakpoint.
404404
func s:PromptInterrupt()
405-
if s:pid == 0
406-
echoerr 'Cannot interrupt gdb, did not find a process ID'
405+
call ch_log('Interrupting gdb')
406+
if has('win32')
407+
" Using job_stop() does not work on MS-Windows, need to send SIGTRAP to
408+
" the debugger program so that gdb responds again.
409+
if s:pid == 0
410+
echoerr 'Cannot interrupt gdb, did not find a process ID'
411+
else
412+
call debugbreak(s:pid)
413+
endif
407414
else
408-
call ch_log('Interrupting gdb')
409-
" Using job_stop(s:gdbjob, 'int') does not work.
410-
call debugbreak(s:pid)
415+
call job_stop(s:gdbjob, 'int')
411416
endif
412417
endfunc
413418

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
93,
764766
/**/
765767
92,
766768
/**/

0 commit comments

Comments
 (0)