import gtk
+import os
import pango
import pty
import string
class DbgTerminal (vte.Terminal):
- isactive = True
- lastrow = 0
- history = []
-
-
def __init__(self, clientCmd):
vte.Terminal.__init__(self)
+ #Set members
+ self.childpid = None
+ self.history = []
+ self.lastrow = 0
+ self.isactive = True
+
#Start debugger
self.clientCmd = clientCmd
#Open pseudo-terminal where to-be-debugged process reads/writes to
def initialize(self):
- self.fork_command( self.getCommand(), self.getArgv())
+ self.childpid = self.fork_command( self.getCommand(), self.getArgv())
self.setPty(self.client_ptyslave)
self.waitForActivation()
+ def stopDbg(self):
+
+ if self.childpid != None:
+ #9=KILL, 15=TERM
+ os.kill(self.childpid, 15);
+ self.childpid = None
+
+
def contents_changed(self, term):
c,r = term.get_cursor_position()