X-Git-Url: https://git.sthu.org/?p=pygdb.git;a=blobdiff_plain;f=pygdb.py;h=077bc1cb55adad060071a03e1f658b9d9a00af62;hp=66fe63452f8f355adab3298b07b26b4c0455ea83;hb=054679cd2c3372717bf7982407e2453428193581;hpb=1094f7f4581a9c0074294004bbd8c934593a54d5 diff --git a/pygdb.py b/pygdb.py index 66fe634..077bc1c 100755 --- a/pygdb.py +++ b/pygdb.py @@ -4,6 +4,7 @@ __author__ = "shuber" import gtk +import os import string import sys @@ -12,16 +13,35 @@ import MainControlWindow import StatusWindow -def launchDebugger(clientCmd): +def launchDebugger(clientCmd, quitonclose=True): + + + + def hideWindows(): + #Kill the debugger + dbgterm.stopDbg() + + mainCtrlWnd.destroy() + statusWnd.destroy() + gtk.main_quit() + + + + #Determine the closing callback func + if quitonclose: + destroycb = gtk.main_quit + else: + destroycb = hideWindows + #Create Terminal - dbgterm = GdbTerminal.GdbTerminal(clientCmd) + dbgterm = GdbTerminal.GdbTerminal(clientCmd, destroycb) #Create windows - mainCtrlWnd = MainControlWindow.MainControlWindow(dbgterm) - statusWnd = StatusWindow.StatusWindow(mainCtrlWnd, dbgterm) + mainCtrlWnd = MainControlWindow.MainControlWindow(dbgterm, destroycb) + statusWnd = StatusWindow.StatusWindow(mainCtrlWnd, dbgterm, destroycb) dbgterm.initialize() - gtk.main() + return dbgterm, mainCtrlWnd, statusWnd @@ -35,5 +55,6 @@ if __name__ == "__main__": #Create the terminals clientCmd = string.join(sys.argv[1:]) launchDebugger(clientCmd) + gtk.main()