Mercurial > vim
comparison runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @ 17962:58bebe21f0ef v8.1.1977
patch 8.1.1977: terminal debugger plugin may hang
Commit: https://github.com/vim/vim/commit/19c8fe1925f4f7ffa1cc46e64d8bb8b1665ac437
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 4 14:24:24 2019 +0200
patch 8.1.1977: terminal debugger plugin may hang
Problem: Terminal debugger plugin may hang.
Solution: Wait longer when still reading symbols.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 04 Sep 2019 14:30:03 +0200 |
parents | cc953757ed2a |
children | 1e5672da6a69 |
comparison
equal
deleted
inserted
replaced
17961:aa9b5f329f97 | 17962:58bebe21f0ef |
---|---|
223 call s:CloseBuffers() | 223 call s:CloseBuffers() |
224 return | 224 return |
225 endif | 225 endif |
226 | 226 |
227 let response = '' | 227 let response = '' |
228 for lnum in range(1,200) | 228 for lnum in range(1, 200) |
229 if term_getline(s:gdbbuf, lnum) =~ 'new-ui mi ' | 229 let line1 = term_getline(s:gdbbuf, lnum) |
230 let line2 = term_getline(s:gdbbuf, lnum + 1) | |
231 if line1 =~ 'new-ui mi ' | |
230 " response can be in the same line or the next line | 232 " response can be in the same line or the next line |
231 let response = term_getline(s:gdbbuf, lnum) . term_getline(s:gdbbuf, lnum + 1) | 233 let response = line1 . line2 |
232 if response =~ 'Undefined command' | 234 if response =~ 'Undefined command' |
233 echoerr 'Sorry, your gdb is too old, gdb 7.12 is required' | 235 echoerr 'Sorry, your gdb is too old, gdb 7.12 is required' |
234 call s:CloseBuffers() | 236 call s:CloseBuffers() |
235 return | 237 return |
236 endif | 238 endif |
237 if response =~ 'New UI allocated' | 239 if response =~ 'New UI allocated' |
238 " Success! | 240 " Success! |
239 break | 241 break |
240 endif | 242 endif |
241 if response =~ 'Reading symbols from' && response !~ 'new-ui' | 243 elseif line1 =~ 'Reading symbols from' && line2 !~ 'new-ui mi ' |
242 " Reading symbols might take a while | 244 " Reading symbols might take a while, try more times |
243 let try_count -= 1 | 245 let try_count -= 1 |
244 endif | |
245 endif | 246 endif |
246 endfor | 247 endfor |
247 if response =~ 'New UI allocated' | 248 if response =~ 'New UI allocated' |
248 break | 249 break |
249 endif | 250 endif |