changeset 14151:2404459a8639 v8.1.0093

patch 8.1.0093: non-MS-Windows: Cannot interrupt gdb when program is running commit https://github.com/vim/vim/commit/2ed890f1f810f977ec6a235efd8bf58adddcd0e7 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 21 20:31:14 2018 +0200 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.
author Christian Brabandt <cb@256bit.org>
date Thu, 21 Jun 2018 20:45:06 +0200
parents 0bb74ec4fd20
children b9e6127eafbd
files runtime/pack/dist/opt/termdebug/plugin/termdebug.vim src/version.c
diffstat 2 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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
 
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    93,
+/**/
     92,
 /**/
     91,