Documentation
¶
Index ¶
- Constants
- Variables
- func ModifyAllFunctionIndexes(exp []*Expression, m map[int]int)
- func ModifyAllGlobalIndexes(exp []*Expression, m map[int]int)
- func ModifyUnresolvedFunctions(exp []*Expression, m map[string]string) error
- func ResolveFunctions(exp []*Expression, wd WasmLookupContext) error
- func ResolveGlobals(exp []*Expression, wd WasmLookupContext) error
- type Expression
- func AddExpressionEnd(exp []*Expression, to string) ([]*Expression, error)
- func AddExpressionStart(exp []*Expression, to string) ([]*Expression, error)
- func ExpressionFromWat(d string) ([]*Expression, error)
- func InsertAfterRelocating(exp []*Expression, to string) ([]*Expression, error)
- func NewExpression(data []byte, pc uint64) ([]*Expression, int, error)
- func (e *Expression) DecodeWat(s string, localNames map[string]int) error
- func (e *Expression) EncodeBinary(w io.Writer) error
- func (e *Expression) EncodeWat(w io.Writer, prefix string, wd WasmDebugContext) error
- func (e *Expression) Equals(f *Expression) bool
- func (e *Expression) HasMemoryArgs() bool
- func (e *Expression) HasNoArgs() bool
- type Opcode
- type WasmDebugContext
- type WasmLookupContext
Constants ¶
View Source
const ExtendedOpcodeFC = Opcode(0xfc)
Variables ¶
View Source
var InstrToOpcode = map[string]Opcode{}/* 177 elements not displayed */
Functions ¶
func ModifyAllFunctionIndexes ¶
func ModifyAllFunctionIndexes(exp []*Expression, m map[int]int)
func ModifyAllGlobalIndexes ¶
func ModifyAllGlobalIndexes(exp []*Expression, m map[int]int)
*
- Modify (remap) some GlobalIndexes *
func ModifyUnresolvedFunctions ¶
func ModifyUnresolvedFunctions(exp []*Expression, m map[string]string) error
func ResolveFunctions ¶
func ResolveFunctions(exp []*Expression, wd WasmLookupContext) error
func ResolveGlobals ¶
func ResolveGlobals(exp []*Expression, wd WasmLookupContext) error
Types ¶
type Expression ¶
type Expression struct { PC uint64 // Program Counter (This is the byte offset into the Code section) PCNext uint64 Opcode Opcode // Main opcode OpcodeExt int I32Value int32 I64Value int64 F32Value float32 F64Value float64 FuncIndex int LocalIndex int GlobalIndex int LabelIndex int TypeIndex int TableIndex int Labels []int Result types.ValType MemAlign int MemOffset int // This is set if the instruction has as I32Value that needs resolving (offset) DataOffsetNeedsLinking bool // This is set if the instruction needs adjusting using a base memory pointer DataOffsetNeedsAdjusting bool // This is set if the instruction has an I32Value that needs resolving (length) DataLengthNeedsLinking bool I32DataId string // This is set if the instruction refers to a GlobalIndex that needs resolving GlobalNeedsLinking bool GlobalId string // This is set if the instruction refers to a FuncIndex that needs resolving FunctionNeedsLinking bool FunctionId string }
func AddExpressionEnd ¶
func AddExpressionEnd(exp []*Expression, to string) ([]*Expression, error)
*
- Add an expression to the end of some code *
func AddExpressionStart ¶
func AddExpressionStart(exp []*Expression, to string) ([]*Expression, error)
*
- Add an expression to the start of some code *
func ExpressionFromWat ¶
func ExpressionFromWat(d string) ([]*Expression, error)
*
- Create an Expression from some wat source. *
func InsertAfterRelocating ¶
func InsertAfterRelocating(exp []*Expression, to string) ([]*Expression, error)
*
- Insert an expression after any instructions that need relocation fixup (offset()) *
func NewExpression ¶
func NewExpression(data []byte, pc uint64) ([]*Expression, int, error)
func (*Expression) DecodeWat ¶
func (e *Expression) DecodeWat(s string, localNames map[string]int) error
func (*Expression) EncodeBinary ¶
func (e *Expression) EncodeBinary(w io.Writer) error
func (*Expression) EncodeWat ¶
func (e *Expression) EncodeWat(w io.Writer, prefix string, wd WasmDebugContext) error
func (*Expression) Equals ¶
func (e *Expression) Equals(f *Expression) bool
Check if two expressions are equal.
func (*Expression) HasMemoryArgs ¶
func (e *Expression) HasMemoryArgs() bool
Returns true if the expression has memory args.
func (*Expression) HasNoArgs ¶
func (e *Expression) HasNoArgs() bool
Returns true if the opcode has no arguments (Simple single Opcode)
type WasmDebugContext ¶
Click to show internal directories.
Click to hide internal directories.