def handle(self, signum, frame):
if self.print_method:<EOL><INDENT>self.print_method('<STR_LIT>'<EOL>% self.signame)<EOL><DEDENT>if self.print_stack:<EOL><INDENT>import traceback<EOL>strings = traceback.format_stack(frame)<EOL>for s in strings:<EOL><INDENT>if s[-<NUM_LIT:1>] == '<STR_LIT:\n>': s = s[<NUM_LIT:0>:-<NUM_LIT:1>]<EOL>self.print_method(s)<EOL>pass<EOL><DEDENT>pass<EOL><DEDENT>if self.b_stop:<EOL><INDENT>core = self.dbgr.core<EOL>old_trace_hook_suspend = core.trace_hook_suspend<EOL>core.trace_hook_suspend = True<EOL>core.stop_reason = ('<STR_LIT>' %<EOL>(self.signame, signum))<EOL>core.processor.event_processor(frame, '<STR_LIT>', signum)<EOL>core.trace_hook_suspend = old_trace_hook_suspend<EOL>pass<EOL><DEDENT>if self.pass_along:<EOL><INDENT>if self.old_handler:<EOL><INDENT>self.old_handler(signum, frame)<EOL>pass<EOL><DEDENT>pass<EOL><DEDENT>return<EOL>
This method is called when a signal is received.