vim-patch:8.1.1977: terminal debugger plugin may hang

Problem:    Terminal debugger plugin may hang.
Solution:   Wait longer when still reading symbols.
19c8fe1925
This commit is contained in:
Jan Edmund Lazo 2020-06-09 20:53:04 -04:00
parent 33985a3a15
commit 44535d39e9
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15

View File

@ -247,10 +247,12 @@ func s:StartDebug_term(dict)
endif
let response = ''
for lnum in range(1,200)
if len(getbufline(s:gdbbuf, lnum)) > 0 && getbufline(s:gdbbuf, lnum)[0] =~ 'new-ui mi '
for lnum in range(1, 200)
let line1 = get(getbufline(s:gdbbuf, lnum), 0, '')
let line2 = get(getbufline(s:gdbbuf, lnum + 1), 0, '')
if line1 =~ 'new-ui mi '
" response can be in the same line or the next line
let response = getbufline(s:gdbbuf, lnum)[0] . getbufline(s:gdbbuf, lnum + 1)[0]
let response = line1 . line2
if response =~ 'Undefined command'
echoerr 'Sorry, your gdb is too old, gdb 7.12 is required'
call s:CloseBuffers()
@ -260,10 +262,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'