Documentation
¶
Index ¶
- func Generate(arch *config.Arch, srcPath string, clangVersion string, functions []Function) ([]byte, error)
- func GenerateFile(arch *config.Arch, path string, srcPath string, clangVersion string, ...) error
- func GenerateGoStubs(arch *config.Arch, pkg, output string, functions []Function) error
- func ParseClangObjectDump(arch *config.Arch, dump string, functions []Function, dec Plan9Decoder) error
- func ParseGoObjectDump(arch *config.Arch, dump string, functions []Function) error
- type Const
- type ConstLine
- type Function
- type GoFunction
- type Line
- type Param
- type Plan9Decoder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
func Generate(arch *config.Arch, srcPath string, clangVersion string, functions []Function) ([]byte, error)
Generate generates the Go PLAN9 assembly
func GenerateFile ¶
func GenerateFile(arch *config.Arch, path string, srcPath string, clangVersion string, functions []Function) error
GenerateFile generates the Go PLAN9 assembly file
func GenerateGoStubs ¶
GenerateGoStubs generates Go stubs for the functions.
func ParseClangObjectDump ¶
func ParseClangObjectDump(arch *config.Arch, dump string, functions []Function, dec Plan9Decoder) error
ParseClangObjectDump parses the output of objdump file and returns a list of functions
Types ¶
type Const ¶
type Function ¶
type Function struct { Name string `json:"name"` SourcePath string `json:"sourcePath"` Position int `json:"position"` Params []Param `json:"params"` Consts []Const `json:"consts,omitempty"` Lines []Line `json:"lines"` LocalsSize int `json:"localsSize,omitempty"` Ret *Param `json:"return,omitempty"` GoFunc GoFunction }
func ParseAssembly ¶
ParseAssembly parses the assembly file and returns a list of functions
type GoFunction ¶
func (*GoFunction) ForEachParam ¶
func (f *GoFunction) ForEachParam(fn func(name, typ string))
func (*GoFunction) ForEachResult ¶
func (f *GoFunction) ForEachResult(fn func(name, typ string))
func (*GoFunction) NumResults ¶
func (f *GoFunction) NumResults() int
type Line ¶
type Line struct { Labels []string `json:"labels,omitempty"` // Labels for the line Binary []string `json:"binary"` // Binary representation of the line Assembly string `json:"assembly"` // Assembly representation of the line Disassembled string `json:"disassembled,omitempty"` // Disassembled representation of the line }
Line represents a line of assembly code
type Param ¶
type Param struct { Type string `json:"type"` // Type of the parameter (C type) Name string `json:"name"` // Name of the parameter IsPointer bool `json:"isPointer,omitempty"` // Whether the parameter is a pointer }
Param represents a function parameter
func (*Param) EquivalentType ¶
func (*Param) IsFloatingPoint ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.