Interface DebugHandler


public interface DebugHandler
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final DebugHandler
     
    static final me.topchetoeu.j2s.common.Key<Void>
     
    static final me.topchetoeu.j2s.common.Key<DebugHandler>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    enabled(me.topchetoeu.j2s.common.Environment exts)
     
    get(me.topchetoeu.j2s.common.Environment exts)
     
    me.topchetoeu.j2s.common.FunctionMap
    getMap(me.topchetoeu.j2s.common.Environment env, me.topchetoeu.j2s.common.FunctionBody func)
     
    default me.topchetoeu.j2s.common.FunctionMap
    getMap(me.topchetoeu.j2s.common.Environment env, FunctionValue func)
     
    default me.topchetoeu.j2s.common.FunctionMap
    getMapOrEmpty(me.topchetoeu.j2s.common.Environment env, me.topchetoeu.j2s.common.FunctionBody func)
     
    default me.topchetoeu.j2s.common.FunctionMap
    getMapOrEmpty(me.topchetoeu.j2s.common.Environment env, FunctionValue func)
     
    void
    onFramePop(me.topchetoeu.j2s.common.Environment env, Frame frame)
    Called immediatly after a frame has been popped out of the frame stack.
    void
    onFramePush(me.topchetoeu.j2s.common.Environment env, Frame frame)
    Called immediatly before a frame has been pushed on the frame stack.
    void
    onFunctionLoad(me.topchetoeu.j2s.common.FunctionBody body, me.topchetoeu.j2s.common.FunctionMap map)
    Called when a function body has been loaded
    default boolean
    onInstruction(me.topchetoeu.j2s.common.Environment env, Frame frame, me.topchetoeu.j2s.common.Instruction instruction)
    Called immediately before an instruction is executed, as well as after an instruction, if it has threw or returned.
    boolean
    onInstruction(me.topchetoeu.j2s.common.Environment env, Frame frame, me.topchetoeu.j2s.common.Instruction instruction, Value returnVal, EngineException error, boolean caught)
    Called immediately before an instruction is executed, as well as after an instruction, if it has threw or returned.
    void
    onSourceLoad(me.topchetoeu.j2s.common.Filename filename, String source)
    Called when a script has been loaded
  • Field Details

    • KEY

      static final me.topchetoeu.j2s.common.Key<DebugHandler> KEY
    • IGNORE

      static final me.topchetoeu.j2s.common.Key<Void> IGNORE
    • EMPTY

      static final DebugHandler EMPTY
  • Method Details

    • onSourceLoad

      void onSourceLoad(me.topchetoeu.j2s.common.Filename filename, String source)
      Called when a script has been loaded
      Parameters:
      filename - The name of the source
      source - The name of the source
    • onFunctionLoad

      void onFunctionLoad(me.topchetoeu.j2s.common.FunctionBody body, me.topchetoeu.j2s.common.FunctionMap map)
      Called when a function body has been loaded
      Parameters:
      body - The body loaded
      map - The map of the function
    • onInstruction

      boolean onInstruction(me.topchetoeu.j2s.common.Environment env, Frame frame, me.topchetoeu.j2s.common.Instruction instruction, Value returnVal, EngineException error, boolean caught)
      Called immediately before an instruction is executed, as well as after an instruction, if it has threw or returned. This function might pause in order to await debugging commands.
      Parameters:
      env - The context of execution
      frame - The frame in which execution is occuring
      instruction - The instruction which was or will be executed
      returnVal - The return value of the instruction, Values.NO_RETURN if none
      error - The error that the instruction threw, null if none
      caught - Whether or not the error has been caught
      Returns:
      Whether or not the frame should restart (currently does nothing)
    • onInstruction

      default boolean onInstruction(me.topchetoeu.j2s.common.Environment env, Frame frame, me.topchetoeu.j2s.common.Instruction instruction)
      Called immediately before an instruction is executed, as well as after an instruction, if it has threw or returned. This function might pause in order to await debugging commands.
      Parameters:
      env - The context of execution
      frame - The frame in which execution is occuring
      instruction - The instruction which was or will be executed
      Returns:
      Whether or not the frame should restart (currently does nothing)
    • onFramePush

      void onFramePush(me.topchetoeu.j2s.common.Environment env, Frame frame)
      Called immediatly before a frame has been pushed on the frame stack. This function might pause in order to await debugging commands.
      Parameters:
      env - The context of execution
      frame - The code frame which was pushed
    • onFramePop

      void onFramePop(me.topchetoeu.j2s.common.Environment env, Frame frame)
      Called immediatly after a frame has been popped out of the frame stack. This function might pause in order to await debugging commands.
      Parameters:
      env - The context of execution
      frame - The code frame which was popped out
    • getMap

      me.topchetoeu.j2s.common.FunctionMap getMap(me.topchetoeu.j2s.common.Environment env, me.topchetoeu.j2s.common.FunctionBody func)
    • getMap

      default me.topchetoeu.j2s.common.FunctionMap getMap(me.topchetoeu.j2s.common.Environment env, FunctionValue func)
    • getMapOrEmpty

      default me.topchetoeu.j2s.common.FunctionMap getMapOrEmpty(me.topchetoeu.j2s.common.Environment env, me.topchetoeu.j2s.common.FunctionBody func)
    • getMapOrEmpty

      default me.topchetoeu.j2s.common.FunctionMap getMapOrEmpty(me.topchetoeu.j2s.common.Environment env, FunctionValue func)
    • get

      static DebugHandler get(me.topchetoeu.j2s.common.Environment exts)
    • enabled

      static boolean enabled(me.topchetoeu.j2s.common.Environment exts)