diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-09-04 14:24:24 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-09-04 14:24:24 +0200 |
commit | 19c8fe1925f4f7ffa1cc46e64d8bb8b1665ac437 (patch) | |
tree | f9fb7f6c6a8613f36493013e0524a3f09d4588a8 /runtime/pack | |
parent | 2b43f7f9f482b845916d308ec4a9dff2ad20e3ec (diff) | |
download | vim-git-19c8fe1925f4f7ffa1cc46e64d8bb8b1665ac437.tar.gz |
patch 8.1.1977: terminal debugger plugin may hangv8.1.1977
Problem: Terminal debugger plugin may hang.
Solution: Wait longer when still reading symbols.
Diffstat (limited to 'runtime/pack')
-rw-r--r-- | runtime/pack/dist/opt/termdebug/plugin/termdebug.vim | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index 6a149843f..26a0ebdae 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -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' |