39 |
40 |
40 class DebugServer(QTcpServer): |
41 class DebugServer(QTcpServer): |
41 """ |
42 """ |
42 Class implementing the debug server embedded within the IDE. |
43 Class implementing the debug server embedded within the IDE. |
43 |
44 |
44 @signal clientProcessStdout(str) emitted after the client has sent some output |
45 @signal clientProcessStdout(str) emitted after the client has sent some |
45 via stdout |
46 output via stdout |
46 @signal clientProcessStderr(str) emitted after the client has sent some output |
47 @signal clientProcessStderr(str) emitted after the client has sent some |
47 via stderr |
48 output via stderr |
48 @signal clientOutput(str) emitted after the client has sent some output |
49 @signal clientOutput(str) emitted after the client has sent some output |
49 @signal clientRawInputSent() emitted after the data was sent to the debug client |
50 @signal clientRawInputSent() emitted after the data was sent to the |
50 @signal clientLine(filename, lineno, forStack) emitted after the debug client |
51 debug client |
51 has executed a line of code |
52 @signal clientLine(filename, lineno, forStack) emitted after the |
|
53 debug client has executed a line of code |
52 @signal clientStack(stack) emitted after the debug client has executed a |
54 @signal clientStack(stack) emitted after the debug client has executed a |
53 line of code |
55 line of code |
54 @signal clientThreadList(currentId, threadList) emitted after a thread list |
56 @signal clientThreadList(currentId, threadList) emitted after a thread list |
55 has been received |
57 has been received |
56 @signal clientThreadSet() emitted after the client has acknowledged the change |
58 @signal clientThreadSet() emitted after the client has acknowledged the |
57 of the current thread |
59 change of the current thread |
58 @signal clientVariables(scope, variables) emitted after a variables dump has |
60 @signal clientVariables(scope, variables) emitted after a variables dump |
59 been received |
61 has been received |
60 @signal clientVariable(scope, variables) emitted after a dump for one class |
62 @signal clientVariable(scope, variables) emitted after a dump for one class |
61 variable has been received |
63 variable has been received |
62 @signal clientStatement(bool) emitted after an interactive command has |
64 @signal clientStatement(bool) emitted after an interactive command has |
63 been executed. The parameter is 0 to indicate that the command is |
65 been executed. The parameter is 0 to indicate that the command is |
64 complete and 1 if it needs more input. |
66 complete and 1 if it needs more input. |
65 @signal clientException(exception) emitted after an exception occured on the |
67 @signal clientException(exception) emitted after an exception occured on |
66 client side |
68 the client side |
67 @signal clientSyntaxError(exception) emitted after a syntax error has been detected |
69 @signal clientSyntaxError(exception) emitted after a syntax error has been |
68 on the client side |
70 detected on the client side |
69 @signal clientExit(int) emitted with the exit status after the client has exited |
71 @signal clientExit(int) emitted with the exit status after the client has |
|
72 exited |
70 @signal clientClearBreak(filename, lineno) emitted after the debug client |
73 @signal clientClearBreak(filename, lineno) emitted after the debug client |
71 has decided to clear a temporary breakpoint |
74 has decided to clear a temporary breakpoint |
72 @signal clientBreakConditionError(fn, lineno) emitted after the client has signaled |
75 @signal clientBreakConditionError(fn, lineno) emitted after the client has |
73 a syntax error in a breakpoint condition |
76 signaled a syntax error in a breakpoint condition |
74 @signal clientClearWatch(condition) emitted after the debug client |
77 @signal clientClearWatch(condition) emitted after the debug client |
75 has decided to clear a temporary watch expression |
78 has decided to clear a temporary watch expression |
76 @signal clientWatchConditionError(condition) emitted after the client has signaled |
79 @signal clientWatchConditionError(condition) emitted after the client has |
77 a syntax error in a watch expression |
80 signaled a syntax error in a watch expression |
78 @signal clientRawInput(prompt, echo) emitted after a raw input request was received |
81 @signal clientRawInput(prompt, echo) emitted after a raw input request was |
|
82 received |
79 @signal clientBanner(banner) emitted after the client banner was received |
83 @signal clientBanner(banner) emitted after the client banner was received |
80 @signal clientCapabilities(int capabilities, string cltype) emitted after the clients |
84 @signal clientCapabilities(int capabilities, string cltype) emitted after |
81 capabilities were received |
85 the clients capabilities were received |
82 @signal clientCompletionList(completionList, text) emitted after the client |
86 @signal clientCompletionList(completionList, text) emitted after the client |
83 the commandline completion list and the reworked searchstring was |
87 the commandline completion list and the reworked searchstring was |
84 received from the client |
88 received from the client |
85 @signal passiveDebugStarted(str, bool) emitted after the debug client has connected in |
89 @signal passiveDebugStarted(str, bool) emitted after the debug client has |
86 passive debug mode |
90 connected in passive debug mode |
87 @signal clientGone(bool) emitted if the client went away (planned or unplanned) |
91 @signal clientGone(bool) emitted if the client went away (planned or |
88 @signal utPrepared(nrTests, exc_type, exc_value) emitted after the client has |
92 unplanned) |
89 loaded a unittest suite |
93 @signal utPrepared(nrTests, exc_type, exc_value) emitted after the client |
90 @signal utFinished() emitted after the client signalled the end of the unittest |
94 has loaded a unittest suite |
91 @signal utStartTest(testname, testdocu) emitted after the client has started |
95 @signal utFinished() emitted after the client signalled the end of the |
92 a test |
96 unittest |
|
97 @signal utStartTest(testname, testdocu) emitted after the client has |
|
98 started a test |
93 @signal utStopTest() emitted after the client has finished a test |
99 @signal utStopTest() emitted after the client has finished a test |
94 @signal utTestFailed(testname, exc_info, id) emitted after the client reported |
100 @signal utTestFailed(testname, exc_info, id) emitted after the client |
95 a failed test |
101 reported a failed test |
96 @signal utTestErrored(testname, exc_info, id) emitted after the client reported |
102 @signal utTestErrored(testname, exc_info, id) emitted after the client |
97 an errored test |
103 reported an errored test |
98 @signal utTestSkipped(testname, reason, id) emitted after the client reported |
104 @signal utTestSkipped(testname, reason, id) emitted after the client |
99 a skipped test |
105 reported a skipped test |
100 @signal utTestFailedExpected(testname, exc_info, id) emitted after the client reported |
106 @signal utTestFailedExpected(testname, exc_info, id) emitted after the |
101 an expected test failure |
107 client reported an expected test failure |
102 @signal utTestSucceededUnexpected(testname, id) emitted after the client reported |
108 @signal utTestSucceededUnexpected(testname, id) emitted after the client |
103 an unexpected test success |
109 reported an unexpected test success |
104 @signal callTraceInfo(isCall, fromFile, fromLine, fromFunction, toFile, toLine, toFunction) |
110 @signal callTraceInfo(isCall, fromFile, fromLine, fromFunction, toFile, |
105 emitted after the client reported the call trace data |
111 toLine, toFunction) emitted after the client reported the call trace |
|
112 data |
106 """ |
113 """ |
107 clientClearBreak = pyqtSignal(str, int) |
114 clientClearBreak = pyqtSignal(str, int) |
108 clientClearWatch = pyqtSignal(str) |
115 clientClearWatch = pyqtSignal(str) |
109 clientGone = pyqtSignal(bool) |
116 clientGone = pyqtSignal(bool) |
110 clientProcessStdout = pyqtSignal(str) |
117 clientProcessStdout = pyqtSignal(str) |
198 |
205 |
199 self.clientClearBreak.connect(self.__clientClearBreakPoint) |
206 self.clientClearBreak.connect(self.__clientClearBreakPoint) |
200 self.clientClearWatch.connect(self.__clientClearWatchPoint) |
207 self.clientClearWatch.connect(self.__clientClearWatchPoint) |
201 self.newConnection[()].connect(self.__newConnection) |
208 self.newConnection[()].connect(self.__newConnection) |
202 |
209 |
203 self.breakpointModel.rowsAboutToBeRemoved.connect(self.__deleteBreakPoints) |
210 self.breakpointModel.rowsAboutToBeRemoved.connect( |
|
211 self.__deleteBreakPoints) |
204 self.breakpointModel.dataAboutToBeChanged.connect( |
212 self.breakpointModel.dataAboutToBeChanged.connect( |
205 self.__breakPointDataAboutToBeChanged) |
213 self.__breakPointDataAboutToBeChanged) |
206 self.breakpointModel.dataChanged.connect(self.__changeBreakPoints) |
214 self.breakpointModel.dataChanged.connect(self.__changeBreakPoints) |
207 self.breakpointModel.rowsInserted.connect(self.__addBreakPoints) |
215 self.breakpointModel.rowsInserted.connect(self.__addBreakPoints) |
208 |
216 |
209 self.watchpointModel.rowsAboutToBeRemoved.connect(self.__deleteWatchPoints) |
217 self.watchpointModel.rowsAboutToBeRemoved.connect( |
|
218 self.__deleteWatchPoints) |
210 self.watchpointModel.dataAboutToBeChanged.connect( |
219 self.watchpointModel.dataAboutToBeChanged.connect( |
211 self.__watchPointDataAboutToBeChanged) |
220 self.__watchPointDataAboutToBeChanged) |
212 self.watchpointModel.dataChanged.connect(self.__changeWatchPoints) |
221 self.watchpointModel.dataChanged.connect(self.__changeWatchPoints) |
213 self.watchpointModel.rowsInserted.connect(self.__addWatchPoints) |
222 self.watchpointModel.rowsInserted.connect(self.__addWatchPoints) |
214 |
223 |
215 self.__registerDebuggerInterfaces() |
224 self.__registerDebuggerInterfaces() |
216 |
225 |
217 def getHostAddress(self, localhost): |
226 def getHostAddress(self, localhost): |
218 """ |
227 """ |
219 Public method to get the IP address or hostname the debug server is listening. |
228 Public method to get the IP address or hostname the debug server is |
220 |
229 listening. |
221 @param localhost flag indicating to return the address for localhost (boolean) |
230 |
|
231 @param localhost flag indicating to return the address for localhost |
|
232 (boolean) |
222 @return IP address or hostname (string) |
233 @return IP address or hostname (string) |
223 """ |
234 """ |
224 if self.networkInterface == "all": |
235 if self.networkInterface == "all": |
225 if localhost: |
236 if localhost: |
226 return "127.0.0.1" |
237 return "127.0.0.1" |
235 return "{0}@@i{1}".format(self.networkInterface, |
246 return "{0}@@i{1}".format(self.networkInterface, |
236 self.networkInterfaceIndex) |
247 self.networkInterfaceIndex) |
237 |
248 |
238 def __getNetworkInterfaceAndIndex(self, address): |
249 def __getNetworkInterfaceAndIndex(self, address): |
239 """ |
250 """ |
240 Private method to determine the network interface and the interface index. |
251 Private method to determine the network interface and the interface |
|
252 index. |
241 |
253 |
242 @param address address to determine the info for (string) |
254 @param address address to determine the info for (string) |
243 @return tuple of network interface name (string) and index (integer) |
255 @return tuple of network interface name (string) and index (integer) |
244 """ |
256 """ |
245 if address not in ["all", "allv6"]: |
257 if address not in ["all", "allv6"]: |
246 for networkInterface in QNetworkInterface.allInterfaces(): |
258 for networkInterface in QNetworkInterface.allInterfaces(): |
247 addressEntries = networkInterface.addressEntries() |
259 addressEntries = networkInterface.addressEntries() |
248 if len(addressEntries) > 0: |
260 if len(addressEntries) > 0: |
249 for addressEntry in addressEntries: |
261 for addressEntry in addressEntries: |
250 if addressEntry.ip().toString().lower() == address.lower(): |
262 if addressEntry.ip().toString().lower() == \ |
|
263 address.lower(): |
251 return networkInterface.humanReadableName(), \ |
264 return networkInterface.humanReadableName(), \ |
252 networkInterface.index() |
265 networkInterface.index() |
253 |
266 |
254 return "", 0 |
267 return "", 0 |
255 |
268 |
325 if self.lastClientType != self.clientType or clientType is not None: |
340 if self.lastClientType != self.clientType or clientType is not None: |
326 if clientType is None: |
341 if clientType is None: |
327 clientType = self.clientType |
342 clientType = self.clientType |
328 if clientType == "Python2": |
343 if clientType == "Python2": |
329 from .DebuggerInterfacePython import DebuggerInterfacePython |
344 from .DebuggerInterfacePython import DebuggerInterfacePython |
330 self.debuggerInterface = DebuggerInterfacePython(self, self.passive) |
345 self.debuggerInterface = DebuggerInterfacePython( |
|
346 self, self.passive) |
331 elif clientType == "Python3": |
347 elif clientType == "Python3": |
332 from .DebuggerInterfacePython3 import DebuggerInterfacePython3 |
348 from .DebuggerInterfacePython3 import DebuggerInterfacePython3 |
333 self.debuggerInterface = DebuggerInterfacePython3(self, self.passive) |
349 self.debuggerInterface = DebuggerInterfacePython3( |
|
350 self, self.passive) |
334 elif clientType == "Ruby": |
351 elif clientType == "Ruby": |
335 from .DebuggerInterfaceRuby import DebuggerInterfaceRuby |
352 from .DebuggerInterfaceRuby import DebuggerInterfaceRuby |
336 self.debuggerInterface = DebuggerInterfaceRuby(self, self.passive) |
353 self.debuggerInterface = DebuggerInterfaceRuby( |
|
354 self, self.passive) |
337 elif clientType == "None": |
355 elif clientType == "None": |
338 from .DebuggerInterfaceNone import DebuggerInterfaceNone |
356 from .DebuggerInterfaceNone import DebuggerInterfaceNone |
339 self.debuggerInterface = DebuggerInterfaceNone(self, self.passive) |
357 self.debuggerInterface = DebuggerInterfaceNone( |
|
358 self, self.passive) |
340 else: |
359 else: |
341 from .DebuggerInterfaceNone import DebuggerInterfaceNone |
360 from .DebuggerInterfaceNone import DebuggerInterfaceNone |
342 self.debuggerInterface = DebuggerInterfaceNone(self, self.passive) |
361 self.debuggerInterface = DebuggerInterfaceNone( |
|
362 self, self.passive) |
343 self.clientType = "None" |
363 self.clientType = "None" |
344 |
364 |
345 def __setClientType(self, clType): |
365 def __setClientType(self, clType): |
346 """ |
366 """ |
347 Private method to set the client type. |
367 Private method to set the client type. |
455 @param end end row (integer) |
476 @param end end row (integer) |
456 """ |
477 """ |
457 if self.debugging: |
478 if self.debugging: |
458 for row in range(start, end + 1): |
479 for row in range(start, end + 1): |
459 index = self.breakpointModel.index(row, 0, parentIndex) |
480 index = self.breakpointModel.index(row, 0, parentIndex) |
460 fn, lineno = self.breakpointModel.getBreakPointByIndex(index)[0:2] |
481 fn, lineno = \ |
|
482 self.breakpointModel.getBreakPointByIndex(index)[0:2] |
461 self.remoteBreakpoint(fn, lineno, False) |
483 self.remoteBreakpoint(fn, lineno, False) |
462 |
484 |
463 def __changeBreakPoints(self, startIndex, endIndex): |
485 def __changeBreakPoints(self, startIndex, endIndex): |
464 """ |
486 """ |
465 Private slot to set changed breakpoints. |
487 Private slot to set changed breakpoints. |
466 |
488 |
467 @param indexes indexes of changed breakpoints. |
489 @param startIndex starting index of the change breakpoins (QModelIndex) |
|
490 @param endIndex ending index of the change breakpoins (QModelIndex) |
468 """ |
491 """ |
469 if self.debugging: |
492 if self.debugging: |
470 self.__addBreakPoints(QModelIndex(), startIndex.row(), endIndex.row()) |
493 self.__addBreakPoints( |
|
494 QModelIndex(), startIndex.row(), endIndex.row()) |
471 |
495 |
472 def __breakPointDataAboutToBeChanged(self, startIndex, endIndex): |
496 def __breakPointDataAboutToBeChanged(self, startIndex, endIndex): |
473 """ |
497 """ |
474 Private slot to handle the dataAboutToBeChanged signal of the breakpoint model. |
498 Private slot to handle the dataAboutToBeChanged signal of the |
|
499 breakpoint model. |
475 |
500 |
476 @param startIndex start index of the rows to be changed (QModelIndex) |
501 @param startIndex start index of the rows to be changed (QModelIndex) |
477 @param endIndex end index of the rows to be changed (QModelIndex) |
502 @param endIndex end index of the rows to be changed (QModelIndex) |
478 """ |
503 """ |
479 if self.debugging: |
504 if self.debugging: |
480 self.__deleteBreakPoints(QModelIndex(), startIndex.row(), endIndex.row()) |
505 self.__deleteBreakPoints( |
|
506 QModelIndex(), startIndex.row(), endIndex.row()) |
481 |
507 |
482 def __addBreakPoints(self, parentIndex, start, end): |
508 def __addBreakPoints(self, parentIndex, start, end): |
483 """ |
509 """ |
484 Private slot to add breakpoints. |
510 Private slot to add breakpoints. |
485 |
511 |
689 |
721 |
690 @param fn the filename to debug (string) |
722 @param fn the filename to debug (string) |
691 @param argv the commandline arguments to pass to the program (string) |
723 @param argv the commandline arguments to pass to the program (string) |
692 @param wd the working directory for the program (string) |
724 @param wd the working directory for the program (string) |
693 @param env environment settings (string) |
725 @param env environment settings (string) |
694 @keyparam autoClearShell flag indicating, that the interpreter window should |
726 @keyparam autoClearShell flag indicating, that the interpreter window |
695 be cleared (boolean) |
727 should be cleared (boolean) |
696 @keyparam tracePython flag indicating if the Python library should be traced |
728 @keyparam tracePython flag indicating if the Python library should be |
697 as well (boolean) |
729 traced as well (boolean) |
698 @keyparam autoContinue flag indicating, that the debugger should not stop |
730 @keyparam autoContinue flag indicating, that the debugger should not |
699 at the first executable line (boolean) |
731 stop at the first executable line (boolean) |
700 @keyparam forProject flag indicating a project related action (boolean) |
732 @keyparam forProject flag indicating a project related action (boolean) |
701 @keyparam runInConsole flag indicating to start the debugger in a |
733 @keyparam runInConsole flag indicating to start the debugger in a |
702 console window (boolean) |
734 console window (boolean) |
703 @keyparam autoFork flag indicating the automatic fork mode (boolean) |
735 @keyparam autoFork flag indicating the automatic fork mode (boolean) |
704 @keyparam forkChild flag indicating to debug the child after forking (boolean) |
736 @keyparam forkChild flag indicating to debug the child after forking |
|
737 (boolean) |
705 @keyparam clientType client type to be used (string) |
738 @keyparam clientType client type to be used (string) |
706 @keyparam enableCallTrace flag indicating to enable the call trace |
739 @keyparam enableCallTrace flag indicating to enable the call trace |
707 function (boolean) |
740 function (boolean) |
708 """ |
741 """ |
709 self.__autoClearShell = autoClearShell |
742 self.__autoClearShell = autoClearShell |
738 |
773 |
739 @param fn the filename to run (string) |
774 @param fn the filename to run (string) |
740 @param argv the commandline arguments to pass to the program (string) |
775 @param argv the commandline arguments to pass to the program (string) |
741 @param wd the working directory for the program (string) |
776 @param wd the working directory for the program (string) |
742 @param env environment settings (string) |
777 @param env environment settings (string) |
743 @keyparam autoClearShell flag indicating, that the interpreter window should |
778 @keyparam autoClearShell flag indicating, that the interpreter window |
744 be cleared (boolean) |
779 should be cleared (boolean) |
745 @keyparam forProject flag indicating a project related action (boolean) |
780 @keyparam forProject flag indicating a project related action (boolean) |
746 @keyparam runInConsole flag indicating to start the debugger in a |
781 @keyparam runInConsole flag indicating to start the debugger in a |
747 console window (boolean) |
782 console window (boolean) |
748 @keyparam autoFork flag indicating the automatic fork mode (boolean) |
783 @keyparam autoFork flag indicating the automatic fork mode (boolean) |
749 @keyparam forkChild flag indicating to debug the child after forking (boolean) |
784 @keyparam forkChild flag indicating to debug the child after forking |
|
785 (boolean) |
750 @keyparam clientType client type to be used (string) |
786 @keyparam clientType client type to be used (string) |
751 """ |
787 """ |
752 self.__autoClearShell = autoClearShell |
788 self.__autoClearShell = autoClearShell |
753 |
789 |
754 # Restart the client |
790 # Restart the client |
755 try: |
791 try: |
756 if clientType: |
792 if clientType: |
757 self.__setClientType(clientType) |
793 self.__setClientType(clientType) |
758 else: |
794 else: |
759 self.__setClientType(self.__clientAssociations[os.path.splitext(fn)[1]]) |
795 self.__setClientType( |
|
796 self.__clientAssociations[os.path.splitext(fn)[1]]) |
760 except KeyError: |
797 except KeyError: |
761 self.__setClientType('Python3') # assume it is a Python3 file |
798 self.__setClientType('Python3') # assume it is a Python3 file |
762 self.startClient(False, forProject=forProject, runInConsole=runInConsole) |
799 self.startClient(False, forProject=forProject, |
|
800 runInConsole=runInConsole) |
763 |
801 |
764 self.remoteEnvironment(env) |
802 self.remoteEnvironment(env) |
765 |
803 |
766 self.debuggerInterface.remoteRun(fn, argv, wd, autoFork, forkChild) |
804 self.debuggerInterface.remoteRun(fn, argv, wd, autoFork, forkChild) |
767 self.debugging = False |
805 self.debugging = False |
917 def __remoteWatchpoint(self, cond, set, temp=False): |
961 def __remoteWatchpoint(self, cond, set, temp=False): |
918 """ |
962 """ |
919 Private method to set or clear a watch expression. |
963 Private method to set or clear a watch expression. |
920 |
964 |
921 @param cond expression of the watch expression (string) |
965 @param cond expression of the watch expression (string) |
922 @param set flag indicating setting or resetting a watch expression (boolean) |
966 @param set flag indicating setting or resetting a watch expression |
|
967 (boolean) |
923 @param temp flag indicating a temporary watch expression (boolean) |
968 @param temp flag indicating a temporary watch expression (boolean) |
924 """ |
969 """ |
925 # cond is combination of cond and special (s. watch expression viewer) |
970 # cond is combination of cond and special (s. watch expression viewer) |
926 self.debuggerInterface.remoteWatchpoint(cond, set, temp) |
971 self.debuggerInterface.remoteWatchpoint(cond, set, temp) |
927 |
972 |
928 def __remoteWatchpointEnable(self, cond, enable): |
973 def __remoteWatchpointEnable(self, cond, enable): |
929 """ |
974 """ |
930 Private method to enable or disable a watch expression. |
975 Private method to enable or disable a watch expression. |
931 |
976 |
932 @param cond expression of the watch expression (string) |
977 @param cond expression of the watch expression (string) |
933 @param enable flag indicating enabling or disabling a watch expression (boolean) |
978 @param enable flag indicating enabling or disabling a watch expression |
|
979 (boolean) |
934 """ |
980 """ |
935 # cond is combination of cond and special (s. watch expression viewer) |
981 # cond is combination of cond and special (s. watch expression viewer) |
936 self.debuggerInterface.remoteWatchpointEnable(cond, enable) |
982 self.debuggerInterface.remoteWatchpointEnable(cond, enable) |
937 |
983 |
938 def __remoteWatchpointIgnore(self, cond, count): |
984 def __remoteWatchpointIgnore(self, cond, count): |
939 """ |
985 """ |
940 Private method to ignore a watch expression the next couple of occurrences. |
986 Private method to ignore a watch expression the next couple of |
|
987 occurrences. |
941 |
988 |
942 @param cond expression of the watch expression (string) |
989 @param cond expression of the watch expression (string) |
943 @param count number of occurrences to ignore (int) |
990 @param count number of occurrences to ignore (int) |
944 """ |
991 """ |
945 # cond is combination of cond and special (s. watch expression viewer) |
992 # cond is combination of cond and special (s. watch expression viewer) |
1041 |
1091 |
1042 @param text the text to be completed (string) |
1092 @param text the text to be completed (string) |
1043 """ |
1093 """ |
1044 self.debuggerInterface.remoteCompletion(text) |
1094 self.debuggerInterface.remoteCompletion(text) |
1045 |
1095 |
1046 def remoteUTPrepare(self, fn, tn, tfn, failed, cov, covname, coverase, clientType=""): |
1096 def remoteUTPrepare(self, fn, tn, tfn, failed, cov, covname, coverase, |
|
1097 clientType=""): |
1047 """ |
1098 """ |
1048 Public method to prepare a new unittest run. |
1099 Public method to prepare a new unittest run. |
1049 |
1100 |
1050 @param fn the filename to load (string) |
1101 @param fn the filename to load (string) |
1051 @param tn the testname to load (string) |
1102 @param tn the testname to load (string) |
1052 @param tfn the test function name to load tests from (string) |
1103 @param tfn the test function name to load tests from (string) |
1053 @param failed list of failed test, if only failed test should be run |
1104 @param failed list of failed test, if only failed test should be run |
1054 (list of strings) |
1105 (list of strings) |
1055 @param cov flag indicating collection of coverage data is requested (boolean) |
1106 @param cov flag indicating collection of coverage data is requested |
|
1107 (boolean) |
1056 @param covname filename to be used to assemble the coverage caches |
1108 @param covname filename to be used to assemble the coverage caches |
1057 filename (string) |
1109 filename (string) |
1058 @param coverase flag indicating erasure of coverage data is requested (boolean) |
1110 @param coverase flag indicating erasure of coverage data is requested |
|
1111 (boolean) |
1059 @keyparam clientType client type to be used (string) |
1112 @keyparam clientType client type to be used (string) |
1060 """ |
1113 """ |
1061 # Restart the client if there is already a program loaded. |
1114 # Restart the client if there is already a program loaded. |
1062 try: |
1115 try: |
1063 if clientType: |
1116 if clientType: |
1064 self.__setClientType(clientType) |
1117 self.__setClientType(clientType) |
1065 else: |
1118 else: |
1066 self.__setClientType(self.__clientAssociations[os.path.splitext(fn)[1]]) |
1119 self.__setClientType( |
|
1120 self.__clientAssociations[os.path.splitext(fn)[1]]) |
1067 except KeyError: |
1121 except KeyError: |
1068 self.__setClientType('Python3') # assume it is a Python3 file |
1122 self.__setClientType('Python3') # assume it is a Python3 file |
1069 self.startClient(False) |
1123 self.startClient(False) |
1070 |
1124 |
1071 self.debuggerInterface.remoteUTPrepare( |
1125 self.debuggerInterface.remoteUTPrepare( |
1130 |
1184 |
1131 def signalClientVariables(self, scope, variables): |
1185 def signalClientVariables(self, scope, variables): |
1132 """ |
1186 """ |
1133 Public method to process the client variables info. |
1187 Public method to process the client variables info. |
1134 |
1188 |
1135 @param scope scope of the variables (-1 = empty global, 1 = global, 0 = local) |
1189 @param scope scope of the variables (-1 = empty global, 1 = global, |
|
1190 0 = local) |
1136 @param variables the list of variables from the client |
1191 @param variables the list of variables from the client |
1137 """ |
1192 """ |
1138 self.clientVariables.emit(scope, variables) |
1193 self.clientVariables.emit(scope, variables) |
1139 |
1194 |
1140 def signalClientVariable(self, scope, variables): |
1195 def signalClientVariable(self, scope, variables): |
1141 """ |
1196 """ |
1142 Public method to process the client variable info. |
1197 Public method to process the client variable info. |
1143 |
1198 |
1144 @param scope scope of the variables (-1 = empty global, 1 = global, 0 = local) |
1199 @param scope scope of the variables (-1 = empty global, 1 = global, |
|
1200 0 = local) |
1145 @param variables the list of members of a classvariable from the client |
1201 @param variables the list of members of a classvariable from the client |
1146 """ |
1202 """ |
1147 self.clientVariable.emit(scope, variables) |
1203 self.clientVariable.emit(scope, variables) |
1148 |
1204 |
1149 def signalClientStatement(self, more): |
1205 def signalClientStatement(self, more): |
1152 |
1208 |
1153 @param more flag indicating that more user input is required |
1209 @param more flag indicating that more user input is required |
1154 """ |
1210 """ |
1155 self.clientStatement.emit(more) |
1211 self.clientStatement.emit(more) |
1156 |
1212 |
1157 def signalClientException(self, exceptionType, exceptionMessage, stackTrace): |
1213 def signalClientException(self, exceptionType, exceptionMessage, |
|
1214 stackTrace): |
1158 """ |
1215 """ |
1159 Public method to process the exception info from the client. |
1216 Public method to process the exception info from the client. |
1160 |
1217 |
1161 @param exceptionType type of exception raised (string) |
1218 @param exceptionType type of exception raised (string) |
1162 @param exceptionMessage message given by the exception (string) |
1219 @param exceptionMessage message given by the exception (string) |
1163 @param stackTrace list of stack entries with the exception position |
1220 @param stackTrace list of stack entries with the exception position |
1164 first. Each stack entry is a list giving the filename and the linenumber. |
1221 first. Each stack entry is a list giving the filename and the |
|
1222 linenumber. |
1165 """ |
1223 """ |
1166 if self.running: |
1224 if self.running: |
1167 self.clientException.emit(exceptionType, exceptionMessage, stackTrace) |
1225 self.clientException.emit(exceptionType, exceptionMessage, |
|
1226 stackTrace) |
1168 |
1227 |
1169 def signalClientSyntaxError(self, message, filename, lineNo, characterNo): |
1228 def signalClientSyntaxError(self, message, filename, lineNo, characterNo): |
1170 """ |
1229 """ |
1171 Public method to process the syntax error info from the client. |
1230 Public method to process the syntax error info from the client. |
1172 |
1231 |
1173 @param message message of the syntax error (string) |
1232 @param message message of the syntax error (string) |
1174 @param filename translated filename of the syntax error position (string) |
1233 @param filename translated filename of the syntax error position |
|
1234 (string) |
1175 @param lineNo line number of the syntax error position (integer) |
1235 @param lineNo line number of the syntax error position (integer) |
1176 @param characterNo character number of the syntax error position (integer) |
1236 @param characterNo character number of the syntax error position |
|
1237 (integer) |
1177 """ |
1238 """ |
1178 if self.running: |
1239 if self.running: |
1179 self.clientSyntaxError.emit(message, filename, lineNo, characterNo) |
1240 self.clientSyntaxError.emit(message, filename, lineNo, characterNo) |
1180 |
1241 |
1181 def signalClientExit(self, status): |
1242 def signalClientExit(self, status): |