eric6/Debugger/DebuggerInterfacePython.py

branch
multi_processing
changeset 7872
433dacbfa456
parent 7871
eb65864ca038
child 7874
8dcb77600690
equal deleted inserted replaced
7871:eb65864ca038 7872:433dacbfa456
46 super(DebuggerInterfacePython, self).__init__() 46 super(DebuggerInterfacePython, self).__init__()
47 47
48 self.__isNetworked = True 48 self.__isNetworked = True
49 self.__autoContinue = False 49 self.__autoContinue = False
50 self.__autoContinued = [] 50 self.__autoContinued = []
51 self.__isStepCommand = False
51 52
52 self.debugServer = debugServer 53 self.debugServer = debugServer
53 self.passive = passive 54 self.passive = passive
54 self.process = None 55 self.process = None
55 self.__startedVenv = "" 56 self.__startedVenv = ""
553 self.debugServer.masterClientConnected() 554 self.debugServer.masterClientConnected()
554 555
555 self.debugServer.initializeClient(debuggerId) 556 self.debugServer.initializeClient(debuggerId)
556 557
557 # perform auto-continue except for master 558 # perform auto-continue except for master
558 if debuggerId != self.__master: 559 if (
560 debuggerId != self.__master and
561 self.__autoContinue and
562 not self.__isStepCommand
563 ):
559 QTimer.singleShot( 564 QTimer.singleShot(
560 0, lambda: self.remoteContinue(debuggerId)) 565 0, lambda: self.remoteContinue(debuggerId))
561 566
562 def __socketDisconnected(self, sock): 567 def __socketDisconnected(self, sock):
563 """ 568 """
693 debugging 698 debugging
694 @type bool 699 @type bool
695 """ 700 """
696 self.__autoContinue = autoContinue 701 self.__autoContinue = autoContinue
697 self.__scriptName = os.path.abspath(fn) 702 self.__scriptName = os.path.abspath(fn)
703 self.__isStepCommand = False
698 704
699 wd = self.translate(wd, False) 705 wd = self.translate(wd, False)
700 fn = self.translate(os.path.abspath(fn), False) 706 fn = self.translate(os.path.abspath(fn), False)
701 self.__sendJsonCommand("RequestLoad", { 707 self.__sendJsonCommand("RequestLoad", {
702 "workdir": wd, 708 "workdir": wd,
804 Public method to single step the debugged program. 810 Public method to single step the debugged program.
805 811
806 @param debuggerId ID of the debugger backend 812 @param debuggerId ID of the debugger backend
807 @type str 813 @type str
808 """ 814 """
815 self.__isStepCommand = True
809 self.__sendJsonCommand("RequestStep", {}, debuggerId) 816 self.__sendJsonCommand("RequestStep", {}, debuggerId)
810 817
811 def remoteStepOver(self, debuggerId): 818 def remoteStepOver(self, debuggerId):
812 """ 819 """
813 Public method to step over the debugged program. 820 Public method to step over the debugged program.
814 821
815 @param debuggerId ID of the debugger backend 822 @param debuggerId ID of the debugger backend
816 @type str 823 @type str
817 """ 824 """
825 self.__isStepCommand = True
818 self.__sendJsonCommand("RequestStepOver", {}, debuggerId) 826 self.__sendJsonCommand("RequestStepOver", {}, debuggerId)
819 827
820 def remoteStepOut(self, debuggerId): 828 def remoteStepOut(self, debuggerId):
821 """ 829 """
822 Public method to step out the debugged program. 830 Public method to step out the debugged program.
823 831
824 @param debuggerId ID of the debugger backend 832 @param debuggerId ID of the debugger backend
825 @type str 833 @type str
826 """ 834 """
835 self.__isStepCommand = True
827 self.__sendJsonCommand("RequestStepOut", {}, debuggerId) 836 self.__sendJsonCommand("RequestStepOut", {}, debuggerId)
828 837
829 def remoteStepQuit(self, debuggerId): 838 def remoteStepQuit(self, debuggerId):
830 """ 839 """
831 Public method to stop the debugged program. 840 Public method to stop the debugged program.
832 841
833 @param debuggerId ID of the debugger backend 842 @param debuggerId ID of the debugger backend
834 @type str 843 @type str
835 """ 844 """
845 self.__isStepCommand = True
836 self.__sendJsonCommand("RequestStepQuit", {}, debuggerId) 846 self.__sendJsonCommand("RequestStepQuit", {}, debuggerId)
837 847
838 def remoteContinue(self, debuggerId, special=False): 848 def remoteContinue(self, debuggerId, special=False):
839 """ 849 """
840 Public method to continue the debugged program. 850 Public method to continue the debugged program.
842 @param debuggerId ID of the debugger backend 852 @param debuggerId ID of the debugger backend
843 @type str 853 @type str
844 @param special flag indicating a special continue operation 854 @param special flag indicating a special continue operation
845 @type bool 855 @type bool
846 """ 856 """
857 self.__isStepCommand = False
847 self.__sendJsonCommand("RequestContinue", { 858 self.__sendJsonCommand("RequestContinue", {
848 "special": special, 859 "special": special,
849 }, debuggerId) 860 }, debuggerId)
850 861
851 def remoteMoveIP(self, debuggerId, line): 862 def remoteMoveIP(self, debuggerId, line):
1347 elif method == "ClientOutput": 1358 elif method == "ClientOutput":
1348 self.debugServer.signalClientOutput( 1359 self.debugServer.signalClientOutput(
1349 params["text"], params["debuggerId"]) 1360 params["text"], params["debuggerId"])
1350 1361
1351 elif method in ["ResponseLine", "ResponseStack"]: 1362 elif method in ["ResponseLine", "ResponseStack"]:
1352 # Check if obsolet thread was clicked 1363 # Check if obsolete thread was clicked
1353 if params["stack"] == []: 1364 if params["stack"] == []:
1354 # Request updated list 1365 # Request updated list
1355 self.remoteThreadList(params["debuggerId"]) 1366 self.remoteThreadList(params["debuggerId"])
1356 return 1367 return
1357 for s in params["stack"]: 1368 for s in params["stack"]:

eric ide

mercurial