Debugger/DebugServer.py

changeset 795
917f1945355c
parent 791
9ec2ac20e54e
child 892
754efacb0fbb
equal deleted inserted replaced
794:e338e1e8f3ca 795:917f1945355c
625 pass 625 pass
626 self.debuggerInterface.remoteEnvironment(envdict) 626 self.debuggerInterface.remoteEnvironment(envdict)
627 627
628 def remoteLoad(self, fn, argv, wd, env, autoClearShell = True, 628 def remoteLoad(self, fn, argv, wd, env, autoClearShell = True,
629 tracePython = False, autoContinue = True, forProject = False, 629 tracePython = False, autoContinue = True, forProject = False,
630 runInConsole = False, autoFork = False, forkChild = False): 630 runInConsole = False, autoFork = False, forkChild = False,
631 clientType = ""):
631 """ 632 """
632 Public method to load a new program to debug. 633 Public method to load a new program to debug.
633 634
634 @param fn the filename to debug (string) 635 @param fn the filename to debug (string)
635 @param argv the commandline arguments to pass to the program (string) 636 @param argv the commandline arguments to pass to the program (string)
644 @keyparam forProject flag indicating a project related action (boolean) 645 @keyparam forProject flag indicating a project related action (boolean)
645 @keyparam runInConsole flag indicating to start the debugger in a 646 @keyparam runInConsole flag indicating to start the debugger in a
646 console window (boolean) 647 console window (boolean)
647 @keyparam autoFork flag indicating the automatic fork mode (boolean) 648 @keyparam autoFork flag indicating the automatic fork mode (boolean)
648 @keyparam forkChild flag indicating to debug the child after forking (boolean) 649 @keyparam forkChild flag indicating to debug the child after forking (boolean)
650 @keyparam clientType client type to be used (string)
649 """ 651 """
650 self.__autoClearShell = autoClearShell 652 self.__autoClearShell = autoClearShell
651 self.__autoContinue = autoContinue 653 self.__autoContinue = autoContinue
652 654
653 # Restart the client 655 # Restart the client
654 try: 656 try:
655 self.__setClientType(self.__clientAssociations[os.path.splitext(fn)[1]]) 657 if clientType:
658 self.__setClientType(clientType)
659 else:
660 self.__setClientType(self.__clientAssociations[os.path.splitext(fn)[1]])
656 except KeyError: 661 except KeyError:
657 self.__setClientType('Python3') # assume it is a Python3 file 662 self.__setClientType('Python3') # assume it is a Python3 file
658 self.startClient(False, forProject = forProject, runInConsole = runInConsole) 663 self.startClient(False, forProject = forProject, runInConsole = runInConsole)
659 664
660 self.remoteEnvironment(env) 665 self.remoteEnvironment(env)
665 self.__restoreBreakpoints() 670 self.__restoreBreakpoints()
666 self.__restoreWatchpoints() 671 self.__restoreWatchpoints()
667 672
668 def remoteRun(self, fn, argv, wd, env, autoClearShell = True, 673 def remoteRun(self, fn, argv, wd, env, autoClearShell = True,
669 forProject = False, runInConsole = False, 674 forProject = False, runInConsole = False,
670 autoFork = False, forkChild = False): 675 autoFork = False, forkChild = False,
676 clientType = ""):
671 """ 677 """
672 Public method to load a new program to run. 678 Public method to load a new program to run.
673 679
674 @param fn the filename to run (string) 680 @param fn the filename to run (string)
675 @param argv the commandline arguments to pass to the program (string) 681 @param argv the commandline arguments to pass to the program (string)
680 @keyparam forProject flag indicating a project related action (boolean) 686 @keyparam forProject flag indicating a project related action (boolean)
681 @keyparam runInConsole flag indicating to start the debugger in a 687 @keyparam runInConsole flag indicating to start the debugger in a
682 console window (boolean) 688 console window (boolean)
683 @keyparam autoFork flag indicating the automatic fork mode (boolean) 689 @keyparam autoFork flag indicating the automatic fork mode (boolean)
684 @keyparam forkChild flag indicating to debug the child after forking (boolean) 690 @keyparam forkChild flag indicating to debug the child after forking (boolean)
691 @keyparam clientType client type to be used (string)
685 """ 692 """
686 self.__autoClearShell = autoClearShell 693 self.__autoClearShell = autoClearShell
687 694
688 # Restart the client 695 # Restart the client
689 try: 696 try:
690 self.__setClientType(self.__clientAssociations[os.path.splitext(fn)[1]]) 697 if clientType:
698 self.__setClientType(clientType)
699 else:
700 self.__setClientType(self.__clientAssociations[os.path.splitext(fn)[1]])
691 except KeyError: 701 except KeyError:
692 self.__setClientType('Python3') # assume it is a Python3 file 702 self.__setClientType('Python3') # assume it is a Python3 file
693 self.startClient(False, forProject = forProject, runInConsole = runInConsole) 703 self.startClient(False, forProject = forProject, runInConsole = runInConsole)
694 704
695 self.remoteEnvironment(env) 705 self.remoteEnvironment(env)
696 706
697 self.debuggerInterface.remoteRun(fn, argv, wd, autoFork, forkChild) 707 self.debuggerInterface.remoteRun(fn, argv, wd, autoFork, forkChild)
698 self.debugging = False 708 self.debugging = False
699 709
700 def remoteCoverage(self, fn, argv, wd, env, autoClearShell = True, 710 def remoteCoverage(self, fn, argv, wd, env, autoClearShell = True,
701 erase = False, forProject = False, runInConsole = False): 711 erase = False, forProject = False, runInConsole = False,
712 clientType = ""):
702 """ 713 """
703 Public method to load a new program to collect coverage data. 714 Public method to load a new program to collect coverage data.
704 715
705 @param fn the filename to run (string) 716 @param fn the filename to run (string)
706 @param argv the commandline arguments to pass to the program (string) 717 @param argv the commandline arguments to pass to the program (string)
711 @keyparam erase flag indicating that coverage info should be 722 @keyparam erase flag indicating that coverage info should be
712 cleared first (boolean) 723 cleared first (boolean)
713 @keyparam forProject flag indicating a project related action (boolean) 724 @keyparam forProject flag indicating a project related action (boolean)
714 @keyparam runInConsole flag indicating to start the debugger in a 725 @keyparam runInConsole flag indicating to start the debugger in a
715 console window (boolean) 726 console window (boolean)
727 @keyparam clientType client type to be used (string)
716 """ 728 """
717 self.__autoClearShell = autoClearShell 729 self.__autoClearShell = autoClearShell
718 730
719 # Restart the client 731 # Restart the client
720 try: 732 try:
721 self.__setClientType(self.__clientAssociations[os.path.splitext(fn)[1]]) 733 if clientType:
734 self.__setClientType(clientType)
735 else:
736 self.__setClientType(self.__clientAssociations[os.path.splitext(fn)[1]])
722 except KeyError: 737 except KeyError:
723 self.__setClientType('Python3') # assume it is a Python3 file 738 self.__setClientType('Python3') # assume it is a Python3 file
724 self.startClient(False, forProject = forProject, runInConsole = runInConsole) 739 self.startClient(False, forProject = forProject, runInConsole = runInConsole)
725 740
726 self.remoteEnvironment(env) 741 self.remoteEnvironment(env)
728 self.debuggerInterface.remoteCoverage(fn, argv, wd, erase) 743 self.debuggerInterface.remoteCoverage(fn, argv, wd, erase)
729 self.debugging = False 744 self.debugging = False
730 745
731 def remoteProfile(self, fn, argv, wd, env, autoClearShell = True, 746 def remoteProfile(self, fn, argv, wd, env, autoClearShell = True,
732 erase = False, forProject = False, 747 erase = False, forProject = False,
733 runInConsole = False): 748 runInConsole = False,
749 clientType = ""):
734 """ 750 """
735 Public method to load a new program to collect profiling data. 751 Public method to load a new program to collect profiling data.
736 752
737 @param fn the filename to run (string) 753 @param fn the filename to run (string)
738 @param argv the commandline arguments to pass to the program (string) 754 @param argv the commandline arguments to pass to the program (string)
742 be cleared (boolean) 758 be cleared (boolean)
743 @keyparam erase flag indicating that timing info should be cleared first (boolean) 759 @keyparam erase flag indicating that timing info should be cleared first (boolean)
744 @keyparam forProject flag indicating a project related action (boolean) 760 @keyparam forProject flag indicating a project related action (boolean)
745 @keyparam runInConsole flag indicating to start the debugger in a 761 @keyparam runInConsole flag indicating to start the debugger in a
746 console window (boolean) 762 console window (boolean)
763 @keyparam clientType client type to be used (string)
747 """ 764 """
748 self.__autoClearShell = autoClearShell 765 self.__autoClearShell = autoClearShell
749 766
750 # Restart the client 767 # Restart the client
751 try: 768 try:
752 self.__setClientType(self.__clientAssociations[os.path.splitext(fn)[1]]) 769 if clientType:
770 self.__setClientType(clientType)
771 else:
772 self.__setClientType(self.__clientAssociations[os.path.splitext(fn)[1]])
753 except KeyError: 773 except KeyError:
754 self.__setClientType('Python3') # assume it is a Python3 file 774 self.__setClientType('Python3') # assume it is a Python3 file
755 self.startClient(False, forProject = forProject, runInConsole = runInConsole) 775 self.startClient(False, forProject = forProject, runInConsole = runInConsole)
756 776
757 self.remoteEnvironment(env) 777 self.remoteEnvironment(env)

eric ide

mercurial