98 Preferences.getSettings().value("DebugInfo/Exceptions") |
98 Preferences.getSettings().value("DebugInfo/Exceptions") |
99 ) |
99 ) |
100 self.excIgnoreList = Preferences.toList( |
100 self.excIgnoreList = Preferences.toList( |
101 Preferences.getSettings().value("DebugInfo/IgnoredExceptions") |
101 Preferences.getSettings().value("DebugInfo/IgnoredExceptions") |
102 ) |
102 ) |
103 self.exceptions = Preferences.toBool( |
|
104 Preferences.getSettings().value("DebugInfo/ReportExceptions", True) |
|
105 ) |
|
106 self.unhandledExceptions = Preferences.toBool( |
|
107 Preferences.getSettings().value("DebugInfo/ReportUnhandledExceptions", True) |
|
108 ) |
|
109 self.autoClearShell = Preferences.toBool( |
103 self.autoClearShell = Preferences.toBool( |
110 Preferences.getSettings().value("DebugInfo/AutoClearShell", True) |
104 Preferences.getSettings().value("DebugInfo/AutoClearShell", True) |
111 ) |
105 ) |
112 self.tracePython = Preferences.toBool( |
106 self.tracePython = Preferences.toBool( |
113 Preferences.getSettings().value("DebugInfo/TracePython", False) |
107 Preferences.getSettings().value("DebugInfo/TracePython", False) |
114 ) |
108 ) |
115 self.autoContinue = Preferences.toBool( |
109 self.autoContinue = Preferences.toBool( |
116 Preferences.getSettings().value("DebugInfo/AutoContinue", True) |
110 Preferences.getSettings().value("DebugInfo/AutoContinue", True) |
|
111 ) |
|
112 self.reportAllExceptions = Preferences.toBool( |
|
113 Preferences.getSettings().value("DebugInfo/ReportAllExceptions", False) |
117 ) |
114 ) |
118 self.enableMultiprocess = Preferences.toBool( |
115 self.enableMultiprocess = Preferences.toBool( |
119 Preferences.getSettings().value("DebugInfo/EnableMultiprocess", False) |
116 Preferences.getSettings().value("DebugInfo/EnableMultiprocess", False) |
120 ) |
117 ) |
121 self.multiprocessNoDebugHistory = Preferences.toList( |
118 self.multiprocessNoDebugHistory = Preferences.toList( |
962 else: |
959 else: |
963 if envStr in self.envHistory: |
960 if envStr in self.envHistory: |
964 self.envHistory.remove(envStr) |
961 self.envHistory.remove(envStr) |
965 self.envHistory.insert(0, envStr) |
962 self.envHistory.insert(0, envStr) |
966 |
963 |
967 def setExceptionReporting(self, exceptions, unhandledExceptions=True): |
964 def setExceptionReporting(self, reportAllExceptions): |
968 """ |
965 """ |
969 Public slot to initialize the exception reporting flag. |
966 Public slot to initialize the exception reporting flag. |
970 |
967 |
971 @param exceptions flag indicating exception reporting status |
968 @param reportAllExceptions flag indicating to report all exceptions |
972 @type bool |
969 @type bool |
973 @param unhandledExceptions flag indicating to always report unhandled exceptions |
970 """ |
974 @type bool |
971 self.reportAllExceptions = reportAllExceptions |
975 """ |
|
976 self.exceptions = exceptions |
|
977 self.unhandledExceptions = unhandledExceptions |
|
978 |
972 |
979 def setExcList(self, excList): |
973 def setExcList(self, excList): |
980 """ |
974 """ |
981 Public slot to initialize the exceptions type list. |
975 Public slot to initialize the exceptions type list. |
982 |
976 |
1184 Preferences.getSettings().setValue("DebugInfo/Exceptions", self.excList) |
1178 Preferences.getSettings().setValue("DebugInfo/Exceptions", self.excList) |
1185 Preferences.getSettings().setValue( |
1179 Preferences.getSettings().setValue( |
1186 "DebugInfo/IgnoredExceptions", self.excIgnoreList |
1180 "DebugInfo/IgnoredExceptions", self.excIgnoreList |
1187 ) |
1181 ) |
1188 Preferences.getSettings().setValue( |
1182 Preferences.getSettings().setValue( |
1189 "DebugInfo/ReportExceptions", self.exceptions |
|
1190 ) |
|
1191 Preferences.getSettings().setValue( |
|
1192 "DebugInfo/ReportUnhandledExceptions", self.unhandledExceptions |
|
1193 ) |
|
1194 Preferences.getSettings().setValue( |
|
1195 "DebugInfo/AutoClearShell", self.autoClearShell |
1183 "DebugInfo/AutoClearShell", self.autoClearShell |
1196 ) |
1184 ) |
1197 Preferences.getSettings().setValue("DebugInfo/TracePython", self.tracePython) |
1185 Preferences.getSettings().setValue("DebugInfo/TracePython", self.tracePython) |
1198 Preferences.getSettings().setValue("DebugInfo/AutoContinue", self.autoContinue) |
1186 Preferences.getSettings().setValue("DebugInfo/AutoContinue", self.autoContinue) |
|
1187 Preferences.getSettings().setValue( |
|
1188 "DebugInfo/ReportAllExceptions", self.reportAllExceptions |
|
1189 ) |
1199 Preferences.getSettings().setValue( |
1190 Preferences.getSettings().setValue( |
1200 "DebugInfo/EnableMultiprocess", self.enableMultiprocess |
1191 "DebugInfo/EnableMultiprocess", self.enableMultiprocess |
1201 ) |
1192 ) |
1202 Preferences.getSettings().setValue( |
1193 Preferences.getSettings().setValue( |
1203 "DebugInfo/MultiprocessNoDebugHistory", self.multiprocessNoDebugHistory |
1194 "DebugInfo/MultiprocessNoDebugHistory", self.multiprocessNoDebugHistory |
1432 ), |
1423 ), |
1433 ) |
1424 ) |
1434 return |
1425 return |
1435 |
1426 |
1436 if ( |
1427 if ( |
1437 self.exceptions |
1428 self.reportAllExceptions |
1438 and exceptionType not in self.excIgnoreList |
1429 and exceptionType not in self.excIgnoreList |
1439 and (len(self.excList) == 0 or exceptionType in self.excList) |
1430 and (len(self.excList) == 0 or exceptionType in self.excList) |
1440 ) or (self.unhandledExceptions and exceptionType.startswith("unhandled")): |
1431 ) or exceptionType.startswith("unhandled"): |
1441 res = None |
1432 res = None |
1442 if stackTrace: |
1433 if stackTrace: |
1443 with contextlib.suppress(UnicodeError, OSError): |
1434 with contextlib.suppress(UnicodeError, OSError): |
1444 file, line = stackTrace[0][:2] |
1435 file, line = stackTrace[0][:2] |
1445 source, encoding = Utilities.readEncodedFile(file) |
1436 source, encoding = Utilities.readEncodedFile(file) |
1953 cap, |
1944 cap, |
1954 self.lastUsedVenvName, |
1945 self.lastUsedVenvName, |
1955 self.argvHistory, |
1946 self.argvHistory, |
1956 self.wdHistory, |
1947 self.wdHistory, |
1957 self.envHistory, |
1948 self.envHistory, |
1958 self.exceptions, |
|
1959 self.unhandledExceptions, |
|
1960 self.ui, |
1949 self.ui, |
1961 StartDialogMode.Coverage, |
1950 StartDialogMode.Coverage, |
1962 autoClearShell=self.autoClearShell, |
1951 autoClearShell=self.autoClearShell, |
1963 configOverride=self.overrideGlobalConfig, |
1952 configOverride=self.overrideGlobalConfig, |
1964 forProject=runProject, |
1953 forProject=runProject, |
2041 # of the list. |
2027 # of the list. |
2042 self.setScriptsHistory(scriptName) |
2028 self.setScriptsHistory(scriptName) |
2043 self.setArgvHistory(argv) |
2029 self.setArgvHistory(argv) |
2044 self.setWdHistory(wd) |
2030 self.setWdHistory(wd) |
2045 self.setEnvHistory(env) |
2031 self.setEnvHistory(env) |
2046 |
|
2047 # Save the exception flags |
|
2048 self.exceptions = exceptions |
|
2049 self.unhandledExceptions = unhandledExceptions |
|
2050 |
2032 |
2051 # Save the erase coverage flag |
2033 # Save the erase coverage flag |
2052 self.eraseCoverage = eraseCoverage |
2034 self.eraseCoverage = eraseCoverage |
2053 |
2035 |
2054 # Save the clear interpreter flag |
2036 # Save the clear interpreter flag |
2157 cap, |
2139 cap, |
2158 self.lastUsedVenvName, |
2140 self.lastUsedVenvName, |
2159 self.argvHistory, |
2141 self.argvHistory, |
2160 self.wdHistory, |
2142 self.wdHistory, |
2161 self.envHistory, |
2143 self.envHistory, |
2162 self.exceptions, |
|
2163 self.unhandledExceptions, |
|
2164 self.ui, |
2144 self.ui, |
2165 StartDialogMode.Profile, |
2145 StartDialogMode.Profile, |
2166 autoClearShell=self.autoClearShell, |
2146 autoClearShell=self.autoClearShell, |
2167 configOverride=self.overrideGlobalConfig, |
2147 configOverride=self.overrideGlobalConfig, |
2168 forProject=runProject, |
2148 forProject=runProject, |
2245 # of the list. |
2222 # of the list. |
2246 self.setScriptsHistory(scriptName) |
2223 self.setScriptsHistory(scriptName) |
2247 self.setArgvHistory(argv) |
2224 self.setArgvHistory(argv) |
2248 self.setWdHistory(wd) |
2225 self.setWdHistory(wd) |
2249 self.setEnvHistory(env) |
2226 self.setEnvHistory(env) |
2250 |
|
2251 # Save the exception flags |
|
2252 self.exceptions = exceptions |
|
2253 self.unhandledExceptions = unhandledExceptions |
|
2254 |
2227 |
2255 # Save the erase timing flag |
2228 # Save the erase timing flag |
2256 self.eraseTimings = eraseTimings |
2229 self.eraseTimings = eraseTimings |
2257 |
2230 |
2258 # Save the clear interpreter flag |
2231 # Save the clear interpreter flag |
2357 cap, |
2330 cap, |
2358 self.lastUsedVenvName, |
2331 self.lastUsedVenvName, |
2359 self.argvHistory, |
2332 self.argvHistory, |
2360 self.wdHistory, |
2333 self.wdHistory, |
2361 self.envHistory, |
2334 self.envHistory, |
2362 self.exceptions, |
|
2363 self.unhandledExceptions, |
|
2364 self.ui, |
2335 self.ui, |
2365 StartDialogMode.Run, |
2336 StartDialogMode.Run, |
2366 autoClearShell=self.autoClearShell, |
2337 autoClearShell=self.autoClearShell, |
2367 configOverride=self.overrideGlobalConfig, |
2338 configOverride=self.overrideGlobalConfig, |
2368 forProject=runProject, |
2339 forProject=runProject, |
2444 # of the list. |
2412 # of the list. |
2445 self.setScriptsHistory(scriptName) |
2413 self.setScriptsHistory(scriptName) |
2446 self.setArgvHistory(argv) |
2414 self.setArgvHistory(argv) |
2447 self.setWdHistory(wd) |
2415 self.setWdHistory(wd) |
2448 self.setEnvHistory(env) |
2416 self.setEnvHistory(env) |
2449 |
|
2450 # Save the exception flags |
|
2451 self.exceptions = exceptions |
|
2452 self.unhandledExceptions = unhandledExceptions |
|
2453 |
2417 |
2454 # Save the clear interpreter flag |
2418 # Save the clear interpreter flag |
2455 self.autoClearShell = clearShell |
2419 self.autoClearShell = clearShell |
2456 |
2420 |
2457 # Save the run in console flag |
2421 # Save the run in console flag |
2552 cap, |
2516 cap, |
2553 self.lastUsedVenvName, |
2517 self.lastUsedVenvName, |
2554 self.argvHistory, |
2518 self.argvHistory, |
2555 self.wdHistory, |
2519 self.wdHistory, |
2556 self.envHistory, |
2520 self.envHistory, |
2557 self.exceptions, |
|
2558 self.unhandledExceptions, |
|
2559 self.ui, |
2521 self.ui, |
2560 StartDialogMode.Debug, |
2522 StartDialogMode.Debug, |
2561 tracePython=self.tracePython, |
2523 tracePython=self.tracePython, |
2562 autoClearShell=self.autoClearShell, |
2524 autoClearShell=self.autoClearShell, |
2563 autoContinue=self.autoContinue, |
2525 autoContinue=self.autoContinue, |
|
2526 reportAllExceptions=self.reportAllExceptions, |
2564 enableMultiprocess=self.enableMultiprocess, |
2527 enableMultiprocess=self.enableMultiprocess, |
2565 multiprocessNoDebugHistory=self.multiprocessNoDebugHistory, |
2528 multiprocessNoDebugHistory=self.multiprocessNoDebugHistory, |
2566 configOverride=self.overrideGlobalConfig, |
2529 configOverride=self.overrideGlobalConfig, |
2567 forProject=debugProject, |
2530 forProject=debugProject, |
2568 scriptName=scriptName, |
2531 scriptName=scriptName, |
2600 self.project.setDbgInfo( |
2562 self.project.setDbgInfo( |
2601 lastUsedVenvName, |
2563 lastUsedVenvName, |
2602 argv, |
2564 argv, |
2603 wd, |
2565 wd, |
2604 env, |
2566 env, |
2605 exceptions, |
|
2606 self.excList, |
2567 self.excList, |
2607 self.excIgnoreList, |
2568 self.excIgnoreList, |
2608 clearShell, |
2569 clearShell, |
2609 tracePython=tracePython, |
2570 tracePython=tracePython, |
2610 autoContinue=autoContinue, |
2571 autoContinue=autoContinue, |
|
2572 reportAllExceptions=reportAllExceptions, |
2611 enableMultiprocess=enableMultiprocess, |
2573 enableMultiprocess=enableMultiprocess, |
2612 multiprocessNoDebug=multiprocessNoDebug, |
2574 multiprocessNoDebug=multiprocessNoDebug, |
2613 configOverride=configOverride, |
2575 configOverride=configOverride, |
2614 ) |
2576 ) |
2615 |
2577 |
2654 self.setScriptsHistory(scriptName) |
2616 self.setScriptsHistory(scriptName) |
2655 self.setArgvHistory(argv) |
2617 self.setArgvHistory(argv) |
2656 self.setWdHistory(wd) |
2618 self.setWdHistory(wd) |
2657 self.setEnvHistory(env) |
2619 self.setEnvHistory(env) |
2658 |
2620 |
2659 # Save the exception flags |
|
2660 self.exceptions = exceptions |
|
2661 self.unhandledExceptions = unhandledExceptions |
|
2662 |
|
2663 # Save the tracePython flag |
2621 # Save the tracePython flag |
2664 self.tracePython = tracePython |
2622 self.tracePython = tracePython |
2665 |
2623 |
2666 # Save the clear interpreter flag |
2624 # Save the clear interpreter flag |
2667 self.autoClearShell = clearShell |
2625 self.autoClearShell = clearShell |
2669 # Save the run in console flag |
2627 # Save the run in console flag |
2670 self.runInConsole = console |
2628 self.runInConsole = console |
2671 |
2629 |
2672 # Save the auto continue flag |
2630 # Save the auto continue flag |
2673 self.autoContinue = autoContinue |
2631 self.autoContinue = autoContinue |
|
2632 |
|
2633 # Save the exception reporting flag |
|
2634 self.reportAllExceptions = reportAllExceptions |
2674 |
2635 |
2675 # Save the multiprocess debugging data |
2636 # Save the multiprocess debugging data |
2676 self.enableMultiprocess = enableMultiprocess |
2637 self.enableMultiprocess = enableMultiprocess |
2677 self.setMultiprocessNoDebugHistory(multiprocessNoDebug) |
2638 self.setMultiprocessNoDebugHistory(multiprocessNoDebug) |
2678 |
2639 |
2710 clientType=self.clientType, |
2671 clientType=self.clientType, |
2711 enableCallTrace=enableCallTrace, |
2672 enableCallTrace=enableCallTrace, |
2712 enableMultiprocess=enableMultiprocess, |
2673 enableMultiprocess=enableMultiprocess, |
2713 multiprocessNoDebug=multiprocessNoDebug, |
2674 multiprocessNoDebug=multiprocessNoDebug, |
2714 configOverride=self.overrideGlobalConfig, |
2675 configOverride=self.overrideGlobalConfig, |
|
2676 reportAllExceptions=self.reportAllExceptions, |
2715 ) |
2677 ) |
2716 |
2678 |
2717 if ( |
2679 if ( |
2718 self.debugServer.isClientProcessUp() |
2680 self.debugServer.isClientProcessUp() |
2719 and self.debugServer.getClientType() == self.clientType |
2681 and self.debugServer.getClientType() == self.clientType |