trepan/processor/cmdproc.py
def setup(self):
        """Initialization done before entering the debugger-command
        loop. In particular we set up the call stack used for local
        variable lookup and frame/up/down commands.

        We return True if we should NOT enter the debugger-command
        loop."""
        self.forget()
        if self.settings('dbg_trepan'):
            self.frame = inspect.currentframe()
            pass
        if self.event in ['exception', 'c_exception']:
            exc_type, exc_value, exc_traceback = self.event_arg
        else:
            _, _, exc_traceback = (None, None, None,)  # NOQA
            pass
        if self.frame or exc_traceback:
            self.stack, self.curindex = \
                get_stack(self.frame, exc_traceback, None, self)
            self.curframe = self.stack[self.curindex][0]
            self.thread_name = Mthread.current_thread_name()
            if exc_traceback:
                self.list_lineno = traceback.extract_tb(exc_traceback, 1)[0][1]
                self.list_offset = self.curframe.f_lasti
                self.list_object = self.curframe
        else:
            self.stack = self.curframe = \
                self.botframe = None
            pass
        if self.curframe:
            self.list_lineno = \
                max(1, inspect.getlineno(self.curframe)
                    - int(self.settings('listsize') / 2)) - 1
            self.list_offset   = self.curframe.f_lasti
            self.list_filename = self.curframe.f_code.co_filename
            self.list_object   = self.curframe
        else:
            if not exc_traceback: self.list_lineno = None
            pass
        # if self.execRcLines()==1: return True

        # FIXME:  do we want to save self.list_lineno a second place
        # so that we can do 'list .' and go back to the first place we listed?
        return False
def setup(self):
        """Initialization done before entering the debugger-command
        loop. In particular we set up the call stack used for local
        variable lookup and frame/up/down commands.

        We return True if we should NOT enter the debugger-command
        loop."""
        self.forget()
        if self.settings('dbg_trepan'):
            self.frame = inspect.currentframe()
            pass
        if self.event in ['exception', 'c_exception']:
            exc_type, exc_value, exc_traceback = self.event_arg
        else:
            _, _, exc_traceback = (None, None, None,)  # NOQA
            pass
        if self.frame or exc_traceback:
            self.stack, self.curindex = \
                get_stack(self.frame, exc_traceback, None, self)
            self.curframe = self.stack[self.curindex][0]
            self.thread_name = Mthread.current_thread_name()
            if exc_traceback:
                self.list_lineno = traceback.extract_tb(exc_traceback, 1)[0][1]
                self.list_offset = self.curframe.f_lasti
                self.list_object = self.curframe
        else:
            self.stack = self.curframe = \
                self.botframe = None
            pass
        if self.curframe:
            self.list_lineno = \
                max(1, inspect.getlineno(self.curframe)
                    - int(self.settings('listsize') / 2)) - 1
            self.list_offset   = self.curframe.f_lasti
            self.list_filename = self.curframe.f_code.co_filename
            self.list_object   = self.curframe
        else:
            if not exc_traceback: self.list_lineno = None
            pass
        # if self.execRcLines()==1: return True

        # FIXME:  do we want to save self.list_lineno a second place
        # so that we can do 'list .' and go back to the first place we listed?
        return False
def setup ( self ) : self . forget ( ) if self . settings ( 'dbg_trepan' ) : self . frame = inspect . currentframe ( ) pass if self . event in [ 'exception' , 'c_exception' ] : exc_type , exc_value , exc_traceback = self . event_arg else : _ , _ , exc_traceback = ( None , None , None , ) # NOQA pass if self . frame or exc_traceback : self . stack , self . curindex = get_stack ( self . frame , exc_traceback , None , self ) self . curframe = self . stack [ self . curindex ] [ 0 ] self . thread_name = Mthread . current_thread_name ( ) if exc_traceback : self . list_lineno = traceback . extract_tb ( exc_traceback , 1 ) [ 0 ] [ 1 ] self . list_offset = self . curframe . f_lasti self . list_object = self . curframe else : self . stack = self . curframe = self . botframe = None pass if self . curframe : self . list_lineno = max ( 1 , inspect . getlineno ( self . curframe ) - int ( self . settings ( 'listsize' ) / 2 ) ) - 1 self . list_offset = self . curframe . f_lasti self . list_filename = self . curframe . f_code . co_filename self . list_object = self . curframe else : if not exc_traceback : self . list_lineno = None pass # if self.execRcLines()==1: return True # FIXME:  do we want to save self.list_lineno a second place # so that we can do 'list .' and go back to the first place we listed? return False
Initialization done before entering the debugger-command
        loop. In particular we set up the call stack used for local
        variable lookup and frame/up/down commands.

        We return True if we should NOT enter the debugger-command
        loop.
Initialization done before entering the debugger - command loop . In particular we set up the call stack used for local variable lookup and frame / up / down commands .