Interface InstructionInterceptor

  • All Known Implementing Classes:
    AbstractInterceptor

    public interface InstructionInterceptor
    Debugger hook invoked around each interpreted instruction, method entry and exit, and thrown exception.
    • Method Detail

      • beforeInstruction

        InterceptorAction beforeInstruction​(StackFrame frame,
                                            Instruction instruction)
        Called just before an instruction is interpreted.
        Parameters:
        frame - the frame about to execute
        instruction - the instruction about to run
        Returns:
        whether the interpreter continues, pauses or aborts
      • afterInstruction

        void afterInstruction​(StackFrame frame,
                              Instruction instruction)
        Called after an instruction has been interpreted.
        Parameters:
        frame - the frame that executed
        instruction - the instruction that ran
      • onMethodEntry

        InterceptorAction onMethodEntry​(StackFrame frame)
        Called when a frame has been pushed and is about to run.
        Parameters:
        frame - the newly pushed frame
        Returns:
        whether the interpreter continues, pauses or aborts
      • onMethodExit

        void onMethodExit​(StackFrame frame,
                          ConcreteValue returnValue)
        Called when a frame returns normally.
        Parameters:
        frame - the returning frame
        returnValue - the returned value, null for a void method
      • onException

        InterceptorAction onException​(StackFrame frame,
                                      ObjectInstance exception)
        Called when an exception is raised in a frame.
        Parameters:
        frame - the frame the exception was raised in
        exception - the thrown exception instance
        Returns:
        whether the interpreter continues, pauses or aborts