On Do, 15 Mär 2018, Christian Brabandt wrote:
> On Do, 15 Mär 2018, M Kelly wrote:
> > GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
> This needs a gdb 7.12

How about the following patch:
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim 
b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index 65765bb31..086a8df69 100644
--- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
+++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
@@ -43,7 +43,26 @@ else
 endif
 hi default debugBreakpoint term=reverse ctermbg=red guibg=red

+func s:IsGDBSupported()
+  " return true, if at least version 7.12
+  " parse gdb --version output (this is ugly!)
+  " Hopefully, gdb --version always returns something like:
+  " GNU gdb (Debian 7.12-6+b1) 7.12.0.20161007-git
+  let gdb_version = systemlist('gdb --version')[0]
+  if v:shell_error
+    return 0
+  endif
+  let gdb_version = matchstr(gdb_version, '.*) \zs.*')
+  let gdb_version = join(split(gdb_version, '\.')[0:1], '') + 0
+  return gdb_version >= 712
+endfunc
+
 func s:StartDebug(cmd)
+  if !s:IsGDBSupported()
+    echoerr 'GDB Version too old or not installed. Need at least gdb 7.12'
+    return
+  endif
+
   let s:startwin = win_getid(winnr())
   let s:startsigncolumn = &signcolumn


Best,
Christian
-- 
Es gibt keinen zuverlässigeren Beweis von Geistesgröße, als wenn man
sich durch nichts, was begegnen kann, in Aufruhr bringen läßt.
                -- Lucius Annaeus Seneca (4-65 n.Chr.)

-- 
-- 
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.

Raspunde prin e-mail lui