X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;f=GdbTerminal.py;h=7c282360501232a26a97acedbceeec10b286e50e;hb=d7679b03d875c207a48c8d86fbeb3c8b22e4d351;hp=304e39ab622185cd2132e616fe17c0cd5c89b261;hpb=f2698c930f26434a100e0b4c1e4f39291b55b4f9;p=pygdb.git diff --git a/GdbTerminal.py b/GdbTerminal.py index 304e39a..7c28236 100755 --- a/GdbTerminal.py +++ b/GdbTerminal.py @@ -25,7 +25,9 @@ class GdbTerminal (DbgTerminal.DbgTerminal): 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): @@ -65,18 +67,19 @@ class GdbTerminal (DbgTerminal.DbgTerminal): 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): @@ -90,8 +93,9 @@ class GdbTerminal (DbgTerminal.DbgTerminal): endhis, response = self.waitForRx(rx, starthis) - rxbp1 = re.compile("^\d+\s+breakpoint") - rxbp2 = re.compile("^\tstop only if") + 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] @@ -101,17 +105,23 @@ class GdbTerminal (DbgTerminal.DbgTerminal): while i