0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.1.1977: terminal debugger plugin may hang

Problem:    Terminal debugger plugin may hang.
Solution:   Wait longer when still reading symbols.
This commit is contained in:
Bram Moolenaar
2019-09-04 14:24:24 +02:00
parent 2b43f7f9f4
commit 19c8fe1925
2 changed files with 10 additions and 7 deletions

View File

@@ -225,10 +225,12 @@ func s:StartDebug_term(dict)
endif endif
let response = '' let response = ''
for lnum in range(1,200) for lnum in range(1, 200)
if term_getline(s:gdbbuf, lnum) =~ 'new-ui mi ' 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 " 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' if response =~ 'Undefined command'
echoerr 'Sorry, your gdb is too old, gdb 7.12 is required' echoerr 'Sorry, your gdb is too old, gdb 7.12 is required'
call s:CloseBuffers() call s:CloseBuffers()
@@ -238,11 +240,10 @@ func s:StartDebug_term(dict)
" Success! " Success!
break break
endif endif
if response =~ 'Reading symbols from' && response !~ 'new-ui' elseif line1 =~ 'Reading symbols from' && line2 !~ 'new-ui mi '
" Reading symbols might take a while " Reading symbols might take a while, try more times
let try_count -= 1 let try_count -= 1
endif endif
endif
endfor endfor
if response =~ 'New UI allocated' if response =~ 'New UI allocated'
break break

View File

@@ -761,6 +761,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1977,
/**/ /**/
1976, 1976,
/**/ /**/