216 else: |
216 else: |
217 self.clientType = 'Python3' |
217 self.clientType = 'Python3' |
218 # Change clientType if dependent interpreter not exist anymore |
218 # Change clientType if dependent interpreter not exist anymore |
219 # (maybe deinstalled,...) |
219 # (maybe deinstalled,...) |
220 elif self.clientType == 'Python2' and Preferences.getDebugger( |
220 elif self.clientType == 'Python2' and Preferences.getDebugger( |
221 "PythonInterpreter") == '': |
221 "Python2VirtualEnv") == '': |
222 self.clientType = 'Python3' |
222 self.clientType = 'Python3' |
223 elif self.clientType == 'Python3' and Preferences.getDebugger( |
223 elif self.clientType == 'Python3' and Preferences.getDebugger( |
224 "Python3Interpreter") == '': |
224 "Python3VirtualEnv") == '': |
225 self.clientType = 'Python2' |
225 self.clientType = 'Python2' |
226 |
226 |
227 self.lastClientType = '' |
227 self.lastClientType = '' |
228 self.__autoClearShell = False |
228 self.__autoClearShell = False |
229 |
229 |
299 registeredInterfaces = {} |
299 registeredInterfaces = {} |
300 for interfaceName in self.__debuggerInterfaces: |
300 for interfaceName in self.__debuggerInterfaces: |
301 registeredInterfaces[interfaceName] = \ |
301 registeredInterfaces[interfaceName] = \ |
302 self.__debuggerInterfaces[interfaceName] |
302 self.__debuggerInterfaces[interfaceName] |
303 |
303 |
304 self.__debuggerInterfaces = {} |
|
305 self.__debuggerInterfaceRegistry = {} |
304 self.__debuggerInterfaceRegistry = {} |
306 for interfaceName, getRegistryData in registeredInterfaces.items(): |
305 for interfaceName, getRegistryData in registeredInterfaces.items(): |
307 self.registerDebuggerInterface(interfaceName, getRegistryData) |
306 self.registerDebuggerInterface(interfaceName, getRegistryData, |
|
307 reregister=True) |
308 |
308 |
309 self.__maxVariableSize = Preferences.getDebugger("MaxVariableSize") |
309 self.__maxVariableSize = Preferences.getDebugger("MaxVariableSize") |
310 |
310 |
311 def registerDebuggerInterface(self, interfaceName, getRegistryData): |
311 def registerDebuggerInterface(self, interfaceName, getRegistryData, |
|
312 reregister=False): |
312 """ |
313 """ |
313 Public method to register a debugger interface. |
314 Public method to register a debugger interface. |
314 |
315 |
315 @param interfaceName name of the debugger interface |
316 @param interfaceName name of the debugger interface |
316 @type str |
317 @type str |
318 to get the debugger interface details. This method shall |
319 to get the debugger interface details. This method shall |
319 return the client language, the client capabilities, the |
320 return the client language, the client capabilities, the |
320 list of associated file extensions and a function reference |
321 list of associated file extensions and a function reference |
321 to create the debugger interface (see __createDebuggerInterface()) |
322 to create the debugger interface (see __createDebuggerInterface()) |
322 @type function |
323 @type function |
323 """ |
324 @param reregister flag indicating to re-register the interface |
324 if interfaceName in self.__debuggerInterfaces: |
325 @type bool |
|
326 """ |
|
327 if interfaceName in self.__debuggerInterfaces and not reregister: |
325 E5MessageBox.warning( |
328 E5MessageBox.warning( |
326 None, |
329 None, |
327 self.tr("Register Debugger Interface"), |
330 self.tr("Register Debugger Interface"), |
328 self.tr("""<p>The debugger interface <b>{0}</b> has already""" |
331 self.tr("""<p>The debugger interface <b>{0}</b> has already""" |
329 """ been registered. Ignoring this request.</p>""")) |
332 """ been registered. Ignoring this request.</p>""")) |
330 return |
333 return |
331 |
334 |
|
335 if not reregister: |
|
336 self.__debuggerInterfaces[interfaceName] = getRegistryData |
332 registryDataList = getRegistryData() |
337 registryDataList = getRegistryData() |
333 if registryDataList: |
338 if registryDataList: |
334 self.__debuggerInterfaces[interfaceName] = getRegistryData |
|
335 for clientLanguage, clientCapabilities, clientExtensions, \ |
339 for clientLanguage, clientCapabilities, clientExtensions, \ |
336 interfaceCreator in registryDataList: |
340 interfaceCreator in registryDataList: |
337 self.__debuggerInterfaceRegistry[clientLanguage] = [ |
341 self.__debuggerInterfaceRegistry[clientLanguage] = [ |
338 clientCapabilities, clientExtensions, interfaceCreator, |
342 clientCapabilities, clientExtensions, interfaceCreator, |
339 interfaceName] |
343 interfaceName] |
447 self.clientType = clType |
451 self.clientType = clType |
448 Preferences.Prefs.settings.setValue( |
452 Preferences.Prefs.settings.setValue( |
449 'DebugClient/Type', self.clientType) |
453 'DebugClient/Type', self.clientType) |
450 |
454 |
451 def startClient(self, unplanned=True, clType=None, forProject=False, |
455 def startClient(self, unplanned=True, clType=None, forProject=False, |
452 runInConsole=False, interpreter=""): |
456 runInConsole=False, venvName=""): |
453 """ |
457 """ |
454 Public method to start a debug client. |
458 Public method to start a debug client. |
455 |
459 |
456 @keyparam unplanned flag indicating that the client has died (boolean) |
460 @keyparam unplanned flag indicating that the client has died |
457 @keyparam clType type of client to be started (string) |
461 @type bool |
458 @keyparam forProject flag indicating a project related action (boolean) |
462 @keyparam clType type of client to be started |
|
463 @type str |
|
464 @keyparam forProject flag indicating a project related action |
|
465 @type bool |
459 @keyparam runInConsole flag indicating to start the debugger in a |
466 @keyparam runInConsole flag indicating to start the debugger in a |
460 console window (boolean) |
467 console window |
461 @keyparam interpreter interpreter to be used to execute the remote |
468 @type bool |
462 side (string) |
469 @keyparam venvName name of the virtual environment to be used |
|
470 @type str |
463 """ |
471 """ |
464 self.running = False |
472 self.running = False |
465 |
473 |
466 if not self.passive or not self.passiveClientExited: |
474 if not self.passive or not self.passiveClientExited: |
467 if self.debuggerInterface and self.debuggerInterface.isConnected(): |
475 if self.debuggerInterface and self.debuggerInterface.isConnected(): |
468 self.shutdownServer() |
476 self.shutdownServer() |
469 self.clientGone.emit(unplanned and self.debugging) |
477 self.clientGone.emit(unplanned and self.debugging) |
470 |
478 |
471 if clType: |
479 if clType: |
|
480 if clType not in self.getSupportedLanguages(): |
|
481 # a not supported client language was requested |
|
482 return |
|
483 |
472 self.__setClientType(clType) |
484 self.__setClientType(clType) |
473 |
485 |
474 # only start the client, if we are not in passive mode |
486 # only start the client, if we are not in passive mode |
475 if not self.passive: |
487 if not self.passive: |
476 if self.clientProcess: |
488 if self.clientProcess: |
483 if forProject: |
495 if forProject: |
484 project = e5App().getObject("Project") |
496 project = e5App().getObject("Project") |
485 if not project.isDebugPropertiesLoaded(): |
497 if not project.isDebugPropertiesLoaded(): |
486 self.clientProcess, isNetworked, clientInterpreter = \ |
498 self.clientProcess, isNetworked, clientInterpreter = \ |
487 self.debuggerInterface.startRemote( |
499 self.debuggerInterface.startRemote( |
488 self.serverPort(), runInConsole, interpreter) |
500 self.serverPort(), runInConsole, venvName) |
489 else: |
501 else: |
490 self.clientProcess, isNetworked, clientInterpreter = \ |
502 self.clientProcess, isNetworked, clientInterpreter = \ |
491 self.debuggerInterface.startRemoteForProject( |
503 self.debuggerInterface.startRemoteForProject( |
492 self.serverPort(), runInConsole, interpreter) |
504 self.serverPort(), runInConsole, venvName) |
493 else: |
505 else: |
494 self.clientProcess, isNetworked, clientInterpreter = \ |
506 self.clientProcess, isNetworked, clientInterpreter = \ |
495 self.debuggerInterface.startRemote( |
507 self.debuggerInterface.startRemote( |
496 self.serverPort(), runInConsole, interpreter) |
508 self.serverPort(), runInConsole, venvName) |
497 |
509 |
498 if self.clientProcess: |
510 if self.clientProcess: |
499 self.clientProcess.readyReadStandardError.connect( |
511 self.clientProcess.readyReadStandardError.connect( |
500 self.__clientProcessError) |
512 self.__clientProcessError) |
501 self.clientProcess.readyReadStandardOutput.connect( |
513 self.clientProcess.readyReadStandardOutput.connect( |
731 Public method to get the interpreter of the debug client. |
743 Public method to get the interpreter of the debug client. |
732 |
744 |
733 @return interpreter of the debug client (string) |
745 @return interpreter of the debug client (string) |
734 """ |
746 """ |
735 return self.clientInterpreter |
747 return self.clientInterpreter |
736 |
748 |
|
749 def getClientType(self): |
|
750 """ |
|
751 Public method to get the currently running debug client type. |
|
752 |
|
753 @return debug client type |
|
754 @rtype str |
|
755 """ |
|
756 return self.clientType |
|
757 |
|
758 def isClientProcessUp(self): |
|
759 """ |
|
760 Public method to check, if the debug client process is up. |
|
761 |
|
762 @return flag indicating a running debug client process |
|
763 @rtype bool |
|
764 """ |
|
765 return self.clientProcess is not None |
|
766 |
737 def __newConnection(self): |
767 def __newConnection(self): |
738 """ |
768 """ |
739 Private slot to handle a new connection. |
769 Private slot to handle a new connection. |
740 """ |
770 """ |
741 sock = self.nextPendingConnection() |
771 sock = self.nextPendingConnection() |
802 envdict[key] = value |
832 envdict[key] = value |
803 except ValueError: |
833 except ValueError: |
804 pass |
834 pass |
805 self.debuggerInterface.remoteEnvironment(envdict) |
835 self.debuggerInterface.remoteEnvironment(envdict) |
806 |
836 |
807 def remoteLoad(self, interpreter, fn, argv, wd, env, autoClearShell=True, |
837 def remoteLoad(self, venvName, fn, argv, wd, env, autoClearShell=True, |
808 tracePython=False, autoContinue=True, forProject=False, |
838 tracePython=False, autoContinue=True, forProject=False, |
809 runInConsole=False, autoFork=False, forkChild=False, |
839 runInConsole=False, autoFork=False, forkChild=False, |
810 clientType="", enableCallTrace=False): |
840 clientType="", enableCallTrace=False): |
811 """ |
841 """ |
812 Public method to load a new program to debug. |
842 Public method to load a new program to debug. |
813 |
843 |
814 @param interpreter interpreter to be used to execute the remote |
844 @param venvName name of the virtual environment to be used |
815 side (string) |
845 @type str |
816 @param fn the filename to debug (string) |
846 @param fn the filename to debug |
817 @param argv the commandline arguments to pass to the program (string) |
847 @type str |
818 @param wd the working directory for the program (string) |
848 @param argv the command line arguments to pass to the program |
819 @param env environment settings (string) |
849 @type str |
|
850 @param wd the working directory for the program |
|
851 @type str |
|
852 @param env environment parameter settings |
|
853 @type str |
820 @keyparam autoClearShell flag indicating, that the interpreter window |
854 @keyparam autoClearShell flag indicating, that the interpreter window |
821 should be cleared (boolean) |
855 should be cleared |
|
856 @type bool |
822 @keyparam tracePython flag indicating if the Python library should be |
857 @keyparam tracePython flag indicating if the Python library should be |
823 traced as well (boolean) |
858 traced as well |
|
859 @type bool |
824 @keyparam autoContinue flag indicating, that the debugger should not |
860 @keyparam autoContinue flag indicating, that the debugger should not |
825 stop at the first executable line (boolean) |
861 stop at the first executable line |
826 @keyparam forProject flag indicating a project related action (boolean) |
862 @type bool |
|
863 @keyparam forProject flag indicating a project related action |
|
864 @type bool |
827 @keyparam runInConsole flag indicating to start the debugger in a |
865 @keyparam runInConsole flag indicating to start the debugger in a |
828 console window (boolean) |
866 console window |
829 @keyparam autoFork flag indicating the automatic fork mode (boolean) |
867 @type bool |
|
868 @keyparam autoFork flag indicating the automatic fork mode |
|
869 @type bool |
830 @keyparam forkChild flag indicating to debug the child after forking |
870 @keyparam forkChild flag indicating to debug the child after forking |
831 (boolean) |
871 @type bool |
832 @keyparam clientType client type to be used (string) |
872 @keyparam clientType client type to be used |
|
873 @type str |
833 @keyparam enableCallTrace flag indicating to enable the call trace |
874 @keyparam enableCallTrace flag indicating to enable the call trace |
834 function (boolean) |
875 function |
|
876 @type bool |
835 """ |
877 """ |
836 self.__autoClearShell = autoClearShell |
878 self.__autoClearShell = autoClearShell |
837 self.__autoContinue = autoContinue |
879 self.__autoContinue = autoContinue |
|
880 |
|
881 if clientType not in self.getSupportedLanguages(): |
|
882 # a not supported client language was requested |
|
883 E5MessageBox.critical( |
|
884 None, |
|
885 self.tr("Start Debugger"), |
|
886 self.tr( |
|
887 """<p>The debugger type <b>{0}</b> is not supported""" |
|
888 """ or not configured.</p>""").format(clientType) |
|
889 ) |
|
890 return |
838 |
891 |
839 # Restart the client |
892 # Restart the client |
840 try: |
893 try: |
841 if clientType: |
894 if clientType: |
842 self.__setClientType(clientType) |
895 self.__setClientType(clientType) |
844 self.__setClientType( |
897 self.__setClientType( |
845 self.__findLanguageForExtension(os.path.splitext(fn)[1])) |
898 self.__findLanguageForExtension(os.path.splitext(fn)[1])) |
846 except KeyError: |
899 except KeyError: |
847 self.__setClientType('Python3') # assume it is a Python3 file |
900 self.__setClientType('Python3') # assume it is a Python3 file |
848 self.startClient(False, forProject=forProject, |
901 self.startClient(False, forProject=forProject, |
849 runInConsole=runInConsole, interpreter=interpreter) |
902 runInConsole=runInConsole, venvName=venvName) |
850 |
903 |
851 self.setCallTraceEnabled(enableCallTrace) |
904 self.setCallTraceEnabled(enableCallTrace) |
852 self.remoteEnvironment(env) |
905 self.remoteEnvironment(env) |
853 |
906 |
854 self.debuggerInterface.remoteLoad(fn, argv, wd, tracePython, |
907 self.debuggerInterface.remoteLoad(fn, argv, wd, tracePython, |
856 self.debugging = True |
909 self.debugging = True |
857 self.running = True |
910 self.running = True |
858 self.__restoreBreakpoints() |
911 self.__restoreBreakpoints() |
859 self.__restoreWatchpoints() |
912 self.__restoreWatchpoints() |
860 |
913 |
861 def remoteRun(self, interpreter, fn, argv, wd, env, autoClearShell=True, |
914 def remoteRun(self, venvName, fn, argv, wd, env, autoClearShell=True, |
862 forProject=False, runInConsole=False, autoFork=False, |
915 forProject=False, runInConsole=False, autoFork=False, |
863 forkChild=False, clientType=""): |
916 forkChild=False, clientType=""): |
864 """ |
917 """ |
865 Public method to load a new program to run. |
918 Public method to load a new program to run. |
866 |
919 |
867 @param interpreter interpreter to be used to execute the remote |
920 @param venvName name of the virtual environment to be used |
868 side (string) |
921 @type str |
869 @param fn the filename to run (string) |
922 @param fn the filename to debug |
870 @param argv the commandline arguments to pass to the program (string) |
923 @type str |
871 @param wd the working directory for the program (string) |
924 @param argv the command line arguments to pass to the program |
872 @param env environment settings (string) |
925 @type str |
|
926 @param wd the working directory for the program |
|
927 @type str |
|
928 @param env environment parameter settings |
|
929 @type str |
873 @keyparam autoClearShell flag indicating, that the interpreter window |
930 @keyparam autoClearShell flag indicating, that the interpreter window |
874 should be cleared (boolean) |
931 should be cleared |
875 @keyparam forProject flag indicating a project related action (boolean) |
932 @type bool |
|
933 @keyparam forProject flag indicating a project related action |
|
934 @type bool |
876 @keyparam runInConsole flag indicating to start the debugger in a |
935 @keyparam runInConsole flag indicating to start the debugger in a |
877 console window (boolean) |
936 console window |
878 @keyparam autoFork flag indicating the automatic fork mode (boolean) |
937 @type bool |
|
938 @keyparam autoFork flag indicating the automatic fork mode |
|
939 @type bool |
879 @keyparam forkChild flag indicating to debug the child after forking |
940 @keyparam forkChild flag indicating to debug the child after forking |
880 (boolean) |
941 @type bool |
881 @keyparam clientType client type to be used (string) |
942 @keyparam clientType client type to be used |
|
943 @type str |
882 """ |
944 """ |
883 self.__autoClearShell = autoClearShell |
945 self.__autoClearShell = autoClearShell |
|
946 |
|
947 if clientType not in self.getSupportedLanguages(): |
|
948 E5MessageBox.critical( |
|
949 None, |
|
950 self.tr("Start Debugger"), |
|
951 self.tr( |
|
952 """<p>The debugger type <b>{0}</b> is not supported""" |
|
953 """ or not configured.</p>""").format(clientType) |
|
954 ) |
|
955 # a not supported client language was requested |
|
956 return |
884 |
957 |
885 # Restart the client |
958 # Restart the client |
886 try: |
959 try: |
887 if clientType: |
960 if clientType: |
888 self.__setClientType(clientType) |
961 self.__setClientType(clientType) |
890 self.__setClientType( |
963 self.__setClientType( |
891 self.__findLanguageForExtension(os.path.splitext(fn)[1])) |
964 self.__findLanguageForExtension(os.path.splitext(fn)[1])) |
892 except KeyError: |
965 except KeyError: |
893 self.__setClientType('Python3') # assume it is a Python3 file |
966 self.__setClientType('Python3') # assume it is a Python3 file |
894 self.startClient(False, forProject=forProject, |
967 self.startClient(False, forProject=forProject, |
895 runInConsole=runInConsole, interpreter=interpreter) |
968 runInConsole=runInConsole, venvName=venvName) |
896 |
969 |
897 self.remoteEnvironment(env) |
970 self.remoteEnvironment(env) |
898 |
971 |
899 self.debuggerInterface.remoteRun(fn, argv, wd, autoFork, forkChild) |
972 self.debuggerInterface.remoteRun(fn, argv, wd, autoFork, forkChild) |
900 self.debugging = False |
973 self.debugging = False |
901 self.running = True |
974 self.running = True |
902 |
975 |
903 def remoteCoverage(self, interpreter, fn, argv, wd, env, |
976 def remoteCoverage(self, venvName, fn, argv, wd, env, |
904 autoClearShell=True, erase=False, forProject=False, |
977 autoClearShell=True, erase=False, forProject=False, |
905 runInConsole=False, clientType=""): |
978 runInConsole=False, clientType=""): |
906 """ |
979 """ |
907 Public method to load a new program to collect coverage data. |
980 Public method to load a new program to collect coverage data. |
908 |
981 |
909 @param interpreter interpreter to be used to execute the remote |
982 @param venvName name of the virtual environment to be used |
910 side (string) |
983 @type str |
911 @param fn the filename to run (string) |
984 @param fn the filename to debug |
912 @param argv the commandline arguments to pass to the program (string) |
985 @type str |
913 @param wd the working directory for the program (string) |
986 @param argv the command line arguments to pass to the program |
914 @param env environment settings (string) |
987 @type str |
|
988 @param wd the working directory for the program |
|
989 @type str |
|
990 @param env environment parameter settings |
|
991 @type str |
915 @keyparam autoClearShell flag indicating, that the interpreter window |
992 @keyparam autoClearShell flag indicating, that the interpreter window |
916 should be cleared (boolean) |
993 should be cleared |
|
994 @type bool |
917 @keyparam erase flag indicating that coverage info should be |
995 @keyparam erase flag indicating that coverage info should be |
918 cleared first (boolean) |
996 cleared first |
919 @keyparam forProject flag indicating a project related action (boolean) |
997 @type bool |
|
998 @keyparam forProject flag indicating a project related action |
|
999 @type bool |
920 @keyparam runInConsole flag indicating to start the debugger in a |
1000 @keyparam runInConsole flag indicating to start the debugger in a |
921 console window (boolean) |
1001 console window |
922 @keyparam clientType client type to be used (string) |
1002 @type bool |
|
1003 @keyparam clientType client type to be used |
|
1004 @type str |
923 """ |
1005 """ |
924 self.__autoClearShell = autoClearShell |
1006 self.__autoClearShell = autoClearShell |
|
1007 |
|
1008 if clientType not in self.getSupportedLanguages(): |
|
1009 # a not supported client language was requested |
|
1010 E5MessageBox.critical( |
|
1011 None, |
|
1012 self.tr("Start Debugger"), |
|
1013 self.tr( |
|
1014 """<p>The debugger type <b>{0}</b> is not supported""" |
|
1015 """ or not configured.</p>""").format(clientType) |
|
1016 ) |
|
1017 return |
925 |
1018 |
926 # Restart the client |
1019 # Restart the client |
927 try: |
1020 try: |
928 if clientType: |
1021 if clientType: |
929 self.__setClientType(clientType) |
1022 self.__setClientType(clientType) |
931 self.__setClientType( |
1024 self.__setClientType( |
932 self.__findLanguageForExtension(os.path.splitext(fn)[1])) |
1025 self.__findLanguageForExtension(os.path.splitext(fn)[1])) |
933 except KeyError: |
1026 except KeyError: |
934 self.__setClientType('Python3') # assume it is a Python3 file |
1027 self.__setClientType('Python3') # assume it is a Python3 file |
935 self.startClient(False, forProject=forProject, |
1028 self.startClient(False, forProject=forProject, |
936 runInConsole=runInConsole, interpreter=interpreter) |
1029 runInConsole=runInConsole, venvName=venvName) |
937 |
1030 |
938 self.remoteEnvironment(env) |
1031 self.remoteEnvironment(env) |
939 |
1032 |
940 self.debuggerInterface.remoteCoverage(fn, argv, wd, erase) |
1033 self.debuggerInterface.remoteCoverage(fn, argv, wd, erase) |
941 self.debugging = False |
1034 self.debugging = False |
942 self.running = True |
1035 self.running = True |
943 |
1036 |
944 def remoteProfile(self, interpreter, fn, argv, wd, env, |
1037 def remoteProfile(self, venvName, fn, argv, wd, env, |
945 autoClearShell=True, erase=False, forProject=False, |
1038 autoClearShell=True, erase=False, forProject=False, |
946 runInConsole=False, clientType=""): |
1039 runInConsole=False, clientType=""): |
947 """ |
1040 """ |
948 Public method to load a new program to collect profiling data. |
1041 Public method to load a new program to collect profiling data. |
949 |
1042 |
950 @param interpreter interpreter to be used to execute the remote |
1043 @param venvName name of the virtual environment to be used |
951 side (string) |
1044 @type str |
952 @param fn the filename to run (string) |
1045 @param fn the filename to debug |
953 @param argv the commandline arguments to pass to the program (string) |
1046 @type str |
954 @param wd the working directory for the program (string) |
1047 @param argv the command line arguments to pass to the program |
955 @param env environment settings (string) |
1048 @type str |
|
1049 @param wd the working directory for the program |
|
1050 @type str |
|
1051 @param env environment parameter settings |
|
1052 @type str |
956 @keyparam autoClearShell flag indicating, that the interpreter window |
1053 @keyparam autoClearShell flag indicating, that the interpreter window |
957 should be cleared (boolean) |
1054 should be cleared |
958 @keyparam erase flag indicating that timing info should be cleared |
1055 @type bool |
959 first (boolean) |
1056 @keyparam erase flag indicating that coverage info should be |
960 @keyparam forProject flag indicating a project related action (boolean) |
1057 cleared first |
|
1058 @type bool |
|
1059 @keyparam forProject flag indicating a project related action |
|
1060 @type bool |
961 @keyparam runInConsole flag indicating to start the debugger in a |
1061 @keyparam runInConsole flag indicating to start the debugger in a |
962 console window (boolean) |
1062 console window |
963 @keyparam clientType client type to be used (string) |
1063 @type bool |
|
1064 @keyparam clientType client type to be used |
|
1065 @type str |
964 """ |
1066 """ |
965 self.__autoClearShell = autoClearShell |
1067 self.__autoClearShell = autoClearShell |
|
1068 |
|
1069 if clientType not in self.getSupportedLanguages(): |
|
1070 # a not supported client language was requested |
|
1071 E5MessageBox.critical( |
|
1072 None, |
|
1073 self.tr("Start Debugger"), |
|
1074 self.tr( |
|
1075 """<p>The debugger type <b>{0}</b> is not supported""" |
|
1076 """ or not configured.</p>""").format(clientType) |
|
1077 ) |
|
1078 return |
966 |
1079 |
967 # Restart the client |
1080 # Restart the client |
968 try: |
1081 try: |
969 if clientType: |
1082 if clientType: |
970 self.__setClientType(clientType) |
1083 self.__setClientType(clientType) |
972 self.__setClientType( |
1085 self.__setClientType( |
973 self.__findLanguageForExtension(os.path.splitext(fn)[1])) |
1086 self.__findLanguageForExtension(os.path.splitext(fn)[1])) |
974 except KeyError: |
1087 except KeyError: |
975 self.__setClientType('Python3') # assume it is a Python3 file |
1088 self.__setClientType('Python3') # assume it is a Python3 file |
976 self.startClient(False, forProject=forProject, |
1089 self.startClient(False, forProject=forProject, |
977 runInConsole=runInConsole, interpreter=interpreter) |
1090 runInConsole=runInConsole, venvName=venvName) |
978 |
1091 |
979 self.remoteEnvironment(env) |
1092 self.remoteEnvironment(env) |
980 |
1093 |
981 self.debuggerInterface.remoteProfile(fn, argv, wd, erase) |
1094 self.debuggerInterface.remoteProfile(fn, argv, wd, erase) |
982 self.debugging = False |
1095 self.debugging = False |
1430 Public method to process the client capabilities info. |
1554 Public method to process the client capabilities info. |
1431 |
1555 |
1432 @param capabilities bitmaks with the client capabilities (integer) |
1556 @param capabilities bitmaks with the client capabilities (integer) |
1433 @param clientType type of the debug client (string) |
1557 @param clientType type of the debug client (string) |
1434 """ |
1558 """ |
1435 self.__debuggerInterfaceRegistry[clientType][0] = capabilities |
1559 try: |
1436 self.clientCapabilities.emit(capabilities, clientType) |
1560 self.__debuggerInterfaceRegistry[clientType][0] = capabilities |
|
1561 self.clientCapabilities.emit(capabilities, clientType) |
|
1562 except KeyError: |
|
1563 # ignore silently |
|
1564 pass |
1437 |
1565 |
1438 def signalClientCompletionList(self, completionList, text): |
1566 def signalClientCompletionList(self, completionList, text): |
1439 """ |
1567 """ |
1440 Public method to process the client auto completion info. |
1568 Public method to process the client auto completion info. |
1441 |
1569 |