From: Stefan Huber Date: Mon, 9 Jun 2008 20:53:19 +0000 (+0200) Subject: moved path-pruning to debugger X-Git-Tag: v0.99.0~22 X-Git-Url: https://git.sthu.org/?a=commitdiff_plain;h=cbf061bb713edf755eac6910c0526864754f47a3;p=pygdb.git moved path-pruning to debugger - no path pruning in vim-file - remove duplicated breakpoints after re-reading from gdb --- diff --git a/BreakpointsFrame.py b/BreakpointsFrame.py index f6967e0..681df45 100644 --- a/BreakpointsFrame.py +++ b/BreakpointsFrame.py @@ -115,6 +115,7 @@ class BreakpointsFrame (StatusFrame.StatusFrame): def applyConfiguration(self, conf): for b in conf.breakpoints: self.addBreakpoint(b["file"], b["lineno"], b["cond"]) + self.updateValues(None) def fillConfiguration(self, conf): iter = self.model.get_iter_first() @@ -126,13 +127,26 @@ class BreakpointsFrame (StatusFrame.StatusFrame): def addBreakpointToList(self, no, file, lineno, cond=None): - iter = self.model.append() - self.model.set(iter, 0, no) if cond==None: - self.model.set(iter, 1, "%s:%s" % (str(file), str(lineno))) + expr = "%s:%s" % (str(file), str(lineno)) else: - self.model.set(iter, 1, "%s:%s if %s" % (str(file), str(lineno), str(cond))) + expr = "%s:%s if %s" % (str(file), str(lineno), str(cond)) + + iter = self.model.get_iter_first() + while iter != None: + newiter = self.model.iter_next(iter) + #Found a expression which is the same --> remove the breakpoint + if (expr,) == self.model.get(iter,1): + no, = self.model.get(iter,0) + self.debugger.delBreakpoint(no) + return + iter = newiter + + #Add the entry to the breakpoint list + iter = self.model.append() + self.model.set(iter, 0, no) + self.model.set(iter, 1, expr) def addBtnClicked(self, btn): diff --git a/pygdb.vim b/pygdb.vim index d0b3e5d..d61c4f1 100644 --- a/pygdb.vim +++ b/pygdb.vim @@ -112,8 +112,7 @@ def gdbBreakpointCond(lineno=None, file=None, cond=None): def getCurrentFile(): - splitted = string.split(vim.current.window.buffer.name, os.sep) - return splitted[-1] + return vim.current.window.buffer.name