Package me.topchetoeu.j2s.runtime.debug
Interface DebugHandler
public interface DebugHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DebugHandler
static final me.topchetoeu.j2s.common.Key<Void>
static final me.topchetoeu.j2s.common.Key<DebugHandler>
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
enabled
(me.topchetoeu.j2s.common.Environment exts) static DebugHandler
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 loadeddefault 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
-
IGNORE
-
EMPTY
-
-
Method Details
-
onSourceLoad
Called when a script has been loaded- Parameters:
filename
- The name of the sourcesource
- 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 loadedmap
- 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 executionframe
- The frame in which execution is occuringinstruction
- The instruction which was or will be executedreturnVal
- The return value of the instruction, Values.NO_RETURN if noneerror
- The error that the instruction threw, null if nonecaught
- 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 executionframe
- The frame in which execution is occuringinstruction
- The instruction which was or will be executed- Returns:
- Whether or not the frame should restart (currently does nothing)
-
onFramePush
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 executionframe
- The code frame which was pushed
-
onFramePop
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 executionframe
- 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
-
enabled
static boolean enabled(me.topchetoeu.j2s.common.Environment exts)
-