removed a print and added another
[pygdb.git] / pygdb.py
1 #!/usr/bin/python
2 #shuber, 2008-06-08
3
4 __author__ = "shuber"
5
6 import gtk
7 import os
8 import string
9 import sys
10
11 import GdbTerminal
12 import MainControlWindow
13 import StatusWindow
14
15
16 def launchDebugger(clientCmd, quitonclose=True):
17
18
19
20 def hideWindows():
21 #Kill the debugger
22 dbgterm.stopDbg()
23
24 mainCtrlWnd.destroy()
25 statusWnd.destroy()
26 gtk.main_quit()
27
28
29 #Determine the closing callback func
30 if quitonclose:
31 destroycb = gtk.main_quit
32 else:
33 destroycb = hideWindows
34
35 #Create Terminal
36 dbgterm = GdbTerminal.GdbTerminal(clientCmd, destroycb)
37
38 #Create windows
39 mainCtrlWnd = MainControlWindow.MainControlWindow(dbgterm, destroycb)
40 statusWnd = StatusWindow.StatusWindow(mainCtrlWnd, dbgterm, destroycb)
41 dbgterm.initialize()
42
43 return dbgterm, mainCtrlWnd, statusWnd
44
45
46
47 if __name__ == "__main__":
48
49 #Check if enough arguments are given
50 if len(sys.argv) <= 1:
51 print "Please give executeable to debug."
52 sys.exit(-1)
53
54 #Create the terminals
55 clientCmd = string.join(sys.argv[1:])
56 launchDebugger(clientCmd)
57 gtk.main()
58
59