Documentation
¶
Index ¶
- Constants
- func AddSymbolPrefixUnder(name string, isCpp bool) string
- func Do(conf *Config) error
- func GenSymbolTableData(commonSymbols []*llcppg.SymbolInfo) ([]byte, error)
- func GenerateSymTable(symbols []*nm.Symbol, headerInfos map[string]*SymbolInfo) ([]byte, error)
- func GetCommonSymbols(dylibSymbols []*nm.Symbol, headerSymbols map[string]*SymbolInfo) []*llcppg.SymbolInfo
- func GetIncludePaths() []string
- func GetLibPaths() []string
- func ParseClangIncOutput(output string) []string
- func ParseDylibSymbols(lib string) ([]*nm.Symbol, error)
- func ParseHeaderFile(files []string, prefixes []string, cflags []string, symMap map[string]string, ...) (map[string]*SymbolInfo, error)
- func ParseLdOutput(output string) []string
- func SetDebug(flags dbgFlags)
- type Collect
- type Config
- type SymbolInfo
- type SymbolProcessor
Constants ¶
const ( DbgSymbol dbgFlags = 1 << iota DbgParseIsMethod //print parse.go isMethod debug log info DbgFlagAll = DbgSymbol | DbgParseIsMethod )
Variables ¶
This section is empty.
Functions ¶
func AddSymbolPrefixUnder ¶
For mutiple os test,the nm output's symbol name is different.
func GenSymbolTableData ¶
func GenSymbolTableData(commonSymbols []*llcppg.SymbolInfo) ([]byte, error)
func GenerateSymTable ¶
func GetCommonSymbols ¶
func GetCommonSymbols(dylibSymbols []*nm.Symbol, headerSymbols map[string]*SymbolInfo) []*llcppg.SymbolInfo
finds the intersection of symbols from the dynamic library's symbol table and the symbols parsed from header files. It returns a list of symbols that can be externally linked.
func GetIncludePaths ¶
func GetIncludePaths() []string
func GetLibPaths ¶
func GetLibPaths() []string
func ParseClangIncOutput ¶
func ParseDylibSymbols ¶
ParseDylibSymbols parses symbols from dynamic libraries specified in the lib string. It handles multiple libraries (e.g., -L/opt/homebrew/lib -llua -lm) and returns symbols if at least one library is successfully parsed. Errors from inaccessible libraries (like standard libs) are logged as warnings.
Returns symbols and nil error if any symbols are found, or nil and error if none found.
func ParseHeaderFile ¶
func ParseLdOutput ¶
Note:this function is only use in this package The public function name is for llgo test
Types ¶
type Collect ¶
type Collect struct {
SymName string // symbol name
GetSymInfo func() *SymbolInfo // get symbol info
}
type SymbolInfo ¶
type SymbolProcessor ¶
type SymbolProcessor struct {
Files []string
Prefixes []string
SymbolMap map[string]*SymbolInfo
NameCounts map[string]int
// custom symbol map like:
// "sqlite3_finalize":".Close" -> method
// "sqlite3_open":"Open" -> function
CustomSymMap map[string]string
// contains filtered or unexported fields
}
func NewSymbolProcessor ¶
func NewSymbolProcessor(Files []string, Prefixes []string, SymMap map[string]string) *SymbolProcessor
func (*SymbolProcessor) AddSuffix ¶
func (p *SymbolProcessor) AddSuffix(name string) string
func (*SymbolProcessor) GenMethodName ¶
func (p *SymbolProcessor) GenMethodName(class, name string, isDestructor bool, isPointer bool) string