def setPty(self, pty):
ttyname = os.ttyname(pty)
+ his = self.getHistoryLen()
self.feed_child("set inferior-tty %s\n" % (ttyname,))
+ self.waitForActivation(his)
def setRun(self):
rx = re.compile("^Breakpoint |^No |^\(gdb\) ")
his, response = self.waitForRx(rx, his)
- if response[0:10] == "Breakpoint":
- return string.split(response)[1].strip()
+ 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");
- return None
- #Wait again for gdb
- if response[0:5] != "(gdb)":
- his, response = self.waitForRx(rx,his)
+ #Wait again for (gdb)...
+ self.waitForActivation(his)
- return None
+ return answer
def delBreakpoint(self, breakpoint):
his = self.getHistoryLen()
self.feed_child("print " + expr + "\n")
- rx = re.compile("^\(gdb\) $")
+ rx = re.compile("^\(gdb\)")
his, response = self.waitForRx(rx, his)
answer = self.history[his-1]
return string.join(split[1:], "=").strip()
- def waitForActivation(self, starthis=None):
-
- if starthis == None:
- starthis = self.getHistoryLen()
+ def waitForActivation(self, starthis):
self.setActive(False)
- rx = re.compile("^\(gdb\) $")
- endhis, reponse = self.waitForRx(rx,starthis)
+ rx = re.compile("^\(gdb\)")
+ endhis, response = self.waitForRx(rx,starthis)
self.setActive(True)
for his in reversed(range(starthis+1,endhis)):