93 a skipped test |
93 a skipped test |
94 @signal utTestFailedExpected(testname, exc_info, id) emitted after the client reported |
94 @signal utTestFailedExpected(testname, exc_info, id) emitted after the client reported |
95 an expected test failure |
95 an expected test failure |
96 @signal utTestSucceededUnexpected(testname, id) emitted after the client reported |
96 @signal utTestSucceededUnexpected(testname, id) emitted after the client reported |
97 an unexpected test success |
97 an unexpected test success |
|
98 @signal callTraceInfo(isCall, fromFile, fromLine, fromFunction, toFile, toLine, |
|
99 toFunction) emitted after the client reported the call trace data |
98 """ |
100 """ |
99 clientClearBreak = pyqtSignal(str, int) |
101 clientClearBreak = pyqtSignal(str, int) |
100 clientClearWatch = pyqtSignal(str) |
102 clientClearWatch = pyqtSignal(str) |
101 clientGone = pyqtSignal(bool) |
103 clientGone = pyqtSignal(bool) |
102 clientProcessStdout = pyqtSignal(str) |
104 clientProcessStdout = pyqtSignal(str) |
127 utTestSkipped = pyqtSignal(str, str, str) |
129 utTestSkipped = pyqtSignal(str, str, str) |
128 utTestFailedExpected = pyqtSignal(str, str, str) |
130 utTestFailedExpected = pyqtSignal(str, str, str) |
129 utTestSucceededUnexpected = pyqtSignal(str, str) |
131 utTestSucceededUnexpected = pyqtSignal(str, str) |
130 utFinished = pyqtSignal() |
132 utFinished = pyqtSignal() |
131 passiveDebugStarted = pyqtSignal(str, bool) |
133 passiveDebugStarted = pyqtSignal(str, bool) |
|
134 callTraceInfo = pyqtSignal(bool, str, str, str, str, str, str) |
132 |
135 |
133 def __init__(self): |
136 def __init__(self): |
134 """ |
137 """ |
135 Constructor |
138 Constructor |
136 """ |
139 """ |
663 self.debuggerInterface.remoteEnvironment(envdict) |
666 self.debuggerInterface.remoteEnvironment(envdict) |
664 |
667 |
665 def remoteLoad(self, fn, argv, wd, env, autoClearShell=True, |
668 def remoteLoad(self, fn, argv, wd, env, autoClearShell=True, |
666 tracePython=False, autoContinue=True, forProject=False, |
669 tracePython=False, autoContinue=True, forProject=False, |
667 runInConsole=False, autoFork=False, forkChild=False, |
670 runInConsole=False, autoFork=False, forkChild=False, |
668 clientType=""): |
671 clientType="", enableCallTrace=False): |
669 """ |
672 """ |
670 Public method to load a new program to debug. |
673 Public method to load a new program to debug. |
671 |
674 |
672 @param fn the filename to debug (string) |
675 @param fn the filename to debug (string) |
673 @param argv the commandline arguments to pass to the program (string) |
676 @param argv the commandline arguments to pass to the program (string) |
683 @keyparam runInConsole flag indicating to start the debugger in a |
686 @keyparam runInConsole flag indicating to start the debugger in a |
684 console window (boolean) |
687 console window (boolean) |
685 @keyparam autoFork flag indicating the automatic fork mode (boolean) |
688 @keyparam autoFork flag indicating the automatic fork mode (boolean) |
686 @keyparam forkChild flag indicating to debug the child after forking (boolean) |
689 @keyparam forkChild flag indicating to debug the child after forking (boolean) |
687 @keyparam clientType client type to be used (string) |
690 @keyparam clientType client type to be used (string) |
|
691 @keyparam enableCallTrace flag indicating to enable the call trace |
|
692 function (boolean) |
688 """ |
693 """ |
689 self.__autoClearShell = autoClearShell |
694 self.__autoClearShell = autoClearShell |
690 self.__autoContinue = autoContinue |
695 self.__autoContinue = autoContinue |
691 |
696 |
692 # Restart the client |
697 # Restart the client |
697 self.__setClientType(self.__clientAssociations[os.path.splitext(fn)[1]]) |
702 self.__setClientType(self.__clientAssociations[os.path.splitext(fn)[1]]) |
698 except KeyError: |
703 except KeyError: |
699 self.__setClientType('Python3') # assume it is a Python3 file |
704 self.__setClientType('Python3') # assume it is a Python3 file |
700 self.startClient(False, forProject=forProject, runInConsole=runInConsole) |
705 self.startClient(False, forProject=forProject, runInConsole=runInConsole) |
701 |
706 |
|
707 self.setCallTraceEnabled(enableCallTrace) |
702 self.remoteEnvironment(env) |
708 self.remoteEnvironment(env) |
703 |
709 |
704 self.debuggerInterface.remoteLoad(fn, argv, wd, tracePython, autoContinue, |
710 self.debuggerInterface.remoteLoad(fn, argv, wd, tracePython, autoContinue, |
705 autoFork, forkChild) |
711 autoFork, forkChild) |
706 self.debugging = True |
712 self.debugging = True |
975 @param scope the scope of the variables (0 = local, 1 = global) |
981 @param scope the scope of the variables (0 = local, 1 = global) |
976 @param filter regexp string for variable names to filter out (string) |
982 @param filter regexp string for variable names to filter out (string) |
977 """ |
983 """ |
978 self.debuggerInterface.remoteClientSetFilter(scope, filter) |
984 self.debuggerInterface.remoteClientSetFilter(scope, filter) |
979 |
985 |
|
986 def setCallTraceEnabled(self, on): |
|
987 """ |
|
988 Public method to set the call trace state. |
|
989 |
|
990 @param on flag indicating to enable the call trace function (boolean) |
|
991 """ |
|
992 # TODO: remove the try/except once all interface have been adjusted |
|
993 try: |
|
994 self.debuggerInterface.setCallTraceEnabled(on) |
|
995 except AttributeError: |
|
996 pass |
|
997 |
980 def remoteEval(self, arg): |
998 def remoteEval(self, arg): |
981 """ |
999 """ |
982 Public method to evaluate arg in the current context of the debugged program. |
1000 Public method to evaluate arg in the current context of the debugged program. |
983 |
1001 |
984 @param arg the arguments to evaluate (string) |
1002 @param arg the arguments to evaluate (string) |
1236 @param completionList list of possible completions (list of strings) |
1254 @param completionList list of possible completions (list of strings) |
1237 @param text the text to be completed (string) |
1255 @param text the text to be completed (string) |
1238 """ |
1256 """ |
1239 self.clientCompletionList.emit(completionList, text) |
1257 self.clientCompletionList.emit(completionList, text) |
1240 |
1258 |
|
1259 def signalClientCallTrace(self, isCall, fromFile, fromLine, fromFunction, |
|
1260 toFile, toLine, toFunction): |
|
1261 """ |
|
1262 Public method to process the client call trace data. |
|
1263 |
|
1264 @param isCall flag indicating a 'call' (boolean) |
|
1265 @param fromFile name of the originating file (string) |
|
1266 @param fromLine line number in the originating file (string) |
|
1267 @param fromFunction name of the originating function (string) |
|
1268 @param toFile name of the target file (string) |
|
1269 @param toLine line number in the target file (string) |
|
1270 @param toFunction name of the target function (string) |
|
1271 """ |
|
1272 self.callTraceInfo.emit(isCall, fromFile, fromLine, fromFunction, |
|
1273 toFile, toLine, toFunction) |
|
1274 |
1241 def clientUtPrepared(self, result, exceptionType, exceptionValue): |
1275 def clientUtPrepared(self, result, exceptionType, exceptionValue): |
1242 """ |
1276 """ |
1243 Public method to process the client unittest prepared info. |
1277 Public method to process the client unittest prepared info. |
1244 |
1278 |
1245 @param result number of test cases (0 = error) (integer) |
1279 @param result number of test cases (0 = error) (integer) |