Documentation ¶
Index ¶
Constants ¶
const ( // EntryEnter is an enter trace entry. EntryEnter = 0x01 // EntryLeave is an leave trace entry. EntryLeave = 0x02 // EntryInstruction is an instruction trace entry. EntryInstruction = 0x03 // EntryEnd is an end trace entry. EntryEnd = 0x04 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
A Decoder decodes trace entries from an io.Reader.
func NewDecoder ¶
NewDecoder creates a new decoder that reads from the given io.Reader.
type EndEntry ¶
type EndEntry struct{}
type EnterEntry ¶
type EnterEntry struct { ModuleName string `json:"moduleName"` FunctionIndex uint32 `json:"functionIndex"` FunctionSignature wasm.FunctionSig `json:"functionSignature"` }
func (*EnterEntry) Encode ¶
func (t *EnterEntry) Encode(w io.Writer) error
Encode encodes an enter trace entry to the given writer.
An enter trace entry is encoded as follows:
0x01 | Module Name vec(byte) | FunctionIndex u32 | FunctionSignature
The signature is encoded in its WASM format. The function index is LEB128-encoded.
func (*EnterEntry) Kind ¶
func (t *EnterEntry) Kind() EntryKind
type Entry ¶
type Entry interface { // Kind returns the kind of the trace entry. Kind() EntryKind // Encode encodes the trace entry to the given writer. Encode(w io.Writer) error // contains filtered or unexported methods }
A Entry represents a single entry in an execution trace.
type InstructionEntry ¶
type InstructionEntry struct { IP int `json:"ip"` Instruction code.Instruction `json:"instruction"` ArgTypes []wasm.ValueType `json:"argTypes"` ResultTypes []wasm.ValueType `json:"resultTypes"` Args []uint64 `json:"args"` Results []uint64 `json:"results"` }
func (*InstructionEntry) Encode ¶
func (t *InstructionEntry) Encode(w io.Writer) error
Encode encodes an instruction trace entry to the given writer.
An instruction trace entry is encoded as follows:
0x03 | IP (u32) | Instruction | Args vec(byte, u64) | Results vec(byte, u64)
The instruction is encoded in its WASM format. The instruction pointer, args, and results are all LEB128-encoded.
func (*InstructionEntry) Kind ¶
func (t *InstructionEntry) Kind() EntryKind
type LeaveEntry ¶
type LeaveEntry struct{}
func (*LeaveEntry) Encode ¶
func (t *LeaveEntry) Encode(w io.Writer) error
Encode encodes a leave trace entry to the given writer.
A leave trace entry is encoded as follows:
0x02
func (*LeaveEntry) Kind ¶
func (t *LeaveEntry) Kind() EntryKind