extracting a launchDebugger code
[pygdb.git] / pygdb.py
1 #!/usr/bin/python
2 #shuber, 2008-06-08
3
4 __author__ = "shuber"
5
6 import gtk
7 import string
8 import sys
9
10 import GdbTerminal
11 import MainControlWindow
12 import StatusWindow
13
14
15 def launchDebugger(clientCmd):
16 #Create Terminal
17 dbgterm = GdbTerminal.GdbTerminal(clientCmd)
18
19 #Create windows
20 mainCtrlWnd = MainControlWindow.MainControlWindow(dbgterm)
21 statusWnd = StatusWindow.StatusWindow(mainCtrlWnd, dbgterm)
22
23 #Register callback function for new positions
24 mainCtrlWnd.newPosCbs += [statusWnd.updateValues]
25
26 gtk.main()
27
28
29
30 if __name__ == "__main__":
31
32 #Check if enough arguments are given
33 if len(sys.argv) <= 1:
34 print "Please give executeable to debug."
35 sys.exit(-1)
36
37 #Create the terminals
38 clientCmd = string.join(sys.argv[1:])
39 launchDebugger(clientCmd)
40
41