src/eric7/Debugger/DebuggerInterfacePython.py

branch
server
changeset 10564
0de57f082daa
parent 10561
be23a662d709
child 10597
fbe93720ee9f
diff -r b4b47c1a02ba -r 0de57f082daa src/eric7/Debugger/DebuggerInterfacePython.py
--- a/src/eric7/Debugger/DebuggerInterfacePython.py	Mon Feb 12 18:09:53 2024 +0100
+++ b/src/eric7/Debugger/DebuggerInterfacePython.py	Mon Feb 12 18:12:41 2024 +0100
@@ -259,9 +259,7 @@
 
         self.__inShutdown = False
 
-        self.__ericServerDebuggerInterface.stopClient()
         self.__ericServerDebugging = False
-        self.__mainDebugger = None
 
         redirect = (
             str(configOverride["redirect"])
@@ -544,9 +542,7 @@
 
         self.__inShutdown = False
 
-        self.__ericServerDebuggerInterface.stopClient()
         self.__ericServerDebugging = False
-        self.__mainDebugger = None
 
         if project.getDebugProperty("REMOTEDEBUGGER"):
             # remote debugging code
@@ -794,9 +790,9 @@
         with contextlib.suppress(RuntimeError):
             # debug server object might have been deleted already
             # ignore this
-            self.debugServer.signalLastClientExited()
             self.__autoContinued.clear()
             if not self.__inShutdown:
+                self.debugServer.signalLastClientExited()
                 self.debugServer.startClient()
 
     def getDebuggerIds(self):
@@ -846,6 +842,8 @@
             sock = self.__pendingConnections.pop()
             self.__shutdownSocket(sock)
 
+        self.__ericServerDebuggerInterface.stopClient()
+
         # reinitialize
         self.__commandQueue.clear()
 
@@ -878,7 +876,7 @@
         @return flag indicating the connection status
         @rtype bool
         """
-        return bool(self.__connections)
+        return bool(self.__connections) or self.__ericServerDebugging
 
     def remoteEnvironment(self, env):
         """
@@ -956,10 +954,13 @@
         @param wd working directory for the program
         @type str
         """
-        self.__scriptName = os.path.abspath(fn)
+        if FileSystemUtilities.isPlainFileName(fn):
+            fn = os.path.abspath(fn)
+
+        self.__scriptName = fn
 
         wd = self.translate(wd, False)
-        fn = self.translate(os.path.abspath(fn), False)
+        fn = self.translate(fn, False)
         self.__sendJsonCommand(
             "RequestRun",
             {
@@ -984,10 +985,13 @@
             cleared first
         @type bool
         """
-        self.__scriptName = os.path.abspath(fn)
+        if FileSystemUtilities.isPlainFileName(fn):
+            fn = os.path.abspath(fn)
+
+        self.__scriptName = fn
 
         wd = self.translate(wd, False)
-        fn = self.translate(os.path.abspath(fn), False)
+        fn = self.translate(fn, False)
         self.__sendJsonCommand(
             "RequestCoverage",
             {
@@ -1013,10 +1017,13 @@
             first
         @type bool
         """
-        self.__scriptName = os.path.abspath(fn)
+        if FileSystemUtilities.isPlainFileName(fn):
+            fn = os.path.abspath(fn)
+
+        self.__scriptName = fn
 
         wd = self.translate(wd, False)
-        fn = self.translate(os.path.abspath(fn), False)
+        fn = self.translate(fn, False)
         self.__sendJsonCommand(
             "RequestProfile",
             {
@@ -1699,6 +1706,7 @@
             self.debugServer.signalClientRawInput(
                 params["prompt"], params["echo"], params["debuggerId"]
             )
+            pass
 
         elif method == "ResponseBPConditionError":
             fn = self.translate(params["filename"], True)
@@ -1823,7 +1831,8 @@
             if debuggerId and debuggerId in self.__connections:
                 sock = self.__connections[debuggerId]
             elif sock is None and self.__mainDebugger is not None:
-                sock = self.__connections[self.__mainDebugger]
+                with contextlib.suppress(KeyError):
+                    sock = self.__connections[self.__mainDebugger]
             if sock is not None:
                 self.__writeJsonCommandToSocket(jsonStr, sock)
             else:

eric ide

mercurial