status, param = res
if self.isActive():
+ print "got active: ", res
for cb in self.gotActiveCallback:
cb(status, param)
else:
+ print "got inactive: ", res
for cb in self.gotInactiveCallback:
cb(status, param)
except:
lines = string.split(text, "\n")
#Remove the incomplete line
- len = max(0,self.getHistoryLen()-1)
+ len = max(0,self.getHistoryLen())
self.history[-1] += lines[0]
self.history += lines[1:]
#Check if activity status has been changed
for i in range(len, self.getHistoryLen()):
line = self.history[i]
+
+ res = self.testForInactivity(i)
+ if res != None:
+ while self.activityChanged != None:
+ print "wait for pending activity"
+ gtk.main_iteration()
+
+ self.setActive(False)
+ self.activityChanged = res
res = self.testForActivity(i)
- if res != None and not self.isActive():
+ if res != None:
+ while self.activityChanged != None:
+ print "wait for pending activity"
+ gtk.main_iteration()
+
self.setActive(True)
self.activityChanged = res
-
- res = self.testForInactivity(i)
- if res != None and self.isActive():
- self.setActive(False)
- self.activityChanged = res
+
def testForInactivity(self, his):
"""Test whether debugger got inactive"""
line = self.history[his]
- rxcont = re.compile("^\(gdb\)\s+(cont|step|next|stepi|nexti)")
if string.find(line, "Starting program:") == 0:
prog = string.join( string.split(line)[1:])
return "started", prog
- if rxcont.search(line):
+ if string.find(line, "Continuing.") == 0:
return "continued", None
+ if string.find(line, "\x1a\x1a") == 0:
+ rxcont = re.compile("^\(gdb\)\s+(cont|step|next|stepi|nexti)")
+
+ if rxcont.search(self.history[his-1]):
+ return "stepped", None
+
return None