+ 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.waitForActivation(his)
+
+ return answer
+
+
+ def delBreakpoint(self, breakpoint):
+ his = self.getHistoryLen()
+ self.feed_child("del breakpoint %s\n" % (breakpoint,))
+ self.waitForActivation(his)
+
+ def getBreakpoints(self):
+ starthis = self.getHistoryLen()
+ self.feed_child("info breakpoints\n")
+ endhis, response = self.__waitForPrompt(starthis)
+
+ rxbp = re.compile("^\d+\s+breakpoint")
+ rxpos = re.compile("^.* at \S+:\d+$")
+ rxcond = re.compile("^\tstop only if")
+
+ bpnts = []
+ bplines = self.history[starthis+1:endhis]
+ i = 0
+
+ #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):
+ i += 1
+ line = bplines[i]
+
+ 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]
+ pre,cond = string.split(line,"if")
+ cond = cond.strip()
+
+ bpnts += [[no, file, lineno, cond]]
+ i += 1
+
+ return bpnts
+
+
+
+ def getExpression(self, expr):
+
+ his = self.getHistoryLen()
+ self.feed_child("print " + expr + "\n")
+ his, response = self.__waitForPrompt(his)
+ answer = self.history[his-1]
+
+ if len(string.split(answer, "=")) == 1:
+ return answer.strip()
+
+ split = string.split(answer, "=")