unwind

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DwarfExpressionID added in v0.11.0

type DwarfExpressionID int16
const (
	ExpressionUnknown DwarfExpressionID = iota
	ExpressionPlt1
	ExpressionPlt2
)

func ExpressionIdentifier added in v0.11.0

func ExpressionIdentifier(expression []byte) DwarfExpressionID

ExpressionIdentifier returns the identifier for recognized DWARF expressions.

type UnwindTable

type UnwindTable []UnwindTableRow

func (UnwindTable) Len

func (t UnwindTable) Len() int

func (UnwindTable) Less

func (t UnwindTable) Less(i, j int) bool

func (UnwindTable) Swap

func (t UnwindTable) Swap(i, j int)

type UnwindTableBuilder

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

UnwindTableBuilder helps to build UnwindTable for a given PID.

javierhonduco(note): Caching on PID alone will result in hard to debug issues as PIDs are reused. Right now we will parse the CIEs and FDEs over and over. Caching will be added later on.

func NewUnwindTableBuilder

func NewUnwindTableBuilder(logger log.Logger) *UnwindTableBuilder

func (*UnwindTableBuilder) PrintTable

func (ptb *UnwindTableBuilder) PrintTable(writer io.Writer, path string) error

PrintTable is a debugging helper that prints the unwinding table to the given io.Writer.

func (*UnwindTableBuilder) UnwindTableForPid

func (ptb *UnwindTableBuilder) UnwindTableForPid(pid int) (UnwindTable, error)

type UnwindTableRow

type UnwindTableRow struct {
	// The address of the machine instruction.
	// Each row covers a range of machine instruction, from its address (Loc) to that of the row below.
	Loc uint64
	// CFA, the value of the stack pointer in the previous frame.
	CFA frame.DWRule
	// The value of the RBP register.
	RBP frame.DWRule
	// The value of the saved return address. This is not needed in x86_64 as it's part of the ABI but is necessary
	// in arm64.
	RA frame.DWRule
}

UnwindTableRow represents a single row in the unwind table. x86_64: rip (instruction pointer register), rsp (stack pointer register), rbp (base pointer/frame pointer register) aarch64: lr, sp, fp

Jump to

Keyboard shortcuts

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