Hi Bram and developers,
How to reproduce:
- Prepare ~/.gdbinit with the following contents. (Either one of them can be
reproduced)
winheight src 24
focus cmd
- Change directory to your vim/src.
$ cd /path/to/vim/src
- Run Vim with some options.
$ vim --clean +"packadd termdebug"
- Start terminal-debugger Vim myself.
:Termdebug vim
Expected behavior:
No errors.
Actual behavior:
The following error occurs.
--------8<--------
Error detected while processing function
<SNR>25_StartDebug[2]..<SNR>25_StartDeb
ug_internal[36]..<SNR>25_StartDebug_term:
line 83:
Cannot check if your gdb works, continuing anyway
-------->8--------
Investigation result:
- Normally, "New UI allocated" is displayed on the line next to "new-ui mi",
but in this case it is displayed on the same line as "new-ui mi".
I think that suppression of ~/.gdbinit execution by specifying the -n option to
gdb is not make sense.
How about with the attached patch?
I made a response check with the same line as the 'new-ui mi' and the next line.
--
Best regards,
Hirohito Higashi (h_east)
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index 1bea8f554..819bee631 100644
--- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
+++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
@@ -197,17 +197,19 @@ func s:StartDebug_term(dict)
let response = ''
for lnum in range(1,200)
if term_getline(s:gdbbuf, lnum) =~ 'new-ui mi '
- let response = term_getline(s:gdbbuf, lnum + 1)
- if response =~ 'Undefined command'
- echoerr 'Sorry, your gdb is too old, gdb 7.12 is required'
- exe 'bwipe! ' . s:ptybuf
- exe 'bwipe! ' . s:commbuf
- return
- endif
- if response =~ 'New UI allocated'
- " Success!
- break
- endif
+ for line in [lnum, lnum+1]
+ let response = term_getline(s:gdbbuf, line)
+ if response =~ 'Undefined command'
+ echoerr 'Sorry, your gdb is too old, gdb 7.12 is required'
+ exe 'bwipe! ' . s:ptybuf
+ exe 'bwipe! ' . s:commbuf
+ return
+ endif
+ if response =~ 'New UI allocated'
+ " Success!
+ break
+ endif
+ endfor
endif
endfor
if response =~ 'New UI allocated'