eric6/Debugger/DebugServer.py

branch
maintenance
changeset 8176
31965986ecd1
parent 8142
43248bafe9b2
parent 8163
29fb6d420a25
child 8273
698ae46f40a4
--- a/eric6/Debugger/DebugServer.py	Sat Mar 06 10:00:52 2021 +0100
+++ b/eric6/Debugger/DebugServer.py	Sun Mar 28 15:00:11 2021 +0200
@@ -172,7 +172,7 @@
     appendStdout = pyqtSignal(str)
     
     def __init__(self, originalPathString, preventPassiveDebugging=False,
-                 project=None):
+                 project=None, parent=None):
         """
         Constructor
         
@@ -183,8 +183,10 @@
         @type bool (optional)
         @param project reference to the project object (defaults to None)
         @type Project (optional)
+        @param parent reference to the parent object
+        @type QObject
         """
-        super(DebugServer, self).__init__()
+        super(DebugServer, self).__init__(parent)
         
         self.__originalPathString = originalPathString
         
@@ -212,9 +214,11 @@
         
         self.networkInterface = Preferences.getDebugger("NetworkInterface")
         if self.networkInterface == "all":
-            hostAddress = QHostAddress("0.0.0.0")  # QHostAddress.Any)  # secok
+            hostAddress = QHostAddress("0.0.0.0")
+            # QHostAddress.SpecialAddress.Any)  # secok
         elif self.networkInterface == "allv6":
-            hostAddress = QHostAddress("::")  # QHostAddress.AnyIPv6)
+            hostAddress = QHostAddress("::")
+            # QHostAddress.SpecialAddress.AnyIPv6)
         else:
             hostAddress = QHostAddress(self.networkInterface)
         self.networkInterfaceName, self.networkInterfaceIndex = (
@@ -480,7 +484,8 @@
                 'DebugClient/Type', self.clientType)
     
     def startClient(self, unplanned=True, clType=None, forProject=False,
-                    runInConsole=False, venvName="", workingDir=None):
+                    runInConsole=False, venvName="", workingDir=None,
+                    configOverride=None):
         """
         Public method to start a debug client.
         
@@ -497,6 +502,9 @@
         @type str
         @param workingDir directory to start the debugger client in
         @type str
+        @param configOverride dictionary containing the global config override
+            data
+        @type dict
         """
         self.running = False
         
@@ -529,17 +537,20 @@
                     self.clientProcess, isNetworked, clientInterpreter = (
                         self.debuggerInterface.startRemote(
                             self.serverPort(), runInConsole, venvName,
-                            self.__originalPathString, workingDir=workingDir))
+                            self.__originalPathString, workingDir=workingDir,
+                            configOverride=configOverride))
                 else:
                     self.clientProcess, isNetworked, clientInterpreter = (
                         self.debuggerInterface.startRemoteForProject(
                             self.serverPort(), runInConsole, venvName,
-                            self.__originalPathString, workingDir=workingDir))
+                            self.__originalPathString, workingDir=workingDir,
+                            configOverride=configOverride))
             else:
                 self.clientProcess, isNetworked, clientInterpreter = (
                     self.debuggerInterface.startRemote(
                         self.serverPort(), runInConsole, venvName,
-                        self.__originalPathString, workingDir=workingDir))
+                        self.__originalPathString, workingDir=workingDir,
+                        configOverride=configOverride))
             
             if self.clientProcess:
                 self.clientProcess.readyReadStandardError.connect(
@@ -929,7 +940,8 @@
     def remoteLoad(self, venvName, fn, argv, wd, env, autoClearShell=True,
                    tracePython=False, autoContinue=True, forProject=False,
                    runInConsole=False, clientType="", enableCallTrace=False,
-                   enableMultiprocess=False, multiprocessNoDebug=""):
+                   enableMultiprocess=False, multiprocessNoDebug="",
+                   configOverride=None):
         """
         Public method to load a new program to debug.
         
@@ -968,6 +980,9 @@
         @param multiprocessNoDebug space separated list of programs not to be
             debugged
         @type str
+        @param configOverride dictionary containing the global config override
+            data
+        @type dict
         """
         self.__autoClearShell = autoClearShell
         self.__multiprocessNoDebugList = [
@@ -995,7 +1010,8 @@
         except KeyError:
             self.__setClientType('Python3')    # assume it is a Python3 file
         self.startClient(False, forProject=forProject,
-                         runInConsole=runInConsole, venvName=venvName)
+                         runInConsole=runInConsole, venvName=venvName,
+                         configOverride=configOverride)
         
         self.setCallTraceEnabled("", enableCallTrace)
         self.remoteEnvironment(env)
@@ -1011,7 +1027,8 @@
         self.__restoreNoDebugList()
     
     def remoteRun(self, venvName, fn, argv, wd, env, autoClearShell=True,
-                  forProject=False, runInConsole=False, clientType=""):
+                  forProject=False, runInConsole=False, clientType="",
+                  configOverride=None):
         """
         Public method to load a new program to run.
         
@@ -1035,6 +1052,9 @@
         @type bool
         @param clientType client type to be used
         @type str
+        @param configOverride dictionary containing the global config override
+            data
+        @type dict
         """
         self.__autoClearShell = autoClearShell
         
@@ -1059,7 +1079,8 @@
         except KeyError:
             self.__setClientType('Python3')    # assume it is a Python3 file
         self.startClient(False, forProject=forProject,
-                         runInConsole=runInConsole, venvName=venvName)
+                         runInConsole=runInConsole, venvName=venvName,
+                         configOverride=configOverride)
         
         self.remoteEnvironment(env)
         
@@ -1069,7 +1090,7 @@
     
     def remoteCoverage(self, venvName, fn, argv, wd, env,
                        autoClearShell=True, erase=False, forProject=False,
-                       runInConsole=False, clientType=""):
+                       runInConsole=False, clientType="", configOverride=None):
         """
         Public method to load a new program to collect coverage data.
         
@@ -1096,6 +1117,9 @@
         @type bool
         @param clientType client type to be used
         @type str
+        @param configOverride dictionary containing the global config override
+            data
+        @type dict
         """
         self.__autoClearShell = autoClearShell
         
@@ -1120,7 +1144,8 @@
         except KeyError:
             self.__setClientType('Python3')    # assume it is a Python3 file
         self.startClient(False, forProject=forProject,
-                         runInConsole=runInConsole, venvName=venvName)
+                         runInConsole=runInConsole, venvName=venvName,
+                         configOverride=configOverride)
         
         self.remoteEnvironment(env)
         
@@ -1130,7 +1155,7 @@
     
     def remoteProfile(self, venvName, fn, argv, wd, env,
                       autoClearShell=True, erase=False, forProject=False,
-                      runInConsole=False, clientType=""):
+                      runInConsole=False, clientType="", configOverride=None):
         """
         Public method to load a new program to collect profiling data.
         
@@ -1157,6 +1182,9 @@
         @type bool
         @param clientType client type to be used
         @type str
+        @param configOverride dictionary containing the global config override
+            data
+        @type dict
         """
         self.__autoClearShell = autoClearShell
         
@@ -1181,7 +1209,8 @@
         except KeyError:
             self.__setClientType('Python3')    # assume it is a Python3 file
         self.startClient(False, forProject=forProject,
-                         runInConsole=runInConsole, venvName=venvName)
+                         runInConsole=runInConsole, venvName=venvName,
+                         configOverride=configOverride)
         
         self.remoteEnvironment(env)
         

eric ide

mercurial