def getExpression(self, expr):
raise NotImplementedError()
+ def listCodeSnippet(self):
+ raise NotImplementedError()
+
def waitForPrompt(self, his):
raise NotImplementedError()
split = string.split(answer, "=")
return string.join(split[1:], "=").strip()
+
+ 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\)"
def updateValues(self, status, param):
+
+ #Create new text buffer for source view
+ buf = gtk.TextBuffer()
if status == "break":
self.file, self.lineno = param
self.positionLabel.set_label("%s:%d" % (self.file, self.lineno))
+
+ #Get some code
+ code = self.debugger.listCodeSnippet()
+ buf.set_text(code)
+
+
else:
self.file, self.lineno = None, None
+ code = ""
if status == "exited":
self.positionLabel.set_label("Exited with code %d." % param)
else:
self.positionLabel.set_label(status)
+
+ #Set the buffer
+ self.srcview.set_buffer(buf)
+
+
+
def applyConfiguration(self, conf):
pass