def setStepin(self):
self.feed_child("step\n");
+ def setStepout(self):
+ bt = self.getBacktrace()
+
+ if len(bt) < 2:
+ self.setContinue()
+
+ else:
+ #Get the second line
+ sec = bt[1]
+
+ #Check if it is a backtrace line
+ if re.compile("^#1\s+.*\s\S+:\d+$").search(sec):
+ pos = string.split(sec)[-1]
+ self.feed_child("advance %s\n" % pos)
+
+
def setQuit(self):
self.feed_child("quit\n")
self.waitForNewline()
def listCodeSnippet(self):
- answ = self.__getAnswerFromCmd("list\n")
- return string.join(answ, "\n")
+ return self.__getAnswerFromCmd("list\n")
def getBacktrace(self):
- answ = self.__getAnswerFromCmd("bt\n")
- return string.join(answ, "\n")
+ return self.__getAnswerFromCmd("bt\n")
def waitForPrompt(self, his):
rx = "^\(gdb\)"
return "continued", None
if string.find(line, "\x1a\x1a") == 0:
- rxcont = re.compile("^\(gdb\)\s+(cont|step|next|stepi|nexti)")
+ rxcont = re.compile("^\(gdb\)\s+(cont|step|next|stepi|nexti|advance)")
if rxcont.search(self.history[his-1]):
return "stepped", None
+ if rxcont.search(self.history[his-2]):
+ return "stepped", None
return None
hbtnbox.add(self.stepoverBtn)
self.stepinBtn = gtk.Button("Step In")
hbtnbox.add(self.stepinBtn)
+ self.stepoutBtn = gtk.Button("Step Out")
+ hbtnbox.add(self.stepoutBtn)
self.quitBtn = gtk.Button("Quit")
hbtnbox.add(self.quitBtn)
self.stepoverBtnHandler = self.stepoverBtn.connect('clicked', \
self.stepoverBtnClicked)
self.stepinBtnHandler = self.stepinBtn.connect('clicked', self.stepinBtnClicked)
+ self.stepoutBtnHandler = self.stepoutBtn.connect('clicked', self.stepoutBtnClicked)
self.quitBtnHandler = self.quitBtn.connect('clicked', self.quitBtnClicked)
#Show the window
def stepinBtnClicked(self, btn):
pos = self.dbgterm.setStepin()
+ def stepoutBtnClicked(self, btn):
+ pos = self.dbgterm.setStepout()
+
def quitBtnClicked(self, btn):
self.dbgterm.setQuit()
self.continueBtn.handler_block(self.continueBtnHandler)
self.stepoverBtn.handler_block(self.stepoverBtnHandler)
self.stepinBtn.handler_block(self.stepinBtnHandler)
+ self.stepoutBtn.handler_block(self.stepoutBtnHandler)
self.quitBtn.handler_block(self.quitBtnHandler)
def enableButtons(self, *w):
self.continueBtn.handler_unblock(self.continueBtnHandler)
self.stepoverBtn.handler_unblock(self.stepoverBtnHandler)
self.stepinBtn.handler_unblock(self.stepinBtnHandler)
+ self.stepoutBtn.handler_unblock(self.stepoutBtnHandler)
self.quitBtn.handler_unblock(self.quitBtnHandler)