extracting a launchDebugger code
[pygdb.git] / pygdb.py
index e6c1dbccb64a0d29ada143869b91c4917fcce1aa..64c48df01fc383ffef040277475070f40b1c3949 100755 (executable)
--- a/pygdb.py
+++ b/pygdb.py
@@ -12,15 +12,8 @@ import MainControlWindow
 import StatusWindow
 
 
-if __name__ == "__main__":
-
-       #Check if enough arguments are given
-       if len(sys.argv) <= 1:
-               print "Please give executeable to debug."
-               sys.exit(-1)
-
-       #Create the terminals
-       clientCmd = string.join(sys.argv[1:])
+def launchDebugger(clientCmd):
+       #Create Terminal
        dbgterm = GdbTerminal.GdbTerminal(clientCmd)
 
        #Create windows
@@ -34,3 +27,15 @@ if __name__ == "__main__":
 
 
 
+if __name__ == "__main__":
+
+       #Check if enough arguments are given
+       if len(sys.argv) <= 1:
+               print "Please give executeable to debug."
+               sys.exit(-1)
+
+       #Create the terminals
+       clientCmd = string.join(sys.argv[1:])
+       launchDebugger(clientCmd)
+
+