import gtk
+import os
import pango
import pty
import string
isactive = True
lastrow = 0
history = []
+ childpid = None
- def __init__(self, clientCmd):
+ def __init__(self, clientCmd, exitcb=None):
vte.Terminal.__init__(self)
+ def onChildExited():
+ self.childpid = None
+ if exitcb != None:
+ exitcb()
+
#Start debugger
self.clientCmd = clientCmd
#Open pseudo-terminal where to-be-debugged process reads/writes to
#Set up terminal window and initialize debugger
self.connect("cursor-moved", self.contents_changed)
- self.connect("child-exited", lambda *w: gtk.main_quit())
+ self.connect("child-exited", lambda *w: onChildExited())
#font description
fontdesc = pango.FontDescription("monospace 9")
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:
+ os.kill(self.childpid, 15);
+ self.childpid = None
+
+
def contents_changed(self, term):
c,r = term.get_cursor_position()