Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFuncForCodePtr ¶
func CreateFuncForCodePtr(outFuncPtr interface{}, codePtr uintptr)
CreateFuncForCodePtr is given a code pointer and creates a function value that uses that pointer. The outFun argument should be a pointer to a function of the proper type (e.g. the address of a local variable), and will be set to the result function value.
func FindFuncWithName ¶
FindFuncWithName searches through the moduledata table created by the linker and returns the function's code pointer. If the function was not found, it returns an error. Since the data structures here are not exported, we copy them below (and they need to stay in sync or else things will fail catastrophically).
func GetAllFuncName ¶ added in v1.0.3
func GetAllFuncName() (names []string)
func GetFunc ¶
GetFunc gets the function defined by the given fully-qualified name. The outFuncPtr parameter should be a pointer to a function with the appropriate type (e.g. the address of a local variable), and is set to a new function value that calls the specified function. If the specified function does not exist, outFuncPtr is not set and an error is returned.
Types ¶
type Func ¶
type Func struct {
// contains filtered or unexported fields
}
Convenience struct for modifying the underlying code pointer of a function value. The actual struct has other values, but always starts with a code pointer.
type Moduledata ¶
type Moduledata struct {
// contains filtered or unexported fields
}
var Firstmoduledata Moduledata