+ answer = None
+
+ if response[0:10] == "Breakpoint":
+ answer = string.split(response)[1].strip()
+
+ #Wants an answer: "No"
+ if response[0:14] == "No source file":
+ self.feed_child("n\n");
+
+ #Wait again for (gdb)...
+ self.waitForPrompt(his)
+
+ return answer
+
+
+ def delBreakpoint(self, breakpoint):
+ self.__getAnswerFromCmd("del breakpoint %s\n" % (breakpoint,))
+
+
+ def getBreakpoints(self):
+ bplines = self.__getAnswerFromCmd("info breakpoints\n")
+
+ rxbp = re.compile("^\d+\s+breakpoint")
+ rxpos = re.compile("^.*at \S+:\d+$")
+ rxcond = re.compile("^\s+stop only if")
+
+ bpnts = []
+ i = 1
+
+ #Parse the resulting lines
+ while i<len(bplines):
+ line = bplines[i]
+
+ if not rxbp.search(line):
+ i += 1
+ continue
+
+ #Get number of breakpoint
+ no = string.split(line)[0]
+
+ #This line does not contain the file!
+ if not rxpos.search(line):
+ continue
+
+ pos = string.split(line)[-1]
+ [file,lineno] = string.split(pos,":")
+ cond = None
+
+ if i+1<len(bplines) and rxcond.search(bplines[i+1]):
+ i +=1
+ line = bplines[i]
+ cond = string.join(string.split(line," if ")[1:], " if ")
+ cond = cond.strip()
+
+ bpnts += [[no, file, lineno, cond]]
+ i += 1
+
+ return bpnts
+
+
+
+ def getExpression(self, expr):
+ answer = self.__getAnswerFromCmd("print " + expr + "\n")
+ answer = answer[-1]
+
+ if len(string.split(answer, "=")) == 1:
+ return answer.strip()
+
+ split = string.split(answer, "=")