dwtest

package standard library
go1.26.9 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SubprogLoAndHighPc added in go1.25.0

func SubprogLoAndHighPc(subprogdie *dwarf.Entry) (lo uint64, hi uint64, err error)

SubprogLoAndHighPc returns the values of the lo_pc and high_pc attrs of the DWARF DIE subprogdie. For DWARF versions 2-3, both of these attributes had to be of class address; with DWARF 4 the rules were changed, allowing compilers to emit a high PC attr of class constant, where the high PC could be computed by starting with the low PC address and then adding in the high_pc attr offset. This function accepts both styles of specifying a hi/lo pair, returning the values or an error if the attributes are malformed in some way.

Types

type Examiner

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

func (*Examiner) Children

func (ex *Examiner) Children(idx int) []*dwarf.Entry

Returns a list of child entries for a die with ID 'idx'

func (*Examiner) DIEs

func (ex *Examiner) DIEs() []*dwarf.Entry

func (*Examiner) DumpEntry

func (ex *Examiner) DumpEntry(idx int, dumpKids bool, ilevel int)

For debugging new tests

func (*Examiner) EntryFromOffset

func (ex *Examiner) EntryFromOffset(off dwarf.Offset) *dwarf.Entry

Given a DIE offset, return the previously read dwarf.Entry, or nil

func (*Examiner) FileRef

func (ex *Examiner) FileRef(dw *dwarf.Data, dieIdx int, fileRef int64) (string, error)

FileRef takes a given DIE by index and a numeric file reference (presumably from a decl_file or call_file attribute), looks up the reference in the .debug_line file table, and returns the proper string for it. We need to know which DIE is making the reference so as to find the right compilation unit.

func (*Examiner) IdxFromOffset

func (ex *Examiner) IdxFromOffset(off dwarf.Offset) int

Return the ID that Examiner uses to refer to the DIE at offset off

func (*Examiner) Named

func (ex *Examiner) Named(name string) []*dwarf.Entry

Return a list of all DIEs with name 'name'. When searching for DIEs by name, keep in mind that the returned results will include child DIEs such as params/variables. For example, asking for all DIEs named "p" for even a small program will give you 400-500 entries.

func (*Examiner) Parent

func (ex *Examiner) Parent(idx int) *dwarf.Entry

Returns parent DIE for DIE 'idx', or nil if the DIE is top level

func (*Examiner) ParentCU

func (ex *Examiner) ParentCU(idx int) *dwarf.Entry

ParentCU returns the enclosing compilation unit DIE for the DIE with a given index, or nil if for some reason we can't establish a parent.

func (*Examiner) Populate

func (ex *Examiner) Populate(rdr *dwarf.Reader) error

Populate the Examiner using the DIEs read from rdr.

Jump to

Keyboard shortcuts

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