-"shuber, 2008-06-08
+"pygdb.vim - pygtk interface to gdb in connection with (g)vim
+" Maintainer: Stefan Huber <shuber@cosy.sbg.ac.at>
+
+
+if !has('python')
+ echo "Error: Required vim compiled with +python"
+ finish
+endif
if ! exists("g:pygdb")
execsign = None
def gdbLaunch():
- global gdbBps, clientcmd
+ global gdbBps, clientcmd, pygdbdir
- clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd).strip()
+ clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd)
+
+ #Pressed esq?
+ if clientcmd == None:
+ clientcmd = ""
+ return
+
+ #Strip away white space
+ clientcmd = clientcmd.strip()
if clientcmd.strip()=="":
print "No command given!"
return
- #Add the breakpoints to the configuration
- conf = Configuration.Configuration()
- conf.load(".pygdb.conf")
- conf.breakpoints = []
- for bp in gdbBps:
- conf.addBreak(bp["file"], bp["lineno"], bp["cond"])
- conf.store(".pygdb.conf")
+ gdbWriteConfig()
vim.command("!python %s/pygdb.py --vim-servername %s %s &\n" % (pygdbdir, vim.eval("v:servername"), clientcmd))
#We need the client command to expand the paths...
while clientcmd == "" or not cmdset:
- clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd).strip()
+ clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd)
+
+ if clientcmd == None:
+ clientcmd = ""
+ clientcmd = clientcmd.strip()
+
cmdset = True
#Get the dirs where executeable is in
else:
delExecutionLine()
+
+def gdbWriteConfig():
+
+ #Add the breakpoints to the configuration
+ conf = Configuration.Configuration()
+ conf.load(".pygdb.conf")
+ conf.breakpoints = []
+ for bp in gdbBps:
+ conf.addBreak(bp["file"], bp["lineno"], bp["cond"])
+ conf.store(".pygdb.conf")
+
+
>>
highlight ExecutionLine term=bold ctermbg=DarkGreen ctermfg=Black guibg=LightGreen guifg=Black