symbol

package
v0.0.0-...-eda43a2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryInfo

type BinaryInfo struct {
	Sources      map[string]map[int][]*dwarf.LineEntry // key=filename, val=map[lineno]lineEntries
	Functions    []*Function
	CompileUnits []*CompileUnit
	FdeEntries   frame.FrameDescriptionEntries
	// contains filtered or unexported fields
}

BinaryInfo binary info

func Analyze

func Analyze(execFile string) (*BinaryInfo, error)

Analyze analyzes executable `execFile` and return the binary info

func (*BinaryInfo) Dump

func (bi *BinaryInfo) Dump()

func (*BinaryInfo) FileLineToPC

func (bi *BinaryInfo) FileLineToPC(filename string, lineno int) (uint64, error)

FileLineToPC convert location `filename:lineno` to PC

func (*BinaryInfo) FileLineToPCForBreakpoint

func (bi *BinaryInfo) FileLineToPCForBreakpoint(filename string, lineno int) (uint64, error)

FileLineToPCForBreakpoint convert location `filename:lineno` to PC, used for breakpoint address

func (*BinaryInfo) LocToPC

func (bi *BinaryInfo) LocToPC(loc string) (uint64, error)

LocToPC convert location `loc` to PC

func (*BinaryInfo) PCToFDE

func (bi *BinaryInfo) PCToFDE(pc uint64) (*frame.FrameDescriptionEntry, error)

PCToFDE returns the frame whose range covers PC

func (*BinaryInfo) PCToFileLine

func (bi *BinaryInfo) PCToFileLine(pc uint64) (string, int, error)

func (*BinaryInfo) PCToFunction

func (bi *BinaryInfo) PCToFunction(pc uint64) (*Function, error)

PCToFunction returns the function whose range covers PC

note: not considered inline function

func (*BinaryInfo) ParseFrame

func (bi *BinaryInfo) ParseFrame(elffile *elf.File) error

ParseFrame parse .(z)debug_frame section to build the Call Frame Information

see DWARFv4 6.4 Call Frame Information.

func (*BinaryInfo) ParseLineAndInfo

func (bi *BinaryInfo) ParseLineAndInfo(dwarfData *dwarf.Data) error

ParseLineAndInfo parseFrom .(z)debug_line and .(z)debug_info sections

unit entries: see DWARF v4 chapter 3.3.1 normal and partial compilation unit entries

type CompileUnit

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

CompileUnit compilation unit

see DWARFv4 3.1.1 normal and partial compilation unit entries

type Function

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

Function function

see DWARFv4 3.3 subroutine and entry point entries

func (*Function) Name

func (f *Function) Name() string

func (*Function) Variables

func (f *Function) Variables() []*dwarf.Entry

Jump to

Keyboard shortcuts

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