DebugClients/Python/DebugBase.py

branch
debugger speed
changeset 5064
9f4e3914e50c
parent 5063
0b5dccc8aacb
child 5083
4affedf129c5
equal deleted inserted replaced
5063:0b5dccc8aacb 5064:9f4e3914e50c
340 print 'DebugBase.trace_dispatch: unknown debugging event:', repr(event) # __IGNORE_WARNING__ 340 print 'DebugBase.trace_dispatch: unknown debugging event:', repr(event) # __IGNORE_WARNING__
341 return self.trace_dispatch 341 return self.trace_dispatch
342 342
343 def set_trace(self, frame=None): 343 def set_trace(self, frame=None):
344 """ 344 """
345 Public method reimplemented from bdb.py to do some special setup. 345 Public method to start debugging from 'frame'.
346
347 If frame is not specified, debugging starts from caller's frame.
346 348
347 @param frame frame to start debugging from 349 @param frame frame to start debugging from
348 """ 350 @type frame object
349 bdb.Bdb.set_trace(self, frame) 351 """
350 sys.setprofile(self.profile) 352 if frame is None:
353 frame = sys._getframe().f_back
354
355 # stop at erics debugger frame
356 while frame:
357 if not self.__skipFrame(frame):
358 frame.f_trace = self.trace_dispatch
359 frame = frame.f_back
360 self.botframe = frame
361 if self.__skipFrame(frame):
362 break
363
364 self.set_step()
365 sys.settrace(self.trace_dispatch)
366 sys.setprofile(self._dbgClient.callTraceEnabled)
351 367
352 def set_continue(self, special): 368 def set_continue(self, special):
353 """ 369 """
354 Public method reimplemented from bdb.py to always get informed of 370 Public method reimplemented from bdb.py to always get informed of
355 exceptions. 371 exceptions.
357 @param special flag indicating a special continue operation 373 @param special flag indicating a special continue operation
358 """ 374 """
359 # Modified version of the one found in bdb.py 375 # Modified version of the one found in bdb.py
360 # Here we only set a new stop frame if it is a normal continue. 376 # Here we only set a new stop frame if it is a normal continue.
361 if not special: 377 if not special:
362 self.stopframe = self.botframe 378 self._set_stopinfo(self.botframe, None)
363 self.returnframe = None 379 # Disable tracing if not started in debug mode
364 self.quitting = 0 380 if not self._dbgClient.debugging:
381 sys.settrace(None)
382 sys.setprofile(None)
365 383
366 def set_quit(self): 384 def set_quit(self):
367 """ 385 """
368 Public method to quit. 386 Public method to quit.
369 387

eric ide

mercurial