DebugClients/Python/DebugBase.py

branch
debugger speed
changeset 5205
df1709f0e49f
parent 5204
7376ae3e6668
child 5206
997064ba25d6
equal deleted inserted replaced
5204:7376ae3e6668 5205:df1709f0e49f
314 self.user_line(frame) 314 self.user_line(frame)
315 return 315 return
316 316
317 if event == 'call': 317 if event == 'call':
318 if self.botframe is None and frame.f_lineno > 1: 318 if self.botframe is None and frame.f_lineno > 1:
319 self.botframe = frame.f_back 319 self.botframe = frame
320 frame.f_trace = self.trace_dispatch 320 frame.f_trace = self.trace_dispatch
321 self._dbgClient.mainFrame = frame
322 321
323 self.user_line(frame) 322 self.user_line(frame)
324 return self.trace_dispatch 323 return self.trace_dispatch
325 324
326 if not (self.stop_here(frame) or 325 if not (self.stop_here(frame) or
329 # No need to trace this function 328 # No need to trace this function
330 return 329 return
331 return self.trace_dispatch 330 return self.trace_dispatch
332 331
333 if event == 'return': 332 if event == 'return':
334 if self.stop_here(frame): 333 if self.stop_here(frame) or frame == self.botframe:
335 # Ignore return events in generator except when stepping. 334 # Ignore return events in generator except when stepping.
336 if self.stopframe and frame.f_code.co_flags & CO_GENERATOR: 335 if self.stopframe and frame.f_code.co_flags & CO_GENERATOR:
337 return 336 return
338 # The program has finished if we have just left the first frame 337 # The program has finished if we have just left the first frame
339 if (frame == self._dbgClient.mainFrame and 338 if (frame == self.botframe and
340 self._mainThread): 339 self._mainThread):
341 atexit._run_exitfuncs() 340 atexit._run_exitfuncs()
342 self._dbgClient.progTerminated(arg) 341 self._dbgClient.progTerminated(arg)
343 342
344 if self.quitting and not self._dbgClient.passive: 343 if self.quitting and not self._dbgClient.passive:
394 while frame is not None: 393 while frame is not None:
395 # stop at erics debugger frame 394 # stop at erics debugger frame
396 if frame.f_back.f_code == self.stopOnHandleLine: 395 if frame.f_back.f_code == self.stopOnHandleLine:
397 frame.f_trace = self.trace_dispatch 396 frame.f_trace = self.trace_dispatch
398 self.botframe = frame 397 self.botframe = frame
399 self._dbgClient.mainFrame = frame
400 break 398 break
401 399
402 frame = frame.f_back 400 frame = frame.f_back
403 401
404 self.stop_everywhere = True 402 self.stop_everywhere = True
455 @param special flag indicating a special continue operation 453 @param special flag indicating a special continue operation
456 @type bool 454 @type bool
457 """ 455 """
458 # Here we only set a new stop frame if it is a normal continue. 456 # Here we only set a new stop frame if it is a normal continue.
459 if not special: 457 if not special:
460 self._set_stopinfo(self.botframe, None) 458 self._set_stopinfo(None, None)
461 459
462 # Disable tracing if not started in debug mode 460 # Disable tracing if not started in debug mode
463 if not self._dbgClient.debugging: 461 if not self._dbgClient.debugging:
464 sys.settrace(None) 462 sys.settrace(None)
465 sys.setprofile(None) 463 sys.setprofile(None)
907 if self.__skipFrame(frame): 905 if self.__skipFrame(frame):
908 return False 906 return False
909 907
910 return (self.stop_everywhere or 908 return (self.stop_everywhere or
911 frame is self.stopframe or 909 frame is self.stopframe or
912 frame is self.returnframe or 910 frame is self.returnframe)
913 frame is self.botframe)
914 911
915 def tracePythonLibs(self, enable): 912 def tracePythonLibs(self, enable):
916 """ 913 """
917 Public method to update the settings to trace into Python libraries. 914 Public method to update the settings to trace into Python libraries.
918 915

eric ide

mercurial