Debugger/DebugServer.py

changeset 5899
0516f6548ca6
parent 5859
28282fa0df7b
child 5929
4ce93da7616e
equal deleted inserted replaced
5898:fc96d49f5fbf 5899:0516f6548ca6
443 self.clientType = clType 443 self.clientType = clType
444 Preferences.Prefs.settings.setValue( 444 Preferences.Prefs.settings.setValue(
445 'DebugClient/Type', self.clientType) 445 'DebugClient/Type', self.clientType)
446 446
447 def startClient(self, unplanned=True, clType=None, forProject=False, 447 def startClient(self, unplanned=True, clType=None, forProject=False,
448 runInConsole=False): 448 runInConsole=False, interpreter=""):
449 """ 449 """
450 Public method to start a debug client. 450 Public method to start a debug client.
451 451
452 @keyparam unplanned flag indicating that the client has died (boolean) 452 @keyparam unplanned flag indicating that the client has died (boolean)
453 @keyparam clType type of client to be started (string) 453 @keyparam clType type of client to be started (string)
454 @keyparam forProject flag indicating a project related action (boolean) 454 @keyparam forProject flag indicating a project related action (boolean)
455 @keyparam runInConsole flag indicating to start the debugger in a 455 @keyparam runInConsole flag indicating to start the debugger in a
456 console window (boolean) 456 console window (boolean)
457 @keyparam interpreter interpreter to be used to execute the remote
458 side (string)
457 """ 459 """
458 self.running = False 460 self.running = False
459 461
460 if not self.passive or not self.passiveClientExited: 462 if not self.passive or not self.passiveClientExited:
461 if self.debuggerInterface and self.debuggerInterface.isConnected(): 463 if self.debuggerInterface and self.debuggerInterface.isConnected():
476 self.__createDebuggerInterface() 478 self.__createDebuggerInterface()
477 if forProject: 479 if forProject:
478 project = e5App().getObject("Project") 480 project = e5App().getObject("Project")
479 if not project.isDebugPropertiesLoaded(): 481 if not project.isDebugPropertiesLoaded():
480 self.clientProcess, isNetworked, clientInterpreter = \ 482 self.clientProcess, isNetworked, clientInterpreter = \
481 self.debuggerInterface.startRemote(self.serverPort(), 483 self.debuggerInterface.startRemote(
482 runInConsole) 484 self.serverPort(), runInConsole, interpreter)
483 else: 485 else:
484 self.clientProcess, isNetworked, clientInterpreter = \ 486 self.clientProcess, isNetworked, clientInterpreter = \
485 self.debuggerInterface.startRemoteForProject( 487 self.debuggerInterface.startRemoteForProject(
486 self.serverPort(), runInConsole) 488 self.serverPort(), runInConsole, interpreter)
487 else: 489 else:
488 self.clientProcess, isNetworked, clientInterpreter = \ 490 self.clientProcess, isNetworked, clientInterpreter = \
489 self.debuggerInterface.startRemote( 491 self.debuggerInterface.startRemote(
490 self.serverPort(), runInConsole) 492 self.serverPort(), runInConsole, interpreter)
491 493
492 if self.clientProcess: 494 if self.clientProcess:
493 self.clientProcess.readyReadStandardError.connect( 495 self.clientProcess.readyReadStandardError.connect(
494 self.__clientProcessError) 496 self.__clientProcessError)
495 self.clientProcess.readyReadStandardOutput.connect( 497 self.clientProcess.readyReadStandardOutput.connect(
796 envdict[key] = value 798 envdict[key] = value
797 except ValueError: 799 except ValueError:
798 pass 800 pass
799 self.debuggerInterface.remoteEnvironment(envdict) 801 self.debuggerInterface.remoteEnvironment(envdict)
800 802
801 def remoteLoad(self, fn, argv, wd, env, autoClearShell=True, 803 def remoteLoad(self, interpreter, fn, argv, wd, env, autoClearShell=True,
802 tracePython=False, autoContinue=True, forProject=False, 804 tracePython=False, autoContinue=True, forProject=False,
803 runInConsole=False, autoFork=False, forkChild=False, 805 runInConsole=False, autoFork=False, forkChild=False,
804 clientType="", enableCallTrace=False): 806 clientType="", enableCallTrace=False):
805 """ 807 """
806 Public method to load a new program to debug. 808 Public method to load a new program to debug.
807 809
810 @param interpreter interpreter to be used to execute the remote
811 side (string)
808 @param fn the filename to debug (string) 812 @param fn the filename to debug (string)
809 @param argv the commandline arguments to pass to the program (string) 813 @param argv the commandline arguments to pass to the program (string)
810 @param wd the working directory for the program (string) 814 @param wd the working directory for the program (string)
811 @param env environment settings (string) 815 @param env environment settings (string)
812 @keyparam autoClearShell flag indicating, that the interpreter window 816 @keyparam autoClearShell flag indicating, that the interpreter window
848 self.debugging = True 852 self.debugging = True
849 self.running = True 853 self.running = True
850 self.__restoreBreakpoints() 854 self.__restoreBreakpoints()
851 self.__restoreWatchpoints() 855 self.__restoreWatchpoints()
852 856
853 def remoteRun(self, fn, argv, wd, env, autoClearShell=True, 857 def remoteRun(self, interpreter, fn, argv, wd, env, autoClearShell=True,
854 forProject=False, runInConsole=False, 858 forProject=False, runInConsole=False, autoFork=False,
855 autoFork=False, forkChild=False, 859 forkChild=False, clientType=""):
856 clientType=""):
857 """ 860 """
858 Public method to load a new program to run. 861 Public method to load a new program to run.
859 862
863 @param interpreter interpreter to be used to execute the remote
864 side (string)
860 @param fn the filename to run (string) 865 @param fn the filename to run (string)
861 @param argv the commandline arguments to pass to the program (string) 866 @param argv the commandline arguments to pass to the program (string)
862 @param wd the working directory for the program (string) 867 @param wd the working directory for the program (string)
863 @param env environment settings (string) 868 @param env environment settings (string)
864 @keyparam autoClearShell flag indicating, that the interpreter window 869 @keyparam autoClearShell flag indicating, that the interpreter window
889 894
890 self.debuggerInterface.remoteRun(fn, argv, wd, autoFork, forkChild) 895 self.debuggerInterface.remoteRun(fn, argv, wd, autoFork, forkChild)
891 self.debugging = False 896 self.debugging = False
892 self.running = True 897 self.running = True
893 898
894 def remoteCoverage(self, fn, argv, wd, env, autoClearShell=True, 899 def remoteCoverage(self, interpreter, fn, argv, wd, env,
895 erase=False, forProject=False, runInConsole=False, 900 autoClearShell=True, erase=False, forProject=False,
896 clientType=""): 901 runInConsole=False, clientType=""):
897 """ 902 """
898 Public method to load a new program to collect coverage data. 903 Public method to load a new program to collect coverage data.
899 904
905 @param interpreter interpreter to be used to execute the remote
906 side (string)
900 @param fn the filename to run (string) 907 @param fn the filename to run (string)
901 @param argv the commandline arguments to pass to the program (string) 908 @param argv the commandline arguments to pass to the program (string)
902 @param wd the working directory for the program (string) 909 @param wd the working directory for the program (string)
903 @param env environment settings (string) 910 @param env environment settings (string)
904 @keyparam autoClearShell flag indicating, that the interpreter window 911 @keyparam autoClearShell flag indicating, that the interpreter window
928 935
929 self.debuggerInterface.remoteCoverage(fn, argv, wd, erase) 936 self.debuggerInterface.remoteCoverage(fn, argv, wd, erase)
930 self.debugging = False 937 self.debugging = False
931 self.running = True 938 self.running = True
932 939
933 def remoteProfile(self, fn, argv, wd, env, autoClearShell=True, 940 def remoteProfile(self, interpreter, fn, argv, wd, env,
934 erase=False, forProject=False, 941 autoClearShell=True, erase=False, forProject=False,
935 runInConsole=False, 942 runInConsole=False, clientType=""):
936 clientType=""):
937 """ 943 """
938 Public method to load a new program to collect profiling data. 944 Public method to load a new program to collect profiling data.
939 945
946 @param interpreter interpreter to be used to execute the remote
947 side (string)
940 @param fn the filename to run (string) 948 @param fn the filename to run (string)
941 @param argv the commandline arguments to pass to the program (string) 949 @param argv the commandline arguments to pass to the program (string)
942 @param wd the working directory for the program (string) 950 @param wd the working directory for the program (string)
943 @param env environment settings (string) 951 @param env environment settings (string)
944 @keyparam autoClearShell flag indicating, that the interpreter window 952 @keyparam autoClearShell flag indicating, that the interpreter window

eric ide

mercurial