]> git.sthu.org Git - pygdb.git/commitdiff
Do not add multiple config entries
authorStefan Huber <shuber2@gmail.com>
Mon, 9 Jun 2008 19:48:52 +0000 (21:48 +0200)
committerStefan Huber <shuber2@gmail.com>
Mon, 9 Jun 2008 19:48:52 +0000 (21:48 +0200)
Configuration.py

index a8b4abfa8b768b5276bb932c18923285348339ae..e3ee6647950b74d6b7efd58166ecf6f0fcca7889 100755 (executable)
@@ -108,14 +108,20 @@ class Configuration:
                f.write("watch %(expr)s\n" % w)
 
 
-       def addBreak(self, file, lineno, cond=None):            
-               self.breakpoints += [ {"file" : file, "lineno" : lineno, "cond" : cond} ]
+       def addBreak(self, file, lineno, cond=None):
+               bp = {"file" : file, "lineno" : lineno, "cond" : cond}
+               if not bp in self.breakpoints:
+                       self.breakpoints += [bp]
 
        def addInt(self, name, val):
-               self.ints += [{"name": name, "val": val}]
+               i = {"name": name, "val": val}
+               if not i in self.ints:
+                       self.ints += [i]
 
        def addWatch(self, expr):
-               self.watches += [ {"expr" : expr.strip() } ]
+               w = {"expr" : expr.strip() }
+               if not w in self.watches:
+                       self.watches += [w]
 
 
        def findInt(self, name):