106 self.forkAutomatically = Preferences.toBool( |
106 self.forkAutomatically = Preferences.toBool( |
107 Preferences.Prefs.settings.value( |
107 Preferences.Prefs.settings.value( |
108 'DebugInfo/ForkAutomatically', False)) |
108 'DebugInfo/ForkAutomatically', False)) |
109 self.forkIntoChild = Preferences.toBool( |
109 self.forkIntoChild = Preferences.toBool( |
110 Preferences.Prefs.settings.value('DebugInfo/ForkIntoChild', False)) |
110 Preferences.Prefs.settings.value('DebugInfo/ForkIntoChild', False)) |
|
111 self.enableMultiprocess = Preferences.toBool( |
|
112 Preferences.Prefs.settings.value( |
|
113 'DebugInfo/EnableMultiprocess', False)) |
111 |
114 |
112 self.lastDebuggedFile = None |
115 self.lastDebuggedFile = None |
113 self.lastStartAction = 0 # 0=None, 1=Script, 2=Project |
116 self.lastStartAction = 0 # 0=None, 1=Script, 2=Project |
114 self.clientType = "" |
117 self.clientType = "" |
115 self.lastAction = -1 |
118 self.lastAction = -1 |
954 'DebugInfo/AutoContinue', self.autoContinue) |
957 'DebugInfo/AutoContinue', self.autoContinue) |
955 Preferences.Prefs.settings.setValue( |
958 Preferences.Prefs.settings.setValue( |
956 'DebugInfo/ForkAutomatically', self.forkAutomatically) |
959 'DebugInfo/ForkAutomatically', self.forkAutomatically) |
957 Preferences.Prefs.settings.setValue( |
960 Preferences.Prefs.settings.setValue( |
958 'DebugInfo/ForkIntoChild', self.forkIntoChild) |
961 'DebugInfo/ForkIntoChild', self.forkIntoChild) |
|
962 Preferences.Prefs.settings.setValue( |
|
963 'DebugInfo/EnableMultiprocess', self.enableMultiprocess) |
959 |
964 |
960 def shutdownServer(self): |
965 def shutdownServer(self): |
961 """ |
966 """ |
962 Public method to shut down the debug server. |
967 Public method to shut down the debug server. |
963 |
968 |
2027 dlg = StartDialog( |
2032 dlg = StartDialog( |
2028 cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory, |
2033 cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory, |
2029 self.envHistory, self.exceptions, self.ui, 0, |
2034 self.envHistory, self.exceptions, self.ui, 0, |
2030 tracePython=self.tracePython, autoClearShell=self.autoClearShell, |
2035 tracePython=self.tracePython, autoClearShell=self.autoClearShell, |
2031 autoContinue=self.autoContinue, autoFork=self.forkAutomatically, |
2036 autoContinue=self.autoContinue, autoFork=self.forkAutomatically, |
2032 forkChild=self.forkIntoChild) |
2037 forkChild=self.forkIntoChild, |
|
2038 enableMultiprocess=self.enableMultiprocess) |
2033 if dlg.exec_() == QDialog.Accepted: |
2039 if dlg.exec_() == QDialog.Accepted: |
2034 (lastUsedVenvName, argv, wd, env, exceptions, clearShell, |
2040 (lastUsedVenvName, argv, wd, env, exceptions, clearShell, |
2035 console) = dlg.getData() |
2041 console) = dlg.getData() |
2036 tracePython, autoContinue, forkAutomatically, forkIntoChild = ( |
2042 (tracePython, autoContinue, forkAutomatically, forkIntoChild, |
2037 dlg.getDebugData()) |
2043 enableMultiprocess) = dlg.getDebugData() |
2038 |
2044 |
2039 if debugProject: |
2045 if debugProject: |
2040 fn = self.project.getMainScript(True) |
2046 fn = self.project.getMainScript(True) |
2041 if fn is None: |
2047 if fn is None: |
2042 E5MessageBox.critical( |
2048 E5MessageBox.critical( |
2107 |
2113 |
2108 # Save the forking flags |
2114 # Save the forking flags |
2109 self.forkAutomatically = forkAutomatically |
2115 self.forkAutomatically = forkAutomatically |
2110 self.forkIntoChild = forkIntoChild |
2116 self.forkIntoChild = forkIntoChild |
2111 |
2117 |
|
2118 # Save the multiprocess debugging flag |
|
2119 self.enableMultiprocess = enableMultiprocess |
|
2120 |
2112 # Hide all error highlights |
2121 # Hide all error highlights |
2113 self.viewmanager.unhighlight() |
2122 self.viewmanager.unhighlight() |
2114 |
2123 |
2115 if not doNotStart: |
2124 if not doNotStart: |
2116 if debugProject and self.project.getProjectType() in [ |
2125 if debugProject and self.project.getProjectType() in [ |
2132 autoClearShell=self.autoClearShell, |
2141 autoClearShell=self.autoClearShell, |
2133 tracePython=tracePython, |
2142 tracePython=tracePython, |
2134 autoContinue=autoContinue, forProject=debugProject, |
2143 autoContinue=autoContinue, forProject=debugProject, |
2135 runInConsole=console, autoFork=forkAutomatically, |
2144 runInConsole=console, autoFork=forkAutomatically, |
2136 forkChild=forkIntoChild, clientType=self.clientType, |
2145 forkChild=forkIntoChild, clientType=self.clientType, |
2137 enableCallTrace=enableCallTrace) |
2146 enableCallTrace=enableCallTrace, |
|
2147 enableMultiprocess=enableMultiprocess) |
2138 |
2148 |
2139 if ( |
2149 if ( |
2140 self.debugServer.isClientProcessUp() and |
2150 self.debugServer.isClientProcessUp() and |
2141 self.debugServer.getClientType() == self.clientType |
2151 self.debugServer.getClientType() == self.clientType |
2142 ): |
2152 ): |
2217 forProject=forProject, |
2227 forProject=forProject, |
2218 runInConsole=self.runInConsole, |
2228 runInConsole=self.runInConsole, |
2219 autoFork=self.forkAutomatically, |
2229 autoFork=self.forkAutomatically, |
2220 forkChild=self.forkIntoChild, |
2230 forkChild=self.forkIntoChild, |
2221 clientType=self.clientType, |
2231 clientType=self.clientType, |
2222 enableCallTrace=enableCallTrace) |
2232 enableCallTrace=enableCallTrace, |
|
2233 enableMultiprocess=self.enableMultiprocess) |
2223 |
2234 |
2224 # Signal that we have started a debugging session |
2235 # Signal that we have started a debugging session |
2225 self.debuggingStarted.emit(fn) |
2236 self.debuggingStarted.emit(fn) |
2226 |
2237 |
2227 elif self.lastStartAction in [3, 4]: |
2238 elif self.lastStartAction in [3, 4]: |