trepan/lib/sighandler.py
def handle(self, signum, frame):
        """This method is called when a signal is received."""
        if self.print_method:
            self.print_method('\nProgram received signal %s.'
                              % self.signame)
        if self.print_stack:
            import traceback
            strings = traceback.format_stack(frame)
            for s in strings:
                if s[-1] == '\n': s = s[0:-1]
                self.print_method(s)
                pass
            pass
        if self.b_stop:
            core = self.dbgr.core
            old_trace_hook_suspend = core.trace_hook_suspend
            core.trace_hook_suspend = True
            core.stop_reason = ('intercepting signal %s (%d)' %
                                (self.signame, signum))
            core.processor.event_processor(frame, 'signal', signum)
            core.trace_hook_suspend = old_trace_hook_suspend
            pass
        if self.pass_along:
            # pass the signal to the program
            if self.old_handler:
                self.old_handler(signum, frame)
                pass
            pass
        return
def handle(self, signum, frame):
        if self.print_method:
            self.print_method('\nProgram received signal %s.'
                              % self.signame)
        if self.print_stack:
            import traceback
            strings = traceback.format_stack(frame)
            for s in strings:
                if s[-1] == '\n': s = s[0:-1]
                self.print_method(s)
                pass
            pass
        if self.b_stop:
            core = self.dbgr.core
            old_trace_hook_suspend = core.trace_hook_suspend
            core.trace_hook_suspend = True
            core.stop_reason = ('intercepting signal %s (%d)' %
                                (self.signame, signum))
            core.processor.event_processor(frame, 'signal', signum)
            core.trace_hook_suspend = old_trace_hook_suspend
            pass
        if self.pass_along:
            # pass the signal to the program
            if self.old_handler:
                self.old_handler(signum, frame)
                pass
            pass
        return
def handle ( self , signum , frame ) : if self . print_method : self . print_method ( '\nProgram received signal %s.' % self . signame ) if self . print_stack : import traceback strings = traceback . format_stack ( frame ) for s in strings : if s [ - 1 ] == '\n' : s = s [ 0 : - 1 ] self . print_method ( s ) pass pass if self . b_stop : core = self . dbgr . core old_trace_hook_suspend = core . trace_hook_suspend core . trace_hook_suspend = True core . stop_reason = ( 'intercepting signal %s (%d)' % ( self . signame , signum ) ) core . processor . event_processor ( frame , 'signal' , signum ) core . trace_hook_suspend = old_trace_hook_suspend pass if self . pass_along : # pass the signal to the program if self . old_handler : self . old_handler ( signum , frame ) pass pass return
This method is called when a signal is received.
This method is called when a signal is received .