Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DebuggerOptionFunc ¶
type DebuggerOptionFunc func(o *debugOpts)
DebuggerOptionFunc for setting debugger options.
func WithRewind ¶
func WithRewind() DebuggerOptionFunc
WithRewind configure the debugger to enable rewind functionality. When enabled, the debugger will save each stack frame from BeforeStep to memory.
type DefaultDebugger ¶
type DefaultDebugger interface { AttachBeforeExecute(ThreadStateFunc) AttachAfterExecute(ThreadStateFunc) AttachBeforeStep(ThreadStateFunc) AttachAfterStep(ThreadStateFunc) AttachBeforeExecuteOpcode(ThreadStateFunc) AttachAfterExecuteOpcode(ThreadStateFunc) AttachBeforeScriptChange(ThreadStateFunc) AttachAfterScriptChange(ThreadStateFunc) AttachAfterSuccess(ThreadStateFunc) AttachAfterError(ExecutionErrorFunc) AttachBeforeStackPush(StackFunc) AttachAfterStackPush(StackFunc) AttachBeforeStackPop(ThreadStateFunc) AttachAfterStackPop(StackFunc) interpreter.Debugger }
DefaultDebugger exposes attachment points via the way of functions, which are to be appended to via a series of function calls.
func NewDebugger ¶
func NewDebugger(oo ...DebuggerOptionFunc) DefaultDebugger
NewDebugger returns an empty debugger which is to be configured with the `Attach` functions.
Example usage:
debugger := debug.NewDebugger() debugger.AttachBeforeExecuteOpcode(func (state *interpreter.State) { fmt.Println(state.DataStack) }) debugger.AttachAfterStackPush(func (state *interpreter.State, data []byte) { fmt.Println(hex.EncodeToString(data)) }) engine.Execute(interpreter.WithDebugger(debugger))
type ExecutionErrorFunc ¶
type ExecutionErrorFunc func(state *interpreter.State, err error)
ExecutionErrorFunc debug handler for execution failure.
type StackFunc ¶
type StackFunc func(state *interpreter.State, data []byte)
StackFunc debug handler for stack operations.
type ThreadStateFunc ¶
type ThreadStateFunc func(state *interpreter.State)
ThreadStateFunc debug handler for a threads state.
Click to show internal directories.
Click to hide internal directories.