+
+ def listCodeSnippet(self):
+ starthis = self.getHistoryLen()
+ self.feed_child("list\n")
+ endhis, response = self.waitForPrompt(starthis)
+
+ text = string.join(self.history[starthis:endhis], "\n")
+ return text
+
+
+ def waitForPrompt(self, his):
+ rx = "^\(gdb\)"
+ return self.waitForRx(rx,his)
+
+
+ def testForActivity(self, his):
+ """Test whether debugger got active again"""
+
+ line = self.history[his]
+
+ if string.find(line, "\x1a\x1a") == 0:
+ tuples = string.split(line[2:], ":")
+ tuples[1] = int(tuples[1])
+ return "break", [tuples[0], int(tuples[1])]
+
+ if string.find(line, "Program exited") == 0:
+ code = string.split(line)[-1]
+
+ codeno = 0
+
+ #Parse the octal number
+ if code[0] == "O":
+ code = code[1:-1]
+ for c in code:
+ codeno = codeno*8 + int(c)