added watches and status line
[pygdb.git] / GdbTerminal.py
index 12256c1d0066e73b4d1f80dc69afbceae38f1cc8..bcd857ac5ef5428fdc0fc435a57a0cba5d8b7047 100755 (executable)
@@ -32,23 +32,23 @@ class GdbTerminal (DbgTerminal.DbgTerminal):
                his = self.getHistoryLen()
                argv = string.join(string.split(self.clientCmd)[1:])
                self.feed_dbg("run " + argv + "\n")
-               return self.waitForPosition(his)
+               return self.waitForActivation(his)
 
 
        def setContinue(self):
                his = self.getHistoryLen()
                self.feed_dbg("cont\n");
-               return self.waitForPosition(his)
+               return self.waitForActivation(his)
 
        def setStepover(self):
                his = self.getHistoryLen()
                self.feed_dbg("next\n");
-               return self.waitForPosition(his)
+               return self.waitForActivation(his)
 
        def setStepin(self):
                his = self.getHistoryLen()
                self.feed_dbg("step\n");
-               return self.waitForPosition(his)
+               return self.waitForActivation(his)
 
        def setQuit(self):
                self.feed_dbg("quit\n")
@@ -63,16 +63,24 @@ class GdbTerminal (DbgTerminal.DbgTerminal):
                his = self.getHistoryLen()
                self.feed_dbg("print " + expr + "\n")
 
-               rx = re.compile("^\$[1-9][0-9]* = .*$")
+               rx = re.compile("^\(gdb\) $")
                his, response = self.waitForRx(rx, his)
 
-               split = string.split(response, "=")
+               answer = self.history[his-1]
+
+               if len(string.split(answer, "=")) == 1:
+                       return answer.strip()
+
+               split = string.split(answer, "=")
                return string.join(split[1:], "=").strip()
 
 
-       def waitForPosition(self, his):
+       def waitForActivation(self, his):
+
+               self.setActive(False)
                rx = re.compile("^\(gdb\) $")
                his, reponse = self.waitForRx(rx,his)
+               self.setActive(True)
 
                if self.history[his-1][0:2]=="\x1a\x1a":
                        tuples = string.split(self.history[his-1][2:], ":")