trepan/lib/core.py
def trace_dispatch(self, frame, event, arg):
        '''A trace event occurred. Filter or pass the information to a
        specialized event processor. Note that there may be more filtering
        that goes on in the command processor (e.g. to force a
        different line). We could put that here, but since that seems
        processor-specific I think it best to distribute the checks.'''

        # For now we only allow one instance in a process
        # In Python 2.6 and beyond one can use "with threading.Lock():"
        try:
            self.debugger_lock.acquire()

            if self.trace_hook_suspend:
                return None

            self.event = event
            # FIXME: Understand what's going on here better.
            # When None gets returned, the frame's f_trace seems to get set
            # to None. Somehow this is changing other frames when get passed
            # to this routine which also have their f_trace set to None.
            # This will disallow a command like "jump" from working properly,
            # which will give a cryptic the message on setting f_lineno:
            #   f_lineno can only be set by a trace function
            if self.ignore_filter and self.ignore_filter.is_included(frame):
                return True

            if self.debugger.settings['trace']:
                print_event_set = self.debugger.settings['printset']
                if self.event in print_event_set:
                    self.trace_processor.event_processor(frame,
                                                         self.event, arg)
                    pass
                pass

            if self.until_condition:
                if not self.matches_condition(frame): return True
                pass

            trace_event_set = self.debugger.settings['events']
            if trace_event_set is None or self.event not in trace_event_set:
                return True

            # I think we *have* to run is_stop_here() before
            # is_break_here() because is_stop_here() sets various
            # stepping counts. But it might be more desirable from the
            # user's standpoint to test for breaks before steps. In
            # this case we will need to factor out the counting
            # updates.
            if ( self.is_stop_here(frame, event, arg) or
                 self.is_break_here(frame, arg) ):
                # Run the event processor
                return self.processor.event_processor(frame, self.event, arg)
            return True
        finally:
            try:
                self.debugger_lock.release()
            except:
                pass
            pass
        pass
def trace_dispatch(self, frame, event, arg):
        '''A trace event occurred. Filter or pass the information to a
        specialized event processor. Note that there may be more filtering
        that goes on in the command processor (e.g. to force a
        different line). We could put that here, but since that seems
        processor-specific I think it best to distribute the checks.'''

        # For now we only allow one instance in a process
        # In Python 2.6 and beyond one can use "with threading.Lock():"
        try:
            self.debugger_lock.acquire()

            if self.trace_hook_suspend:
                return None

            self.event = event
            # FIXME: Understand what's going on here better.
            # When None gets returned, the frame's f_trace seems to get set
            # to None. Somehow this is changing other frames when get passed
            # to this routine which also have their f_trace set to None.
            # This will disallow a command like "jump" from working properly,
            # which will give a cryptic the message on setting f_lineno:
            #   f_lineno can only be set by a trace function
            if self.ignore_filter and self.ignore_filter.is_included(frame):
                return True

            if self.debugger.settings['trace']:
                print_event_set = self.debugger.settings['printset']
                if self.event in print_event_set:
                    self.trace_processor.event_processor(frame,
                                                         self.event, arg)
                    pass
                pass

            if self.until_condition:
                if not self.matches_condition(frame): return True
                pass

            trace_event_set = self.debugger.settings['events']
            if trace_event_set is None or self.event not in trace_event_set:
                return True

            # I think we *have* to run is_stop_here() before
            # is_break_here() because is_stop_here() sets various
            # stepping counts. But it might be more desirable from the
            # user's standpoint to test for breaks before steps. In
            # this case we will need to factor out the counting
            # updates.
            if ( self.is_stop_here(frame, event, arg) or
                 self.is_break_here(frame, arg) ):
                # Run the event processor
                return self.processor.event_processor(frame, self.event, arg)
            return True
        finally:
            try:
                self.debugger_lock.release()
            except:
                pass
            pass
        pass
A trace event occurred. Filter or pass the information to a
        specialized event processor. Note that there may be more filtering
        that goes on in the command processor (e.g. to force a
        different line). We could put that here, but since that seems
        processor-specific I think it best to distribute the checks.