dwarf

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DW_LLE_end_of_list   loclistDescriptorCode = 0x00
	DW_LLE_base_addressx loclistDescriptorCode = 0x01
	// DW_LLE_startx_endx      loclistDescriptor = 0x02
	// DW_LLE_startx_length    loclistDescriptor = 0x03
	DW_LLE_offset_pair loclistDescriptorCode = 0x04
	// DW_LLE_default_location loclistDescriptor = 0x05
	// DW_LLE_base_address     loclistDescriptor = 0x06
	// DW_LLE_start_end        loclistDescriptor = 0x07
	DW_LLE_start_length loclistDescriptorCode = 0x08
)

Variables

View Source
var (
	AttrLocation = dbgDwarf.AttrLocation
	AttrName     = dbgDwarf.AttrName
	AttrInline   = dbgDwarf.AttrInline
	AttrType     = dbgDwarf.AttrType
)
View Source
var (
	TagVariable        = dbgDwarf.TagVariable
	TagFormalParameter = dbgDwarf.TagFormalParameter
	TagSubprogram      = dbgDwarf.TagSubprogram
)

Functions

func VisitPrefixOrder

func VisitPrefixOrder(n *Node, f func(*Node))

Types

type LLEBaseAddressX

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

type LLEOffsetPair

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

func (LLEOffsetPair) Ops

func (d LLEOffsetPair) Ops() []op.Operation

type LLEStartLength

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

type Loclist

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

func (*Loclist) Entries

func (l *Loclist) Entries() []LoclistEntry

type LoclistEntry

type LoclistEntry interface {
	// contains filtered or unexported methods
}

type LoclistTable

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

func NewLoclistTable

func NewLoclistTable(f *elf.File) (*LoclistTable, error)

func (*LoclistTable) Dump

func (l *LoclistTable) Dump()

func (*LoclistTable) Loclist

func (l *LoclistTable) Loclist(i int) (*Loclist, error)

type Node

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

func (*Node) AbstractOrigin

func (n *Node) AbstractOrigin() *Node

The abstract origin attribute is used to deduplicate common attributes between multiple entries. For example, when a function is inlined into multiple places, there will be multiple entries with the same name, type, and location, but different locations in the code where they are inlined. These entries can point to a single abstract origin entry that has the common attributes, and then only have the location attribute that is different between them.

func (*Node) ByteSize

func (n *Node) ByteSize() int64

Returns the size of type in bytes.

func (*Node) Dump

func (n *Node) Dump(indent int)

func (*Node) Entry

func (n *Node) Entry() *dwarf.Entry

func (*Node) FileCol

func (n *Node) FileCol() string

Returns the file and line number of this entry, or an empty string if there is no file and line number.

func (*Node) Location

func (n *Node) Location() ([]op.Operation, error)

Returns the location as a list of DWARF operations, or nil if there is no location. Sometimes a location is static an can be resolved. Sometimes a location is dynamic and depends on the context in which it is evaluated, in which case runtime info such as register values is needed to resolve it.

func (*Node) LocationList

func (n *Node) LocationList() (*Loclist, error)

Returns the location as a list of location list entries, or nil if there is no location list. Location lists are used when the location of a variable changes over the course of the program, for example when a variable is optimized to live in a register for part of the program and on the stack for another part of the program.

func (*Node) Name

func (n *Node) Name() string

func (*Node) Parent

func (n *Node) Parent() *Node

func (*Node) Type

func (n *Node) Type() *Node

Returns the type of this entry, or nil if there is no type.

type Tree

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

func NewDWARFTree

func NewDWARFTree(path string) (*Tree, error)

func (*Tree) AddToIndex

func (t *Tree) AddToIndex(n *Node)

func (*Tree) ByType

func (t *Tree) ByType(tag dwarf.Tag) []*Node

func (*Tree) Dump

func (t *Tree) Dump()

Directories

Path Synopsis
SPDX-License-Identifier: MIT Copyright (c) 2014 Derek Parker Original from https://github.com/go-delve/delve/tree/v1.26.1/pkg/dwarf/leb128
SPDX-License-Identifier: MIT Copyright (c) 2014 Derek Parker Original from https://github.com/go-delve/delve/tree/v1.26.1/pkg/dwarf/leb128

Jump to

Keyboard shortcuts

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