Documentation
¶
Index ¶
- Constants
- func Do(conf *Config) (symbolTable []*llcppg.SymbolInfo, err error)
- func FetchSymbols(lib string, mode LibMode) ([]*nm.Symbol, error)
- func GetCommonSymbols(syms []*nm.Symbol, headerSymbols map[string]*SymbolInfo) []*llcppg.SymbolInfo
- func ParseHeaderFile(combileFile string, curPkgFiles []string, prefixes []string, cflags []string, ...) (map[string]*SymbolInfo, error)
- func SetDebug(flags dbgFlags)
- type Config
- type LibMode
- type Libs
- type SymbolInfo
- type SymbolProcessor
Constants ¶
const ( DbgSymbol dbgFlags = 1 << iota DbgFlagAll = DbgSymbol )
Variables ¶
This section is empty.
Functions ¶
func FetchSymbols ¶ added in v0.7.0
fetchSymbols 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 GetCommonSymbols ¶
func GetCommonSymbols(syms []*nm.Symbol, headerSymbols map[string]*SymbolInfo) []*llcppg.SymbolInfo
todo(zzy):only public for test,when llgo test support private package test,this function should be private GetCommonSymbols finds the intersection of symbols from the library symbol table and the symbols parsed from header files. It returns a list of symbols that can be externally linked.
func ParseHeaderFile ¶
Types ¶
type Libs ¶ added in v0.6.0
func (*Libs) Files ¶ added in v0.6.0
searches for each library name in the provided paths and default paths, appending the appropriate file extension (.dylib for macOS, .so for Linux at dylib mode, .a for static mode).
Example: For "-L/opt/homebrew/lib -llua -lm" and at dylib mode: - It will search for liblua.dylib (on macOS) or liblua.so (on Linux) - System libs like -lm are ignored and included in notFound
So error is returned if no libraries found at all.
type SymbolInfo ¶
type SymbolProcessor ¶
type SymbolProcessor struct {
// contains filtered or unexported fields
}
func NewSymbolProcessor ¶
func NewSymbolProcessor(curPkgFiles []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