eric6/DebugClients/Python/DebugClientBase.py

changeset 7986
2971d5d19951
parent 7973
e836d196e888
child 8030
b356d92d4e02
equal deleted inserted replaced
7985:3a1ca2452c30 7986:2971d5d19951
302 message = "" 302 message = ""
303 filename = "" 303 filename = ""
304 lineno = 0 304 lineno = 0
305 charno = 0 305 charno = 0
306 306
307 self.sendSyntaxError(message, filename, lineno, charno) 307 self.sendSyntaxError(message, filename, lineno, charno, self.name)
308 return None 308 return None
309 309
310 return code 310 return code
311 311
312 def handleJsonCommand(self, jsonStr): 312 def handleJsonCommand(self, jsonStr):
337 params["variable"], params["frameNumber"], 337 params["variable"], params["frameNumber"],
338 params["scope"], params["filters"]) 338 params["scope"], params["filters"])
339 339
340 elif method == "RequestStack": 340 elif method == "RequestStack":
341 stack = self.mainThread.getStack() 341 stack = self.mainThread.getStack()
342 self.sendResponseLine(stack) 342 self.sendResponseLine(stack, self.mainThread.name)
343 343
344 elif method == "RequestThreadList": 344 elif method == "RequestThreadList":
345 self.dumpThreadList() 345 self.dumpThreadList()
346 346
347 elif method == "RequestThreadSet": 347 elif method == "RequestThreadSet":
357 self.setCurrentThread(threadId) 357 self.setCurrentThread(threadId)
358 self.sendJsonCommand("ResponseThreadSet", {}) 358 self.sendJsonCommand("ResponseThreadSet", {})
359 stack = self.currentThread.getStack() 359 stack = self.currentThread.getStack()
360 self.sendJsonCommand("ResponseStack", { 360 self.sendJsonCommand("ResponseStack", {
361 "stack": stack, 361 "stack": stack,
362 "threadName": self.currentThread.name,
362 }) 363 })
363 364
364 elif method == "RequestDisassembly": 365 elif method == "RequestDisassembly":
365 if self.disassembly is not None: 366 if self.disassembly is not None:
366 self.sendJsonCommand("ResponseDisassembly", { 367 self.sendJsonCommand("ResponseDisassembly", {
1015 """ 1016 """
1016 self.sendJsonCommand("ResponseClearWatch", { 1017 self.sendJsonCommand("ResponseClearWatch", {
1017 "condition": condition, 1018 "condition": condition,
1018 }) 1019 })
1019 1020
1020 def sendResponseLine(self, stack): 1021 def sendResponseLine(self, stack, threadName):
1021 """ 1022 """
1022 Public method to send the current call stack. 1023 Public method to send the current call stack.
1023 1024
1024 @param stack call stack 1025 @param stack call stack
1025 @type list 1026 @type list
1027 @param threadName name of the thread sending the event
1028 @type str
1026 """ 1029 """
1027 self.sendJsonCommand("ResponseLine", { 1030 self.sendJsonCommand("ResponseLine", {
1028 "stack": stack, 1031 "stack": stack,
1032 "threadName": threadName,
1029 }) 1033 })
1030 1034
1031 def sendCallTrace(self, event, fromInfo, toInfo): 1035 def sendCallTrace(self, event, fromInfo, toInfo):
1032 """ 1036 """
1033 Public method to send a call trace entry. 1037 Public method to send a call trace entry.
1045 "event": event[0], 1049 "event": event[0],
1046 "from": fromInfo, 1050 "from": fromInfo,
1047 "to": toInfo, 1051 "to": toInfo,
1048 }) 1052 })
1049 1053
1050 def sendException(self, exceptionType, exceptionMessage, stack): 1054 def sendException(self, exceptionType, exceptionMessage, stack,
1055 threadName):
1051 """ 1056 """
1052 Public method to send information for an exception. 1057 Public method to send information for an exception.
1053 1058
1054 @param exceptionType type of exception raised 1059 @param exceptionType type of exception raised
1055 @type str 1060 @type str
1056 @param exceptionMessage message of the exception 1061 @param exceptionMessage message of the exception
1057 @type str 1062 @type str
1058 @param stack stack trace information 1063 @param stack stack trace information
1059 @type list 1064 @type list
1065 @param threadName name of the thread sending the event
1066 @type str
1060 """ 1067 """
1061 self.sendJsonCommand("ResponseException", { 1068 self.sendJsonCommand("ResponseException", {
1062 "type": exceptionType, 1069 "type": exceptionType,
1063 "message": exceptionMessage, 1070 "message": exceptionMessage,
1064 "stack": stack, 1071 "stack": stack,
1072 "threadName": threadName,
1065 }) 1073 })
1066 1074
1067 def sendSyntaxError(self, message, filename, lineno, charno): 1075 def sendSyntaxError(self, message, filename, lineno, charno, threadName):
1068 """ 1076 """
1069 Public method to send information for a syntax error. 1077 Public method to send information for a syntax error.
1070 1078
1071 @param message syntax error message 1079 @param message syntax error message
1072 @type str 1080 @type str
1074 @type str 1082 @type str
1075 @param lineno line number info 1083 @param lineno line number info
1076 @type int 1084 @type int
1077 @param charno character number info 1085 @param charno character number info
1078 @type int 1086 @type int
1087 @param threadName name of the thread sending the event
1088 @type str
1079 """ 1089 """
1080 self.sendJsonCommand("ResponseSyntax", { 1090 self.sendJsonCommand("ResponseSyntax", {
1081 "message": message, 1091 "message": message,
1082 "filename": filename, 1092 "filename": filename,
1083 "linenumber": lineno, 1093 "linenumber": lineno,
1084 "characternumber": charno, 1094 "characternumber": charno,
1095 "threadName": threadName,
1085 }) 1096 })
1086 1097
1087 def sendPassiveStartup(self, filename, exceptions): 1098 def sendPassiveStartup(self, filename, exceptions):
1088 """ 1099 """
1089 Public method to send the passive start information. 1100 Public method to send the passive start information.

eric ide

mercurial