Documentation
¶
Index ¶
- Variables
- func DiffSymbols(a, b []SymbolInfo, topN int) (grown []SymDelta, shrunk []SymDelta)
- func Execute() error
- func ExitCode(err error) int
- func NewDoctorCmd() *cobra.Command
- func NewExplainCmd() *cobra.Command
- func NewRootCmd() *cobra.Command
- func NewRunCmd() *cobra.Command
- func NewVersionCmd() *cobra.Command
- type AnalyzeResult
- type BinaryFormat
- type Level
- type SizeInfo
- type SymDelta
- type SymbolInfo
Constants ¶
This section is empty.
Variables ¶
var ( Version = "dev" GitCommit = "none" BuildDate = "unknown" )
var ErrThreshold = errors.New("threshold exceeded")
Functions ¶
func DiffSymbols ¶
func DiffSymbols(a, b []SymbolInfo, topN int) (grown []SymDelta, shrunk []SymDelta)
DiffSymbols returns the biggest symbol size increases and decreases between A and B, limited to topN results per group.
func Execute ¶
func Execute() error
Execute runs the root command of the CLI application and handles any errors by printing them to stderr.
func NewDoctorCmd ¶
NewDoctorCmd returns the doctor command for checking the local firmdiff setup and dependencies.
func NewExplainCmd ¶
NewExplainCmd returns the explain command for comparing two ELF files.
func NewRootCmd ¶
NewRootCmd returns the root command for the CLI application.
func NewVersionCmd ¶
NewVersionCmd returns the version command for printing firmdiff version info.
Types ¶
type AnalyzeResult ¶
type AnalyzeResult struct {
Size SizeInfo
TopSyms []SymbolInfo // largest symbols (best-effort)
}
AnalyzeResult represents the result of analyzing an ELF file.
func AnalyzeELF ¶
func AnalyzeELF(path string, topN int) (AnalyzeResult, error)
AnalyzeELF analyzes an ELF file at the given path and returns its size and top symbols.
type BinaryFormat ¶
type BinaryFormat string
BinaryFormat represents the format of a binary file.
const ( FormatELF BinaryFormat = "ELF" FormatMachO BinaryFormat = "Mach-O" FormatPE BinaryFormat = "PE" FormatUnknown BinaryFormat = "Unknown" )
type SizeInfo ¶
type SizeInfo struct {
Flash int64 // approx: allocated + !write sections (SHT_NOBITS excluded)
Ram int64 // approx: allocated + writable + NOBITS (bss)
Text int64 // optional breakdown
Data int64
Bss int64
}
SizeInfo represents the size of an ELF file.
type SymbolInfo ¶
SymbolInfo represents information about a symbol, including its name and size.