Tue, 04 Oct 2016 21:45:33 +0200
Change evaluation of last frame to run atexit functions again.
DebugClients/Python/DebugBase.py | file | annotate | diff | comparison | revisions | |
DebugClients/Python/DebugClientBase.py | file | annotate | diff | comparison | revisions |
--- a/DebugClients/Python/DebugBase.py Tue Oct 04 21:25:15 2016 +0200 +++ b/DebugClients/Python/DebugBase.py Tue Oct 04 21:45:33 2016 +0200 @@ -316,9 +316,8 @@ if event == 'call': if self.botframe is None and frame.f_lineno > 1: - self.botframe = frame.f_back + self.botframe = frame frame.f_trace = self.trace_dispatch - self._dbgClient.mainFrame = frame self.user_line(frame) return self.trace_dispatch @@ -331,12 +330,12 @@ return self.trace_dispatch if event == 'return': - if self.stop_here(frame): + if self.stop_here(frame) or frame == self.botframe: # Ignore return events in generator except when stepping. if self.stopframe and frame.f_code.co_flags & CO_GENERATOR: return # The program has finished if we have just left the first frame - if (frame == self._dbgClient.mainFrame and + if (frame == self.botframe and self._mainThread): atexit._run_exitfuncs() self._dbgClient.progTerminated(arg) @@ -396,7 +395,6 @@ if frame.f_back.f_code == self.stopOnHandleLine: frame.f_trace = self.trace_dispatch self.botframe = frame - self._dbgClient.mainFrame = frame break frame = frame.f_back @@ -457,7 +455,7 @@ """ # Here we only set a new stop frame if it is a normal continue. if not special: - self._set_stopinfo(self.botframe, None) + self._set_stopinfo(None, None) # Disable tracing if not started in debug mode if not self._dbgClient.debugging: @@ -909,8 +907,7 @@ return (self.stop_everywhere or frame is self.stopframe or - frame is self.returnframe or - frame is self.botframe) + frame is self.returnframe) def tracePythonLibs(self, enable): """
--- a/DebugClients/Python/DebugClientBase.py Tue Oct 04 21:25:15 2016 +0200 +++ b/DebugClients/Python/DebugClientBase.py Tue Oct 04 21:45:33 2016 +0200 @@ -202,7 +202,6 @@ # special objects representing the main scripts thread and frame self.mainThread = self - self.mainFrame = None self.framenr = 0 # The context to run the debugged program in. @@ -525,7 +524,6 @@ os.chdir(params["workdir"]) self.running = sys.argv[0] - self.mainFrame = None self.debugging = True self.fork_auto = params["autofork"] @@ -567,7 +565,6 @@ os.chdir(params["workdir"]) self.running = sys.argv[0] - self.mainFrame = None self.botframe = None self.fork_auto = params["autofork"] @@ -1882,7 +1879,6 @@ # setup the debugger variables self._fncache = {} self.dircache = [] - self.mainFrame = None self.debugging = True self.attachThread(mainThread=True) @@ -1934,7 +1930,6 @@ os.chdir(wd) self.running = sys.argv[0] self.__setCoding(self.running) - self.mainFrame = None self.debugging = True self.passive = True