]> granicus.if.org Git - vim/commitdiff
patch 8.1.1977: terminal debugger plugin may hang v8.1.1977
authorBram Moolenaar <Bram@vim.org>
Wed, 4 Sep 2019 12:24:24 +0000 (14:24 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 4 Sep 2019 12:24:24 +0000 (14:24 +0200)
Problem:    Terminal debugger plugin may hang.
Solution:   Wait longer when still reading symbols.

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

index 6a149843f9812646d78eda489abb5d7bfaf5588d..26a0ebdaea398d4c1a624eacb587fedab916e86b 100644 (file)
@@ -225,10 +225,12 @@ func s:StartDebug_term(dict)
     endif
 
     let response = ''
-    for lnum in range(1,200)
-      if term_getline(s:gdbbuf, lnum) =~ 'new-ui mi '
+    for lnum in range(1, 200)
+      let line1 = term_getline(s:gdbbuf, lnum)
+      let line2 = term_getline(s:gdbbuf, lnum + 1)
+      if line1 =~ 'new-ui mi '
         " response can be in the same line or the next line
-        let response = term_getline(s:gdbbuf, lnum) . term_getline(s:gdbbuf, lnum + 1)
+        let response = line1 . line2
         if response =~ 'Undefined command'
           echoerr 'Sorry, your gdb is too old, gdb 7.12 is required'
          call s:CloseBuffers()
@@ -238,10 +240,9 @@ func s:StartDebug_term(dict)
           " Success!
           break
         endif
-        if response =~ 'Reading symbols from' && response !~ 'new-ui'
-          " Reading symbols might take a while
-         let try_count -= 1
-        endif
+      elseif line1 =~ 'Reading symbols from' && line2 !~ 'new-ui mi '
+       " Reading symbols might take a while, try more times
+       let try_count -= 1
       endif
     endfor
     if response =~ 'New UI allocated'
index 9286ec8c57d6fbd32f1219e0eef529f3b7db34e9..9481a3d6b64fb2a4c244d603ac1c5225a6e39c1e 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1977,
 /**/
     1976,
 /**/