360 print('bdb.Bdb.dispatch: unknown debugging event: ', repr(event)) # __IGNORE_WARNING__ |
360 print('bdb.Bdb.dispatch: unknown debugging event: ', repr(event)) # __IGNORE_WARNING__ |
361 return self.trace_dispatch |
361 return self.trace_dispatch |
362 |
362 |
363 def set_trace(self, frame=None): |
363 def set_trace(self, frame=None): |
364 """ |
364 """ |
365 Public method reimplemented from bdb.py to do some special setup. |
365 Public method to start debugging from 'frame'. |
|
366 |
|
367 If frame is not specified, debugging starts from caller's frame. |
366 |
368 |
367 @param frame frame to start debugging from |
369 @param frame frame to start debugging from |
368 """ |
370 @type frame object |
369 bdb.Bdb.set_trace(self, frame) |
371 """ |
370 sys.setprofile(self.profile) |
372 if frame is None: |
|
373 frame = sys._getframe().f_back |
|
374 |
|
375 # stop at erics debugger frame |
|
376 while frame: |
|
377 if not self.__skipFrame(frame): |
|
378 frame.f_trace = self.trace_dispatch |
|
379 frame = frame.f_back |
|
380 self.botframe = frame |
|
381 if self.__skipFrame(frame): |
|
382 break |
|
383 |
|
384 self.set_step() |
|
385 sys.settrace(self.trace_dispatch) |
|
386 sys.setprofile(self._dbgClient.callTraceEnabled) |
371 |
387 |
372 def set_continue(self, special): |
388 def set_continue(self, special): |
373 """ |
389 """ |
374 Public method reimplemented from bdb.py to always get informed of |
390 Public method reimplemented from bdb.py to always get informed of |
375 exceptions. |
391 exceptions. |
378 """ |
394 """ |
379 # Modified version of the one found in bdb.py |
395 # Modified version of the one found in bdb.py |
380 # Here we only set a new stop frame if it is a normal continue. |
396 # Here we only set a new stop frame if it is a normal continue. |
381 if not special: |
397 if not special: |
382 self._set_stopinfo(self.botframe, None) |
398 self._set_stopinfo(self.botframe, None) |
383 else: |
399 # Disable tracing if not started in debug mode |
384 self._set_stopinfo(self.stopframe, None) |
400 if not self._dbgClient.debugging: |
|
401 sys.settrace(None) |
|
402 sys.setprofile(None) |
385 |
403 |
386 def set_quit(self): |
404 def set_quit(self): |
387 """ |
405 """ |
388 Public method to quit. |
406 Public method to quit. |
389 |
407 |