X-Git-Url: https://git.sthu.org/?p=pygdb.git;a=blobdiff_plain;f=pygdb.vim;h=fc03b84404d48cf050f4f1116db99c5aeec2c6f2;hp=25b7fe1cada7436637d21f33aa987bfcf2931581;hb=e25955fe11da68612055397fc0a0e652b9971377;hpb=648f1bdb4bb69daf905ce13c57eccd327b0bf151 diff --git a/pygdb.vim b/pygdb.vim index 25b7fe1..fc03b84 100644 --- a/pygdb.vim +++ b/pygdb.vim @@ -65,6 +65,16 @@ def gdbToggleBreakpoint(lineno=None, file=None): def addBreakpoint(file, lineno, cond=None): global gdbBps + #If file is not open, open it + if not file in [b.name for b in vim.buffers]: + try: + os.stat(file) + vim.command(":e %s" % file) + except OSError: + print "Warning: file '%s' does not exist! (Wrong client command?)" % file + return + + #Determine a sign number signnum = gdbNewSignnum() @@ -175,6 +185,7 @@ def gdbLoadConfig(): removeBreakpoint(0) #Add breakpoints from configuration + cmdset = False for bp in conf.breakpoints: file = bp["file"] @@ -183,8 +194,9 @@ def gdbLoadConfig(): if file[0] != os.sep: #We need the client command to expand the paths... - while clientcmd == "": + while clientcmd == "" or not cmdset: clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd).strip() + cmdset = True #Get the dirs where executeable is in relcmd = string.split(clientcmd)[0]