]> granicus.if.org Git - vim/commitdiff
patch 8.1.0093: non-MS-Windows: Cannot interrupt gdb when program is running v8.1.0093
authorBram Moolenaar <Bram@vim.org>
Thu, 21 Jun 2018 18:31:14 +0000 (20:31 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 21 Jun 2018 18:31:14 +0000 (20:31 +0200)
Problem:    non-MS-Windows: Cannot interrupt gdb when program is running.
Solution:   Only use debugbreak() on MS-Windows.

runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
src/version.c

index d837acd8cbcc4667a64347860e11a6ddcae34e17..b6d9ac5b8ae3cfb80a7d0ac266284c5f70b80173 100644 (file)
@@ -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
 
index 80a3c2cbde8098c8d20791998ea556d0df816393..b821423eaed04434f237847f733a76b5d64a0f90 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    93,
 /**/
     92,
 /**/