X-Git-Url: https://git.sthu.org/?p=pygdb.git;a=blobdiff_plain;f=DbgTerminal.py;h=8beec4652f97750b6a553710185b6c92b5295e37;hp=21aa1c42d790f4b1bc230be0e51c54715b627466;hb=f2698c930f26434a100e0b4c1e4f39291b55b4f9;hpb=fd54ea4a2710afa2bd51e2b8600c4577bdfccc0d diff --git a/DbgTerminal.py b/DbgTerminal.py index 21aa1c4..8beec46 100644 --- a/DbgTerminal.py +++ b/DbgTerminal.py @@ -19,20 +19,15 @@ import ClientIOTerminal class DbgTerminal (vte.Terminal): - isactive = True - lastrow = 0 - history = [] - childpid = None - - - def __init__(self, clientCmd, exitcb=None): + def __init__(self, clientCmd): vte.Terminal.__init__(self) - def onChildExited(): - self.childpid = None - if exitcb != None: - exitcb() + #Set members + self.childpid = None + self.history = [] + self.lastrow = 0 + self.isactive = True #Start debugger self.clientCmd = clientCmd @@ -41,7 +36,7 @@ class DbgTerminal (vte.Terminal): #Set up terminal window and initialize debugger self.connect("cursor-moved", self.contents_changed) - self.connect("child-exited", lambda *w: onChildExited()) + self.connect("child-exited", lambda *w: gtk.main_quit()) #font description fontdesc = pango.FontDescription("monospace 9") @@ -56,6 +51,7 @@ class DbgTerminal (vte.Terminal): def stopDbg(self): if self.childpid != None: + #9=KILL, 15=TERM os.kill(self.childpid, 15); self.childpid = None