40 compiled |
40 compiled |
41 @signal executeMake() emitted if a project specific make run should be |
41 @signal executeMake() emitted if a project specific make run should be |
42 performed |
42 performed |
43 @signal debuggingStarted(filename) emitted when a debugging session was |
43 @signal debuggingStarted(filename) emitted when a debugging session was |
44 started |
44 started |
45 @signal resetUI() emitted to reset the UI |
45 @signal resetUI(full) emitted to reset the UI partially or fully |
46 @signal exceptionInterrupt() emitted after the execution was interrupted |
46 @signal exceptionInterrupt() emitted after the execution was interrupted |
47 by an exception and acknowledged by the user |
47 by an exception and acknowledged by the user |
48 @signal appendStdout(msg) emitted when the client program has terminated |
48 @signal appendStdout(msg) emitted when the client program has terminated |
49 and the display of the termination dialog is suppressed |
49 and the display of the termination dialog is suppressed |
50 """ |
50 """ |
51 clientStack = pyqtSignal(list, str) |
51 clientStack = pyqtSignal(list, str) |
52 resetUI = pyqtSignal() |
52 resetUI = pyqtSignal(bool) |
53 exceptionInterrupt = pyqtSignal() |
53 exceptionInterrupt = pyqtSignal() |
54 compileForms = pyqtSignal() |
54 compileForms = pyqtSignal() |
55 compileResources = pyqtSignal() |
55 compileResources = pyqtSignal() |
56 executeMake = pyqtSignal() |
56 executeMake = pyqtSignal() |
57 debuggingStarted = pyqtSignal(str) |
57 debuggingStarted = pyqtSignal(str) |
121 self.__localsVarFilterList, self.__globalsVarFilterList = ( |
121 self.__localsVarFilterList, self.__globalsVarFilterList = ( |
122 Preferences.getVarFilters()) |
122 Preferences.getVarFilters()) |
123 self.debugViewer.setVariablesFilter( |
123 self.debugViewer.setVariablesFilter( |
124 self.__globalsVarFilterList, self.__localsVarFilterList) |
124 self.__globalsVarFilterList, self.__localsVarFilterList) |
125 |
125 |
|
126 self.__clientDebuggerIds = set() |
|
127 |
126 # Connect the signals emitted by the debug-server |
128 # Connect the signals emitted by the debug-server |
127 debugServer.clientGone.connect(self.__clientGone) |
129 debugServer.clientGone.connect(self.__clientGone) |
128 debugServer.clientLine.connect(self.__clientLine) |
130 debugServer.clientLine.connect(self.__clientLine) |
129 debugServer.clientExit.connect(self.__clientExit) |
131 debugServer.clientExit.connect(self.__clientExit) |
130 debugServer.lastClientExited.connect(self.__lastClientExited) |
132 debugServer.lastClientExited.connect(self.__lastClientExited) |
137 self.__clientBreakConditionError) |
139 self.__clientBreakConditionError) |
138 debugServer.clientWatchConditionError.connect( |
140 debugServer.clientWatchConditionError.connect( |
139 self.__clientWatchConditionError) |
141 self.__clientWatchConditionError) |
140 debugServer.passiveDebugStarted.connect(self.__passiveDebugStarted) |
142 debugServer.passiveDebugStarted.connect(self.__passiveDebugStarted) |
141 debugServer.clientThreadSet.connect(self.__clientThreadSet) |
143 debugServer.clientThreadSet.connect(self.__clientThreadSet) |
|
144 debugServer.clientDebuggerId.connect(self.__clientDebuggerId) |
142 |
145 |
143 # Connect the signals emitted by the viewmanager |
146 # Connect the signals emitted by the viewmanager |
144 vm.editorOpened.connect(self.__editorOpened) |
147 vm.editorOpened.connect(self.__editorOpened) |
145 vm.lastEditorClosed.connect(self.__lastEditorClosed) |
148 vm.lastEditorClosed.connect(self.__lastEditorClosed) |
146 vm.checkActions.connect(self.__checkActions) |
149 vm.checkActions.connect(self.__checkActions) |
1002 @return always true |
1005 @return always true |
1003 """ |
1006 """ |
1004 self.debugServer.shutdownServer() |
1007 self.debugServer.shutdownServer() |
1005 return True |
1008 return True |
1006 |
1009 |
1007 def __resetUI(self): |
1010 def __resetUI(self, fullReset=True): |
1008 """ |
1011 """ |
1009 Private slot to reset the user interface. |
1012 Private slot to reset the user interface. |
|
1013 |
|
1014 @param fullReset flag indicating a full reset is required |
|
1015 @type bool |
1010 """ |
1016 """ |
1011 self.lastAction = -1 |
1017 self.lastAction = -1 |
1012 self.debugActGrp.setEnabled(False) |
1018 self.debugActGrp.setEnabled(False) |
|
1019 self.__clientDebuggerIds.clear() |
|
1020 |
1013 if not self.passive: |
1021 if not self.passive: |
1014 if self.editorOpen: |
1022 if self.editorOpen: |
1015 editor = self.viewmanager.activeWindow() |
1023 editor = self.viewmanager.activeWindow() |
1016 else: |
1024 else: |
1017 editor = None |
1025 editor = None |
1027 ): |
1035 ): |
1028 self.restartAct.setEnabled(True) |
1036 self.restartAct.setEnabled(True) |
1029 else: |
1037 else: |
1030 self.restartAct.setEnabled(False) |
1038 self.restartAct.setEnabled(False) |
1031 self.stopAct.setEnabled(False) |
1039 self.stopAct.setEnabled(False) |
1032 self.resetUI.emit() |
1040 |
1033 |
1041 self.resetUI.emit(fullReset) |
|
1042 |
|
1043 def __clientDebuggerId(self, debuggerId): |
|
1044 """ |
|
1045 Private slot to track the list of connected debuggers. |
|
1046 |
|
1047 @param debuggerId ID of the debugger backend |
|
1048 @type str |
|
1049 """ |
|
1050 self.__clientDebuggerIds.add(debuggerId) |
|
1051 |
1034 def __clientLine(self, fn, line, debuggerId, forStack): |
1052 def __clientLine(self, fn, line, debuggerId, forStack): |
1035 """ |
1053 """ |
1036 Private method to handle a change to the current line. |
1054 Private method to handle a change to the current line. |
1037 |
1055 |
1038 @param fn filename |
1056 @param fn filename |
1053 self.__getThreadList(debuggerId) |
1071 self.__getThreadList(debuggerId) |
1054 self.__getClientVariables(debuggerId) |
1072 self.__getClientVariables(debuggerId) |
1055 |
1073 |
1056 self.debugActGrp.setEnabled(True) |
1074 self.debugActGrp.setEnabled(True) |
1057 |
1075 |
1058 @pyqtSlot(str, int, str, bool) |
1076 @pyqtSlot(str, int, str, bool, str) |
1059 def __clientExit(self, program, status, message, quiet): |
1077 def __clientExit(self, program, status, message, quiet, debuggerId): |
1060 """ |
1078 """ |
1061 Private method to handle the debugged program terminating. |
1079 Private method to handle the debugged program terminating. |
1062 |
1080 |
1063 @param program name of the exited program |
1081 @param program name of the exited program |
1064 @type str |
1082 @type str |
1066 @type int |
1084 @type int |
1067 @param message exit message of the debugged program |
1085 @param message exit message of the debugged program |
1068 @type str |
1086 @type str |
1069 @param quiet flag indicating to suppress exit info display |
1087 @param quiet flag indicating to suppress exit info display |
1070 @type bool |
1088 @type bool |
1071 """ |
1089 @param debuggerId ID of the debugger backend |
|
1090 @type str |
|
1091 """ |
|
1092 self.__clientDebuggerIds.discard(debuggerId) |
|
1093 |
|
1094 if len(self.__clientDebuggerIds) == 0: |
|
1095 self.viewmanager.exit() |
|
1096 self.__resetUI(fullReset=False) |
|
1097 |
1072 if not quiet: |
1098 if not quiet: |
1073 if not program: |
1099 if not program: |
1074 program = self.ui.currentProg |
1100 program = self.ui.currentProg |
1075 if ( |
1101 if ( |
1076 not Preferences.getDebugger("SuppressClientExit") or |
1102 not Preferences.getDebugger("SuppressClientExit") or |