fixing endless loop bug
[pygdb.git] / GdbTerminal.py
index 6218d64780e18e7b2e0f515e3ecf7d90bd34ac3a..af0368bdcaa670154ab2ca9d49ebd71c4178a64c 100644 (file)
@@ -95,8 +95,8 @@ class GdbTerminal (DbgTerminal.DbgTerminal):
                bplines = self.__getAnswerFromCmd("info breakpoints\n")
 
                rxbp = re.compile("^\d+\s+breakpoint")
-               rxpos = re.compile("^.* at \S+:\d+$")
-               rxcond = re.compile("^\tstop only if")
+               rxpos = re.compile("^.*at \S+:\d+$")
+               rxcond = re.compile("^\s+stop only if")
 
                bpnts = []
                i = 1
@@ -113,13 +113,18 @@ class GdbTerminal (DbgTerminal.DbgTerminal):
                        no = string.split(line)[0]
 
                        #This line does not contain the file!
+                       #Check for next line...
                        if not rxpos.search(line):
+                               i += 1
+                       if not rxpos.search(line):
+                               i += 1
                                continue
 
                        pos = string.split(line)[-1]
                        [file,lineno] = string.split(pos,":")
                        cond = None
 
+                       #Look for conditions
                        if i+1<len(bplines) and rxcond.search(bplines[i+1]):
                                i +=1
                                line = bplines[i]