Debugger/DebugUI.py

changeset 2622
08cc2f31c983
parent 2430
fd7fa26076d2
child 2677
3d4277929fb3
child 2703
910bdc75c757
equal deleted inserted replaced
2621:ab5918079c38 2622:08cc2f31c983
1027 (len(self.excList) and exceptionType in self.excList)))\ 1027 (len(self.excList) and exceptionType in self.excList)))\
1028 or exceptionType.startswith('unhandled'): 1028 or exceptionType.startswith('unhandled'):
1029 res = None 1029 res = None
1030 if stackTrace: 1030 if stackTrace:
1031 try: 1031 try:
1032 file, line = stackTrace[0] 1032 file, line = stackTrace[0][:2]
1033 source, encoding = Utilities.readEncodedFile(file) 1033 source, encoding = Utilities.readEncodedFile(file)
1034 source = source.splitlines(True) 1034 source = source.splitlines(True)
1035 if len(source) >= line and \ 1035 if len(source) >= line and \
1036 "__IGNORE_EXCEPTION__" in Utilities.extractLineFlags( 1036 "__IGNORE_EXCEPTION__" in Utilities.extractLineFlags(
1037 source[line - 1]): 1037 source[line - 1]):
1071 .format(exceptionType, 1071 .format(exceptionType,
1072 Utilities.html_encode(exceptionMessage))) 1072 Utilities.html_encode(exceptionMessage)))
1073 if res == E5MessageBox.Yes: 1073 if res == E5MessageBox.Yes:
1074 self.exceptionInterrupt.emit() 1074 self.exceptionInterrupt.emit()
1075 stack = [] 1075 stack = []
1076 for fn, ln in stackTrace: 1076 for fn, ln, func, args in stackTrace:
1077 stack.append((fn, ln, '')) 1077 stack.append((fn, ln, func, args))
1078 self.clientStack.emit(stack) 1078 self.clientStack.emit(stack)
1079 self.__getClientVariables() 1079 self.__getClientVariables()
1080 self.ui.setDebugProfile() 1080 self.ui.setDebugProfile()
1081 return 1081 return
1082 elif res == E5MessageBox.Ignore: 1082 elif res == E5MessageBox.Ignore:
1454 if not doNotStart: 1454 if not doNotStart:
1455 if runProject and self.project.getProjectType() == "E4Plugin": 1455 if runProject and self.project.getProjectType() == "E4Plugin":
1456 argv = '--plugin="{0}" {1}'.format(fn, argv) 1456 argv = '--plugin="{0}" {1}'.format(fn, argv)
1457 fn = os.path.join(getConfig('ericDir'), "eric5.py") 1457 fn = os.path.join(getConfig('ericDir'), "eric5.py")
1458 1458
1459 self.debugViewer.initCallStackViewer(runProject)
1460
1459 # Ask the client to open the new program. 1461 # Ask the client to open the new program.
1460 self.debugServer.remoteCoverage(fn, argv, wd, env, 1462 self.debugServer.remoteCoverage(fn, argv, wd, env,
1461 autoClearShell=self.autoClearShell, erase=eraseCoverage, 1463 autoClearShell=self.autoClearShell, erase=eraseCoverage,
1462 forProject=runProject, runInConsole=console, 1464 forProject=runProject, runInConsole=console,
1463 clientType=self.clientType) 1465 clientType=self.clientType)
1562 1564
1563 if not doNotStart: 1565 if not doNotStart:
1564 if runProject and self.project.getProjectType() == "E4Plugin": 1566 if runProject and self.project.getProjectType() == "E4Plugin":
1565 argv = '--plugin="{0}" {1}'.format(fn, argv) 1567 argv = '--plugin="{0}" {1}'.format(fn, argv)
1566 fn = os.path.join(getConfig('ericDir'), "eric5.py") 1568 fn = os.path.join(getConfig('ericDir'), "eric5.py")
1569
1570 self.debugViewer.initCallStackViewer(runProject)
1567 1571
1568 # Ask the client to open the new program. 1572 # Ask the client to open the new program.
1569 self.debugServer.remoteProfile(fn, argv, wd, env, 1573 self.debugServer.remoteProfile(fn, argv, wd, env,
1570 autoClearShell=self.autoClearShell, erase=eraseTimings, 1574 autoClearShell=self.autoClearShell, erase=eraseTimings,
1571 forProject=runProject, runInConsole=console, 1575 forProject=runProject, runInConsole=console,
1675 if not doNotStart: 1679 if not doNotStart:
1676 if runProject and self.project.getProjectType() == "E4Plugin": 1680 if runProject and self.project.getProjectType() == "E4Plugin":
1677 argv = '--plugin="{0}" {1}'.format(fn, argv) 1681 argv = '--plugin="{0}" {1}'.format(fn, argv)
1678 fn = os.path.join(getConfig('ericDir'), "eric5.py") 1682 fn = os.path.join(getConfig('ericDir'), "eric5.py")
1679 1683
1684 self.debugViewer.initCallStackViewer(runProject)
1685
1680 # Ask the client to open the new program. 1686 # Ask the client to open the new program.
1681 self.debugServer.remoteRun(fn, argv, wd, env, 1687 self.debugServer.remoteRun(fn, argv, wd, env,
1682 autoClearShell=self.autoClearShell, forProject=runProject, 1688 autoClearShell=self.autoClearShell, forProject=runProject,
1683 runInConsole=console, autoFork=forkAutomatically, 1689 runInConsole=console, autoFork=forkAutomatically,
1684 forkChild=forkIntoChild, clientType=self.clientType) 1690 forkChild=forkIntoChild, clientType=self.clientType)
1794 if not doNotStart: 1800 if not doNotStart:
1795 if debugProject and self.project.getProjectType() == "E4Plugin": 1801 if debugProject and self.project.getProjectType() == "E4Plugin":
1796 argv = '--plugin="{0}" {1}'.format(fn, argv) 1802 argv = '--plugin="{0}" {1}'.format(fn, argv)
1797 fn = os.path.join(getConfig('ericDir'), "eric5.py") 1803 fn = os.path.join(getConfig('ericDir'), "eric5.py")
1798 tracePython = True # override flag because it must be true 1804 tracePython = True # override flag because it must be true
1805
1806 self.debugViewer.initCallStackViewer(debugProject)
1799 1807
1800 # Ask the client to send call trace info 1808 # Ask the client to send call trace info
1801 enableCallTrace = self.debugViewer.isCallTraceEnabled() 1809 enableCallTrace = self.debugViewer.isCallTraceEnabled()
1802 self.debugViewer.clearCallTrace() 1810 self.debugViewer.clearCallTrace()
1803 self.debugViewer.setCallTraceToProjectMode(debugProject) 1811 self.debugViewer.setCallTraceToProjectMode(debugProject)
1851 if not doNotStart: 1859 if not doNotStart:
1852 if forProject and self.project.getProjectType() == "E4Plugin": 1860 if forProject and self.project.getProjectType() == "E4Plugin":
1853 argv = '--plugin="{0}" {1}'.format(fn, argv) 1861 argv = '--plugin="{0}" {1}'.format(fn, argv)
1854 fn = os.path.join(getConfig('ericDir'), "eric5.py") 1862 fn = os.path.join(getConfig('ericDir'), "eric5.py")
1855 1863
1864 self.debugViewer.initCallStackViewer(forProject)
1865
1856 if self.lastStartAction in [1, 2]: 1866 if self.lastStartAction in [1, 2]:
1857 # Ask the client to send call trace info 1867 # Ask the client to send call trace info
1858 enableCallTrace = self.debugViewer.isCallTraceEnabled() 1868 enableCallTrace = self.debugViewer.isCallTraceEnabled()
1859 self.debugViewer.clearCallTrace() 1869 self.debugViewer.clearCallTrace()
1860 self.debugViewer.setCallTraceToProjectMode(forProject) 1870 self.debugViewer.setCallTraceToProjectMode(forProject)
1915 # Set exception reporting 1925 # Set exception reporting
1916 self.setExceptionReporting(exc) 1926 self.setExceptionReporting(exc)
1917 1927
1918 # Signal that we have started a debugging session 1928 # Signal that we have started a debugging session
1919 self.debuggingStarted.emit(fn) 1929 self.debuggingStarted.emit(fn)
1930
1931 # Initialize the call stack viewer
1932 self.debugViewer.initCallStackViewer(False)
1920 1933
1921 def __continue(self): 1934 def __continue(self):
1922 """ 1935 """
1923 Private method to handle the Continue action. 1936 Private method to handle the Continue action.
1924 """ 1937 """

eric ide

mercurial