Documentation ¶
Index ¶
- Variables
- func Listing(depth []int, ops []Op) string
- type AddrOf
- type Binary
- type BoolToConst
- type BuiltinCall
- type CallInjectionComplete
- type CallInjectionComplete2
- type CallInjectionCopyArg
- type CallInjectionSetTarget
- type CallInjectionStart
- type CallInjectionStartSpecial
- type ConvertAllocToString
- type Flags
- type Index
- type Jump
- type JumpCond
- type Op
- type PointerDeref
- type Pop
- type PushConst
- type PushCurg
- type PushDebugPinner
- type PushFrameoff
- type PushIdent
- type PushLen
- type PushLocal
- type PushNil
- type PushPackageVarOrSelect
- type PushPinAddress
- type PushRangeParentOffset
- type PushThreadID
- type Reslice
- type Roll
- type Select
- type SetDebugPinner
- type SetValue
- type TypeAssert
- type TypeCast
- type Unary
Constants ¶
This section is empty.
Variables ¶
var ( ErrFuncCallNotAllowed = errors.New("function calls not allowed without using 'call'") DebugPinnerFunctionName = "runtime.debugPinnerV1" )
Functions ¶
Types ¶
type Binary ¶
type Binary struct {
Node *ast.BinaryExpr
}
Binary pops two variables from the stack, applies the specified binary operator to them and pushes the result back on the stack.
type BoolToConst ¶
type BoolToConst struct { }
BoolToConst pops the topmost variable from the stack, which must be a boolean variable, and converts it to a constant.
type BuiltinCall ¶
BuiltinCall pops len(Args) argument from the stack, calls the specified builtin on them and pushes the result back on the stack.
type CallInjectionComplete ¶
type CallInjectionComplete struct { DoPinning bool // contains filtered or unexported fields }
CallInjectionComplete resumes target execution so that the injected call can run. If DoPinning is true it stops after the call is completed without undoing the call injection frames so that address pinning for the return value can be performed, see CallInjectionComplete2.
type CallInjectionComplete2 ¶ added in v1.24.0
type CallInjectionComplete2 struct {
// contains filtered or unexported fields
}
CallInjectionComplete2 if DoPinning was passed to CallInjectionComplete this will finish the call injection protocol and push the evaluation result on the stack.
type CallInjectionCopyArg ¶
type CallInjectionCopyArg struct { ArgNum int ArgExpr ast.Expr // contains filtered or unexported fields }
CallInjectionCopyArg copies one argument for call injection.
type CallInjectionSetTarget ¶
type CallInjectionSetTarget struct {
// contains filtered or unexported fields
}
CallInjectionSetTarget starts the call injection, after runtime.debugCallVn set up the stack for us, by copying the entry point of the function, setting the closure register and copying the receiver.
type CallInjectionStart ¶
type CallInjectionStart struct { HasFunc bool // target function already pushed on the stack Node *ast.CallExpr // contains filtered or unexported fields }
CallInjectionStart starts call injection by calling runtime.debugCallVn.
type CallInjectionStartSpecial ¶ added in v1.23.0
type CallInjectionStartSpecial struct { FnName string ArgAst []ast.Expr // contains filtered or unexported fields }
CallInjectionStartSpecial starts call injection for a function with a name and arguments known at compile time.
type ConvertAllocToString ¶ added in v1.23.0
type ConvertAllocToString struct { }
ConvertAllocToString pops two variables from the stack, a constant string and the return value of runtime.mallocgc (mallocv), copies the contents of the string at the address in mallocv and pushes on the stack a new string value that uses the backing storage of mallocv.
type Flags ¶ added in v1.24.0
type Flags uint8
Flags describes flags used to control Compile and CompileAST
type Jump ¶
Jump looks at the topmost stack variable and if it satisfies the condition specified by When it jumps to the stack machine instruction at Target+1. If Pop is set the topmost stack variable is also popped.
type Op ¶
type Op interface {
// contains filtered or unexported methods
}
Op is a stack machine opcode
func Compile ¶
Compile compiles the expression expr into a list of instructions. If canSet is true expressions like "x = y" are also accepted.
func CompileAST ¶
CompileAST compiles the expression t into a list of instructions.
type PointerDeref ¶
PointerDeref replaces the topmost stack variable v with *v.
type PushDebugPinner ¶ added in v1.24.0
type PushDebugPinner struct { }
PushDebugPinner pushes the debug pinner on the stack.
type PushFrameoff ¶
type PushFrameoff struct { }
PushFrameoff pushes the frame offset for the current frame on the stack.
type PushIdent ¶ added in v1.23.0
type PushIdent struct {
Name string
}
PushIdent pushes a local or global variable or a predefined identifier (true, false, etc) or the value of a register on the stack.
type PushLen ¶ added in v1.23.0
type PushLen struct { }
PushLen pushes the length of the variable at the top of the stack into the stack.
type PushPackageVarOrSelect ¶ added in v1.23.0
PushPackageVarOrSelect pushes the value of Name.Sel on the stack, which could either be a global variable (with the package name specified), or a field of a local variable.
type PushPinAddress ¶ added in v1.24.0
type PushPinAddress struct { }
PushPinAddress pushes an address to pin on the stack (as an unsafe.Pointer) and removes it from the list of addresses to pin.
type PushRangeParentOffset ¶ added in v1.23.0
type PushRangeParentOffset struct { }
PushRangeParentOffset pushes the frame offset of the range-over-func closure body parent.
type PushThreadID ¶
type PushThreadID struct { }
PushThreadID pushes the ID of the current thread on the stack.
type Reslice ¶
Reslice implements a reslice operation. If HasHigh is set it pops three variables, low, high and v, and pushes v[low:high]. Otherwise it pops two variables, low and v, and pushes v[low:]. If TrustLen is set when the variable resulting from the reslice is loaded it will be fully loaded.
type Roll ¶ added in v1.24.0
type Roll struct {
N int
}
Roll removes the n-th element of the stack and pushes it back in at the top
type Select ¶
type Select struct {
Name string
}
Select replaces the topmost stack variable v with v.Name.
type SetDebugPinner ¶ added in v1.24.0
type SetDebugPinner struct { }
SetDebugPinner pops one variable from the stack and uses it as the saved debug pinner.
type TypeAssert ¶
type TypeAssert struct { DwarfType godwarf.Type Node *ast.TypeAssertExpr }
TypeAssert replaces the topmost stack variable v with v.(DwarfType).