X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;f=pygdb.vim;h=b02495ad079d52f81d0ee4a7306047c6d61f1c3a;hb=71d49bb703b17f3000aac3d13767d7779fae9895;hp=ea552d307a0b130646770c4b4607a0de7527de64;hpb=ae13f1cd2401475e1fc58be3418fb349cd69fb98;p=pygdb.git diff --git a/pygdb.vim b/pygdb.vim index ea552d3..b02495a 100644 --- a/pygdb.vim +++ b/pygdb.vim @@ -1,4 +1,11 @@ -"shuber, 2008-06-08 +"pygdb.vim - pygtk interface to gdb in connection with (g)vim +" Maintainer: Stefan Huber + + +if !has('python') + echo "Error: Required vim compiled with +python" + finish +endif if ! exists("g:pygdb") @@ -28,9 +35,17 @@ clientcmd = "" execsign = None def gdbLaunch(): - global gdbterm, mainctrlwnd, statuswnd, gdbBps, clientcmd, gdbthread + global gdbBps, clientcmd + + clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd) + + #Pressed esq? + if clientcmd == None: + clientcmd = "" + return - clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd).strip() + #Strip away white space + clientcmd = clientcmd.strip() if clientcmd.strip()=="": print "No command given!" @@ -39,11 +54,12 @@ def gdbLaunch(): #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") - vim.command("!python %s/pygdb.py %s &\n" % (pygdbdir, clientcmd)) + vim.command("!python %s/pygdb.py --vim-servername %s %s &\n" % (pygdbdir, vim.eval("v:servername"), clientcmd)) def gdbToggleBreakpoint(lineno=None, file=None): @@ -197,7 +213,12 @@ def toAbsPath(path): #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 @@ -214,8 +235,6 @@ def gdbLoadConfig(): global clientcmd, gdbBps, cmdset - - #Load configuration conf = Configuration.Configuration() conf.load(".pygdb.conf") @@ -228,6 +247,10 @@ def gdbLoadConfig(): for bp in conf.breakpoints: bp["file"] = toAbsPath( bp["file"] ) addBreakpoint(bp["file"], bp["lineno"], bp["cond"]) + + #Set the command from config + if conf.getCommand() != None: + clientcmd = conf.getCommand() #Set current execution line if conf.isCurrposSet(): @@ -235,6 +258,7 @@ def gdbLoadConfig(): setExecutionLine(file, conf.currlineno) else: delExecutionLine() + >> highlight ExecutionLine term=bold ctermbg=DarkGreen ctermfg=Black guibg=LightGreen guifg=Black