dwarfparser

package
v0.0.0-...-64dab58 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DWARF

func DWARF(path string) (*dwarf.Data, error)

func DumpSection

func DumpSection(path, sec string) error

func FindAllCoverPoints

func FindAllCoverPoints(path string) ([2][]uint64, error)

ReadCoverPoints finds all coverage points (calls of __sanitizer_cov_trace_*) in the object file. Currently it is [amd64|arm64]-specific: looks for opcode and correct offset. Running objdump on the whole object file is too slow.

func FindAllCoverPointsInRelaSec

func FindAllCoverPointsInRelaSec(path string) ([2][]uint64, error)

func FindAllPCs

func FindAllPCs(path string, filterTracePC bool) ([]uint64, error)

func FindAllSymbols

func FindAllSymbols(path string) ([]elf.Symbol, error)

func FindAllSymbolsInSec

func FindAllSymbolsInSec(path, sec string) ([]elf.Symbol, error)

func GenLineEntries

func GenLineEntries(path string) error

func GenLineFiles

func GenLineFiles(path string) error

func GetLineEntryByAddr

func GetLineEntryByAddr(path string, pc uint64) (*dwarf.LineEntry, error)

func GetSectionByName

func GetSectionByName(file *elf.File, sec string) (*elf.Section, error)

func GetSectionIdx

func GetSectionIdx(path, sec string) (int, error)

func IsSectionExist

func IsSectionExist(path, sec string) bool

Types

type Arch

type Arch struct {
	// contains filtered or unexported fields
}

type DWARFCompileUnit

type DWARFCompileUnit struct {
	FilePath string
	Dwarf    *dwarf.Data
	Entry    *dwarf.Entry
	Name     string
	CompDir  string
	Ranges   [][2]uint64
}

func FindAllCompileUnits

func FindAllCompileUnits(path string) ([]*DWARFCompileUnit, error)

func GetCompileUnitByAddr

func GetCompileUnitByAddr(path string, pc uint64) (*DWARFCompileUnit, error)

func (*DWARFCompileUnit) GetSubprogramByAddr

func (cu *DWARFCompileUnit) GetSubprogramByAddr(pc uint64) (*DWARFFunction, error)

type DWARFFunction

type DWARFFunction struct {
	DwarfCompileUnit *DWARFCompileUnit
	OriginAbstract   *DWARFFunction
	Type             dwarf.Tag
	Name             string
	Ranges           [][2]uint64
	DeclFile         string
	DeclLine         int
	CallFile         string
	CallLine         int
	CallColumn       int
	Inline           bool
	Offset           dwarf.Offset
	Depth            int
}

func FindAllFuncs

func FindAllFuncs(path string) ([]*DWARFFunction, error)

func FindAllFuncsInCUByAddr

func FindAllFuncsInCUByAddr(path string, pc uint64) ([]*DWARFFunction, error)

func (*DWARFFunction) GetSubroutinesBySubprogram

func (sp *DWARFFunction) GetSubroutinesBySubprogram() ([]*DWARFFunction, error)

type Frame

type Frame struct {
	PC     uint64
	Func   string
	File   string
	Line   int
	Inline bool
}

func Addr2line

func Addr2line(path string, pc uint64) ([]Frame, error)

func FindAllFramesByAddr

func FindAllFramesByAddr(path string, pc uint64) ([]Frame, error)

type TracePCInfo

type TracePCInfo struct {
	// contains filtered or unexported fields
}

func GetTracePCInfo

func GetTracePCInfo(path string) (*TracePCInfo, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL