diff -r d036d72f457c -r 5401ae8ddaa1 eric6/Debugger/DebugServer.py --- a/eric6/Debugger/DebugServer.py Mon Jan 27 19:50:40 2020 +0100 +++ b/eric6/Debugger/DebugServer.py Tue Jan 28 19:41:51 2020 +0100 @@ -114,6 +114,8 @@ toFunction) @signal appendStdout(msg) emitted when a passive debug connection is established or lost + @signal clientDebuggerIds(debuggerIds) emitted to give the list of IDs of + attached debugger backends """ clientClearBreak = pyqtSignal(str, int) clientClearWatch = pyqtSignal(str) @@ -140,6 +142,7 @@ clientCapabilities = pyqtSignal(int, str, str) clientCompletionList = pyqtSignal(list, str) clientInterpreterChanged = pyqtSignal(str) + clientDebuggerIds = pyqtSignal(list) utDiscovered = pyqtSignal(list, str, str) utPrepared = pyqtSignal(int, str, str) utStartTest = pyqtSignal(str, str) @@ -1230,30 +1233,52 @@ self.debuggerInterface.remoteRawInput(s) self.clientRawInputSent.emit() - def remoteThreadList(self): + def remoteThreadList(self, debuggerId=""): """ Public method to request the list of threads from the client. + + @param debuggerId ID of the debugger backend + @type str """ - self.debuggerInterface.remoteThreadList() + self.debuggerInterface.remoteThreadList(debuggerId=debuggerId) - def remoteSetThread(self, tid): + def remoteSetThread(self, tid, debuggerId=""): """ Public method to request to set the given thread as current thread. - @param tid id of the thread (integer) + @param tid id of the thread + @type int + @param debuggerId ID of the debugger backend + @type str + """ + self.debuggerInterface.remoteSetThread(tid, debuggerId=debuggerId) + + def remoteClientStack(self, debuggerId=""): """ - self.debuggerInterface.remoteSetThread(tid) + Public method to request the stack of the main thread. - def remoteClientVariables(self, scope, filterList, framenr=0): + @param debuggerId ID of the debugger backend + @type str + """ + self.debuggerInterface.remoteClientStack(debuggerId=debuggerId) + + def remoteClientVariables(self, scope, filterList, framenr=0, + debuggerId=""): """ Public method to request the variables of the debugged program. @param scope the scope of the variables (0 = local, 1 = global) - @param filterList list of variable types to filter out (list of int) - @param framenr framenumber of the variables to retrieve (int) + @type int + @param filterList list of variable types to filter out + @type list of int + @param framenr framenumber of the variables to retrieve + @type int + @param debuggerId ID of the debugger backend + @type str """ self.debuggerInterface.remoteClientVariables( - scope, filterList, framenr, self.__maxVariableSize) + scope, filterList, framenr, self.__maxVariableSize, + debuggerId=debuggerId) def remoteClientVariable(self, scope, filterList, var, framenr=0): """ @@ -1680,7 +1705,7 @@ self.callTraceInfo.emit( isCall, fromFile, fromLine, fromFunction, toFile, toLine, toFunction) - + def clientUtDiscovered(self, testCases, exceptionType, exceptionValue): """ Public method to process the client unittest discover info. @@ -1862,3 +1887,26 @@ @type bool """ self.debugging = on + + def signalClientDebuggerIds(self, debuggerIds): + """ + Public method to signal the receipt of a new debugger ID. + + This signal indicates, that a new debugger backend has connected. + + @param debuggerIds list of IDs of the connected debugger backends + @type list of str + """ + self.clientDebuggerIds.emit(debuggerIds) + + def getDebuggerIds(self): + """ + Public method to return the IDs of the connected debugger backends. + + @return list of connected debugger backend IDs + @rtype list of str + """ + if self.debuggerInterface: + return self.debuggerInterface.getDebuggerIds() + else: + return []