--- a/src/eric7/DebugClients/Python/DebugClientBase.py Fri Nov 17 17:53:14 2023 +0100 +++ b/src/eric7/DebugClients/Python/DebugClientBase.py Sat Nov 18 15:18:17 2023 +0100 @@ -179,6 +179,7 @@ self.test = None self.debugging = False self.multiprocessSupport = False + self.reportAllExceptions = False self.noDebugList = [] self.readstream = None @@ -268,6 +269,7 @@ self.debugging = False self.multiprocessSupport = False + self.reportAllExceptions = False self.noDebugList = [] # make sure we close down our end of the socket @@ -470,6 +472,7 @@ self.running = sys.argv[0] self.debugging = True self.multiprocessSupport = params["multiprocess"] + self.reportAllExceptions = params["reportAllExceptions"] self.threads.clear() self.attachThread(mainThread=True) @@ -997,20 +1000,20 @@ }, ) - def sendPassiveStartup(self, filename, exceptions): + def sendPassiveStartup(self, filename, reportAllExceptions): """ Public method to send the passive start information. @param filename name of the script @type str - @param exceptions flag to enable exception reporting of the IDE + @param reportAllExceptions flag to enable reporting of all exceptions @type bool """ self.sendJsonCommand( "PassiveStartup", { "filename": filename, - "exceptions": exceptions, + "reportAllExceptions": reportAllExceptions, }, ) @@ -1765,7 +1768,7 @@ host=None, port=None, enableTrace=True, - exceptions=True, # noqa: U100 + reportAllExceptions=False, tracePython=False, redirect=True, passive=True, @@ -1782,7 +1785,8 @@ @type int @param enableTrace flag to enable the tracing function @type bool - @param exceptions flag to enable exception reporting of the IDE + @param reportAllExceptions flag indicating to report all exceptions + instead of unhandled exceptions only @type bool @param tracePython flag to enable tracing into the Python library @type bool @@ -1820,6 +1824,9 @@ self.dircache = [] self.debugging = True + # all exceptions reporting + self.reportAllExceptions = reportAllExceptions + self.attachThread(mainThread=True) self.mainThread.tracePythonLibs(tracePython) @@ -1838,11 +1845,11 @@ wd="", host=None, port=None, - exceptions=True, tracePython=False, redirect=True, passive=True, multiprocessSupport=False, + reportAllExceptions=False, callTraceOptimization=False, codeStr="", scriptModule="", @@ -1858,8 +1865,6 @@ @type str @param port portnumber of the debug server @type int - @param exceptions flag to enable exception reporting of the IDE - @type bool @param tracePython flag to enable tracing into the Python library @type bool @param redirect flag indicating redirection of stdin, stdout and @@ -1870,6 +1875,9 @@ @param multiprocessSupport flag indicating to enable multiprocess debugging support @type bool + @param reportAllExceptions flag indicating to report all exceptions instead + of unhandled exceptions only + @type bool @param callTraceOptimization flag indicating to speed up function/method call tracing @type bool @@ -1914,11 +1922,12 @@ self.__setCoding(self.running) self.debugging = True self.multiprocessSupport = multiprocessSupport + self.reportAllExceptions = reportAllExceptions self.callTraceOptimization = callTraceOptimization self.passive = passive if passive: - self.sendPassiveStartup(self.running, exceptions) + self.sendPassiveStartup(self.running, reportAllExceptions) self.attachThread(mainThread=True) self.mainThread.tracePythonLibs(tracePython) @@ -2004,10 +2013,10 @@ port = None wd = "" tracePython = False - exceptions = True redirect = True passive = True multiprocess = False + reportAllExceptions = False callTraceOptimization = False codeStr = "" scriptModule = "" @@ -2027,9 +2036,6 @@ elif args[0] == "-t": tracePython = True del args[0] - elif args[0] == "-e": - exceptions = False - del args[0] elif args[0] == "-n": redirect = False del args[0] @@ -2042,6 +2048,9 @@ elif args[0] == "--multiprocess": multiprocess = True del args[0] + elif args[0] == "--report-exceptions": + reportAllExceptions = True + del args[0] elif args[0] == "--call-trace-optimization": callTraceOptimization = True del args[0] @@ -2070,7 +2079,7 @@ wd, host, port, - exceptions, + reportAllExceptions, tracePython, redirect, self.noencoding, @@ -2083,11 +2092,11 @@ wd, host, port, - exceptions=exceptions, tracePython=tracePython, redirect=redirect, passive=passive, multiprocessSupport=multiprocess, + reportAllExceptions=reportAllExceptions, callTraceOptimization=callTraceOptimization, codeStr=codeStr, scriptModule=scriptModule, @@ -2141,7 +2150,7 @@ "", remoteAddress, port, - True, + False, False, redirect, self.noencoding,