Debugger: some more fixes

Wed, 30 Dec 2020 15:06:28 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 30 Dec 2020 15:06:28 +0100
changeset 7928
a78ce4578fed
parent 7927
866ddf957461
child 7929
fdd769e06482

Debugger: some more fixes

eric6/APIs/Python3/eric6.api file | annotate | diff | comparison | revisions
eric6/Debugger/DebugUI.py file | annotate | diff | comparison | revisions
eric6/Debugger/DebugViewer.py file | annotate | diff | comparison | revisions
eric6/Documentation/Help/source.qch file | annotate | diff | comparison | revisions
eric6/Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
eric6/Documentation/Source/eric6.Debugger.DebugUI.html file | annotate | diff | comparison | revisions
eric6/Documentation/Source/eric6.Debugger.DebugViewer.html file | annotate | diff | comparison | revisions
--- a/eric6/APIs/Python3/eric6.api	Wed Dec 30 13:45:26 2020 +0100
+++ b/eric6/APIs/Python3/eric6.api	Wed Dec 30 15:06:28 2020 +0100
@@ -692,7 +692,7 @@
 eric6.Debugger.DebugViewer.DebugViewer.handleClientStack?4(stack, debuggerId)
 eric6.Debugger.DebugViewer.DebugViewer.handleDebuggingStarted?4()
 eric6.Debugger.DebugViewer.DebugViewer.handlePreferencesChanged?4()
-eric6.Debugger.DebugViewer.DebugViewer.handleResetUI?4()
+eric6.Debugger.DebugViewer.DebugViewer.handleResetUI?4(fullReset)
 eric6.Debugger.DebugViewer.DebugViewer.initCallStackViewer?4(projectMode)
 eric6.Debugger.DebugViewer.DebugViewer.isCallTraceEnabled?4()
 eric6.Debugger.DebugViewer.DebugViewer.isOnlyDebugger?4()
--- a/eric6/Debugger/DebugUI.py	Wed Dec 30 13:45:26 2020 +0100
+++ b/eric6/Debugger/DebugUI.py	Wed Dec 30 15:06:28 2020 +0100
@@ -42,14 +42,14 @@
         performed
     @signal debuggingStarted(filename) emitted when a debugging session was
         started
-    @signal resetUI() emitted to reset the UI
+    @signal resetUI(full) emitted to reset the UI partially or fully
     @signal exceptionInterrupt() emitted after the execution was interrupted
         by an exception and acknowledged by the user
     @signal appendStdout(msg) emitted when the client program has terminated
         and the display of the termination dialog is suppressed
     """
     clientStack = pyqtSignal(list, str)
-    resetUI = pyqtSignal()
+    resetUI = pyqtSignal(bool)
     exceptionInterrupt = pyqtSignal()
     compileForms = pyqtSignal()
     compileResources = pyqtSignal()
@@ -123,6 +123,8 @@
         self.debugViewer.setVariablesFilter(
             self.__globalsVarFilterList, self.__localsVarFilterList)
         
+        self.__clientDebuggerIds = set()
+        
         # Connect the signals emitted by the debug-server
         debugServer.clientGone.connect(self.__clientGone)
         debugServer.clientLine.connect(self.__clientLine)
@@ -139,6 +141,7 @@
             self.__clientWatchConditionError)
         debugServer.passiveDebugStarted.connect(self.__passiveDebugStarted)
         debugServer.clientThreadSet.connect(self.__clientThreadSet)
+        debugServer.clientDebuggerId.connect(self.__clientDebuggerId)
         
         # Connect the signals emitted by the viewmanager
         vm.editorOpened.connect(self.__editorOpened)
@@ -1004,12 +1007,17 @@
         self.debugServer.shutdownServer()
         return True
         
-    def __resetUI(self):
+    def __resetUI(self, fullReset=True):
         """
         Private slot to reset the user interface.
+        
+        @param fullReset flag indicating a full reset is required
+        @type bool
         """
         self.lastAction = -1
         self.debugActGrp.setEnabled(False)
+        self.__clientDebuggerIds.clear()
+        
         if not self.passive:
             if self.editorOpen:
                 editor = self.viewmanager.activeWindow()
@@ -1029,8 +1037,18 @@
             else:
                 self.restartAct.setEnabled(False)
             self.stopAct.setEnabled(False)
-        self.resetUI.emit()
         
+        self.resetUI.emit(fullReset)
+    
+    def __clientDebuggerId(self, debuggerId):
+        """
+        Private slot to track the list of connected debuggers.
+        
+        @param debuggerId ID of the debugger backend
+        @type str
+        """
+        self.__clientDebuggerIds.add(debuggerId)
+    
     def __clientLine(self, fn, line, debuggerId, forStack):
         """
         Private method to handle a change to the current line.
@@ -1055,8 +1073,8 @@
 
         self.debugActGrp.setEnabled(True)
     
-    @pyqtSlot(str, int, str, bool)
-    def __clientExit(self, program, status, message, quiet):
+    @pyqtSlot(str, int, str, bool, str)
+    def __clientExit(self, program, status, message, quiet, debuggerId):
         """
         Private method to handle the debugged program terminating.
         
@@ -1068,7 +1086,15 @@
         @type str
         @param quiet flag indicating to suppress exit info display
         @type bool
+        @param debuggerId ID of the debugger backend
+        @type str
         """
+        self.__clientDebuggerIds.discard(debuggerId)
+        
+        if len(self.__clientDebuggerIds) == 0:
+            self.viewmanager.exit()
+            self.__resetUI(fullReset=False)
+        
         if not quiet:
             if not program:
                 program = self.ui.currentProg
--- a/eric6/Debugger/DebugViewer.py	Wed Dec 30 13:45:26 2020 +0100
+++ b/eric6/Debugger/DebugViewer.py	Wed Dec 30 15:06:28 2020 +0100
@@ -333,9 +333,12 @@
         self.debugUI.debuggingStarted.connect(
             self.handleDebuggingStarted)
     
-    def handleResetUI(self):
+    def handleResetUI(self, fullReset):
         """
         Public method to reset the viewer.
+        
+        @param fullReset flag indicating a full reset is required
+        @type bool
         """
         self.globalsViewer.handleResetUI()
         self.localsViewer.handleResetUI()
@@ -346,7 +349,8 @@
         self.stackComboBox.clear()
         self.__tabWidget.setCurrentWidget(self.glvWidget)
         self.breakpointViewer.handleResetUI()
-        self.__debuggersList.clear()
+        if fullReset:
+            self.__debuggersList.clear()
         self.disassemblyViewer.clear()
         
     def initCallStackViewer(self, projectMode):
Binary file eric6/Documentation/Help/source.qch has changed
--- a/eric6/Documentation/Help/source.qhp	Wed Dec 30 13:45:26 2020 +0100
+++ b/eric6/Documentation/Help/source.qhp	Wed Dec 30 15:06:28 2020 +0100
@@ -3352,6 +3352,7 @@
       <keyword name="DebugUI.__checkActions" id="DebugUI.__checkActions" ref="eric6.Debugger.DebugUI.html#DebugUI.__checkActions" />
       <keyword name="DebugUI.__clearBreakpoints" id="DebugUI.__clearBreakpoints" ref="eric6.Debugger.DebugUI.html#DebugUI.__clearBreakpoints" />
       <keyword name="DebugUI.__clientBreakConditionError" id="DebugUI.__clientBreakConditionError" ref="eric6.Debugger.DebugUI.html#DebugUI.__clientBreakConditionError" />
+      <keyword name="DebugUI.__clientDebuggerId" id="DebugUI.__clientDebuggerId" ref="eric6.Debugger.DebugUI.html#DebugUI.__clientDebuggerId" />
       <keyword name="DebugUI.__clientException" id="DebugUI.__clientException" ref="eric6.Debugger.DebugUI.html#DebugUI.__clientException" />
       <keyword name="DebugUI.__clientExit" id="DebugUI.__clientExit" ref="eric6.Debugger.DebugUI.html#DebugUI.__clientExit" />
       <keyword name="DebugUI.__clientGone" id="DebugUI.__clientGone" ref="eric6.Debugger.DebugUI.html#DebugUI.__clientGone" />
--- a/eric6/Documentation/Source/eric6.Debugger.DebugUI.html	Wed Dec 30 13:45:26 2020 +0100
+++ b/eric6/Documentation/Source/eric6.Debugger.DebugUI.html	Wed Dec 30 15:06:28 2020 +0100
@@ -89,9 +89,9 @@
 emitted if a project specific make run should be
         performed
 </dd>
-<dt>resetUI()</dt>
+<dt>resetUI(full)</dt>
 <dd>
-emitted to reset the UI
+emitted to reset the UI partially or fully
 </dd>
 </dl>
 <h3>Derived from</h3>
@@ -131,6 +131,10 @@
 <td>Private method to handle a condition error of a breakpoint.</td>
 </tr>
 <tr>
+<td><a href="#DebugUI.__clientDebuggerId">__clientDebuggerId</a></td>
+<td>Private slot to track the list of connected debuggers.</td>
+</tr>
+<tr>
 <td><a href="#DebugUI.__clientException">__clientException</a></td>
 <td>Private method to handle an exception of the debugged program.</td>
 </tr>
@@ -532,6 +536,20 @@
 ID of the debugger backend
 </dd>
 </dl>
+<a NAME="DebugUI.__clientDebuggerId" ID="DebugUI.__clientDebuggerId"></a>
+<h4>DebugUI.__clientDebuggerId</h4>
+<b>__clientDebuggerId</b>(<i>debuggerId</i>)
+
+<p>
+        Private slot to track the list of connected debuggers.
+</p>
+<dl>
+
+<dt><i>debuggerId</i> (str)</dt>
+<dd>
+ID of the debugger backend
+</dd>
+</dl>
 <a NAME="DebugUI.__clientException" ID="DebugUI.__clientException"></a>
 <h4>DebugUI.__clientException</h4>
 <b>__clientException</b>(<i>exceptionType, exceptionMessage, stackTrace, debuggerId</i>)
@@ -560,7 +578,7 @@
 </dl>
 <a NAME="DebugUI.__clientExit" ID="DebugUI.__clientExit"></a>
 <h4>DebugUI.__clientExit</h4>
-<b>__clientExit</b>(<i>program, status, message, quiet</i>)
+<b>__clientExit</b>(<i>program, status, message, quiet, debuggerId</i>)
 
 <p>
         Private method to handle the debugged program terminating.
@@ -583,6 +601,10 @@
 <dd>
 flag indicating to suppress exit info display
 </dd>
+<dt><i>debuggerId</i> (str)</dt>
+<dd>
+ID of the debugger backend
+</dd>
 </dl>
 <a NAME="DebugUI.__clientGone" ID="DebugUI.__clientGone"></a>
 <h4>DebugUI.__clientGone</h4>
@@ -1090,11 +1112,18 @@
 </p>
 <a NAME="DebugUI.__resetUI" ID="DebugUI.__resetUI"></a>
 <h4>DebugUI.__resetUI</h4>
-<b>__resetUI</b>(<i></i>)
+<b>__resetUI</b>(<i>fullReset=True</i>)
 
 <p>
         Private slot to reset the user interface.
 </p>
+<dl>
+
+<dt><i>fullReset</i> (bool)</dt>
+<dd>
+flag indicating a full reset is required
+</dd>
+</dl>
 <a NAME="DebugUI.__runProject" ID="DebugUI.__runProject"></a>
 <h4>DebugUI.__runProject</h4>
 <b>__runProject</b>(<i></i>)
--- a/eric6/Documentation/Source/eric6.Debugger.DebugViewer.html	Wed Dec 30 13:45:26 2020 +0100
+++ b/eric6/Documentation/Source/eric6.Debugger.DebugViewer.html	Wed Dec 30 15:06:28 2020 +0100
@@ -614,11 +614,18 @@
 </p>
 <a NAME="DebugViewer.handleResetUI" ID="DebugViewer.handleResetUI"></a>
 <h4>DebugViewer.handleResetUI</h4>
-<b>handleResetUI</b>(<i></i>)
+<b>handleResetUI</b>(<i>fullReset</i>)
 
 <p>
         Public method to reset the viewer.
 </p>
+<dl>
+
+<dt><i>fullReset</i> (bool)</dt>
+<dd>
+flag indicating a full reset is required
+</dd>
+</dl>
 <a NAME="DebugViewer.initCallStackViewer" ID="DebugViewer.initCallStackViewer"></a>
 <h4>DebugViewer.initCallStackViewer</h4>
 <b>initCallStackViewer</b>(<i>projectMode</i>)

eric ide

mercurial