--- 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