(self, insn_addr: int, stmt: Union[ailment.Stmt.Statement,pyvex.stmt.IRStmt],
                     block: Union[Block,ailment.Block], state: ReachingDefinitionsState, op_type: int)
:param insn_addr:   Address of the instruction.
        :param stmt:        The statement.
        :param block:       The current block.
        :param state:       The abstract analysis state.
        :param op_type:     Type of the observation point. Must be one of the following: OP_BEORE, OP_AFTER.
:param insn_addr:   Address of the instruction.
        :param stmt:        The statement.
        :param block:       The current block.
        :param state:       The abstract analysis state.
        :param op_type:     Type of the observation point. Must be one of the following: OP_BEORE, OP_AFTER.
: param insn_addr : Address of the instruction . : param stmt : The statement . : param block : The current block . : param state : The abstract analysis state . : param op_type : Type of the observation point . Must be one of the following : OP_BEORE OP_AFTER .
def insn_observe(self, insn_addr: int, stmt: Union[ailment.Stmt.Statement,pyvex.stmt.IRStmt],
                     block: Union[Block,ailment.Block], state: ReachingDefinitionsState, op_type: int) -> None:
        """
        :param insn_addr:   Address of the instruction.
        :param stmt:        The statement.
        :param block:       The current block.
        :param state:       The abstract analysis state.
        :param op_type:     Type of the observation point. Must be one of the following: OP_BEORE, OP_AFTER.
        """

        key = 'insn', insn_addr, op_type
        observe = False

        if self._observe_all:
            observe = True
        elif self._observation_points is not None and key in self._observation_points:
            observe = True
        elif self._observe_callback is not None:
            observe = self._observe_callback('insn', addr=insn_addr, stmt=stmt, block=block, state=state,
                                             op_type=op_type)

        if not observe:
            return

        if isinstance(stmt, pyvex.stmt.IRStmt):
            # it's an angr block
            vex_block = block.vex
            # OP_BEFORE: stmt has to be IMark
            if op_type == OP_BEFORE and type(stmt) is pyvex.stmt.IMark:
                self.observed_results[key] = state.live_definitions.copy()
            # OP_AFTER: stmt has to be last stmt of block or next stmt has to be IMark
            elif op_type == OP_AFTER:
                idx = vex_block.statements.index(stmt)
                if idx == len(vex_block.statements) - 1 or type(
                        vex_block.statements[idx + 1]) is pyvex.IRStmt.IMark:
                    self.observed_results[key] = state.live_definitions.copy()
        elif isinstance(stmt, ailment.Stmt.Statement):
            # it's an AIL block
            self.observed_results[key] = state.live_definitions.copy()
def insn_observe ( self , insn_addr : int , stmt : Union [ ailment . Stmt . Statement , pyvex . stmt . IRStmt ] , block : Union [ Block , ailment . Block ] , state : ReachingDefinitionsState , op_type : int ) -> None : key = 'insn' , insn_addr , op_type observe = False if self . _observe_all : observe = True elif self . _observation_points is not None and key in self . _observation_points : observe = True elif self . _observe_callback is not None : observe = self . _observe_callback ( 'insn' , addr = insn_addr , stmt = stmt , block = block , state = state , op_type = op_type ) if not observe : return if isinstance ( stmt , pyvex . stmt . IRStmt ) : # it's an angr block vex_block = block . vex # OP_BEFORE: stmt has to be IMark if op_type == OP_BEFORE and type ( stmt ) is pyvex . stmt . IMark : self . observed_results [ key ] = state . live_definitions . copy ( ) # OP_AFTER: stmt has to be last stmt of block or next stmt has to be IMark elif op_type == OP_AFTER : idx = vex_block . statements . index ( stmt ) if idx == len ( vex_block . statements ) - 1 or type ( vex_block . statements [ idx + 1 ] ) is pyvex . IRStmt . IMark : self . observed_results [ key ] = state . live_definitions . copy ( ) elif isinstance ( stmt , ailment . Stmt . Statement ) : # it's an AIL block self . observed_results [ key ] = state . live_definitions . copy ( )