Documentation
¶
Index ¶
- Constants
- func AddSymbolPrefixUnder(name string, isCpp bool) string
- func Do(conf *Config) error
- func GetCommonSymbols(dylibSymbols []*nm.Symbol, headerSymbols map[string]*SymbolInfo) []*llcppg.SymbolInfo
- func ParseDylibSymbols(lib string) ([]*nm.Symbol, error)
- func ParseHeaderFile(combileFile string, curPkgFiles []string, prefixes []string, cflags []string, ...) (map[string]*SymbolInfo, error)
- func SetDebug(flags dbgFlags)
- type Collect
- type Config
- type SymbolInfo
- type SymbolProcessor
Constants ¶
View Source
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 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 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 ¶
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
Click to show internal directories.
Click to hide internal directories.