From cbf061bb713edf755eac6910c0526864754f47a3 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Mon, 9 Jun 2008 22:53:19 +0200 Subject: [PATCH] moved path-pruning to debugger - no path pruning in vim-file - remove duplicated breakpoints after re-reading from gdb --- BreakpointsFrame.py | 22 ++++++++++++++++++---- pygdb.vim | 3 +-- 2 files changed, 19 insertions(+), 6 deletions(-) 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 -- 2.39.5