eric6/Debugger/DebugServer.py

branch
maintenance
changeset 8142
43248bafe9b2
parent 8043
0acf98cd089a
parent 8138
169e65a6787c
child 8176
31965986ecd1
diff -r 874fdd14d3a2 -r 43248bafe9b2 eric6/Debugger/DebugServer.py
--- a/eric6/Debugger/DebugServer.py	Mon Feb 01 10:38:43 2021 +0100
+++ b/eric6/Debugger/DebugServer.py	Tue Mar 02 17:12:08 2021 +0100
@@ -8,6 +8,7 @@
 """
 
 import os
+import shlex
 
 from PyQt5.QtCore import pyqtSignal, pyqtSlot, QModelIndex
 from PyQt5.QtNetwork import (
@@ -22,7 +23,6 @@
 from . import DebugClientCapabilities
 
 import Preferences
-import Utilities
 
 
 DebuggerInterfaces = {
@@ -73,6 +73,8 @@
     @signal clientExit(str, int, str, bool, str) emitted after the client has
         exited giving the program name, the exit status, an exit message, an
         indication to be quiet and the ID of the exited client
+    @signal mainClientExit() emitted to indicate that the main client process
+        has exited
     @signal lastClientExited() emitted to indicate that the last connected
         debug client has terminated
     @signal clientClearBreak(filename, lineno, debuggerId) emitted after the
@@ -145,6 +147,7 @@
     clientSignal = pyqtSignal(str, str, int, str, str, str)
     clientDisconnected = pyqtSignal(str)
     clientExit = pyqtSignal(str, int, str, bool, str)
+    mainClientExit = pyqtSignal()
     lastClientExited = pyqtSignal()
     clientBreakConditionError = pyqtSignal(str, int, str)
     clientWatchConditionError = pyqtSignal(str, str)
@@ -168,15 +171,18 @@
     callTraceInfo = pyqtSignal(bool, str, str, str, str, str, str, str)
     appendStdout = pyqtSignal(str)
     
-    def __init__(self, originalPathString, preventPassiveDebugging=False):
+    def __init__(self, originalPathString, preventPassiveDebugging=False,
+                 project=None):
         """
         Constructor
         
         @param originalPathString original PATH environment variable
         @type str
         @param preventPassiveDebugging flag overriding the PassiveDbgEnabled
-            setting
-        @type bool
+            setting (defaults to False)
+        @type bool (optional)
+        @param project reference to the project object (defaults to None)
+        @type Project (optional)
         """
         super(DebugServer, self).__init__()
         
@@ -193,7 +199,7 @@
         # the value
         
         # create our models
-        self.breakpointModel = BreakPointModel(self)
+        self.breakpointModel = BreakPointModel(project, self)
         self.watchpointModel = WatchPointModel(self)
         self.watchSpecialCreated = self.tr(
             "created", "must be same as in EditWatchpointDialog")
@@ -910,16 +916,14 @@
         @param env environment settings
         @type str
         """
-        envlist = Utilities.parseEnvironmentString(env)
+        envlist = shlex.split(env)
         envdict = {}
         for el in envlist:
-            try:
+            if '=' in el:
                 key, value = el.split('=', 1)
-                if value.startswith('"') or value.startswith("'"):
-                    value = value[1:-1]
                 envdict[key] = value
-            except ValueError:
-                pass
+            else:
+                envdict[el] = ""
         self.debuggerInterface.remoteEnvironment(envdict)
     
     def remoteLoad(self, venvName, fn, argv, wd, env, autoClearShell=True,
@@ -1849,6 +1853,12 @@
         """
         self.clientExit.emit(program, int(status), message, False, debuggerId)
     
+    def signalMainClientExit(self):
+        """
+        Public method to process the main client exiting.
+        """
+        self.mainClientExit.emit()
+    
     def signalLastClientExited(self):
         """
         Public method to process the last client exit event.

eric ide

mercurial