reader

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TypeNotFoundErr = errors.New("no type entry found, use 'types' for a list of valid types")

Functions

This section is empty.

Types

type Reader

type Reader struct {
	*dwarf.Reader
	// contains filtered or unexported fields
}

func New

func New(data *dwarf.Data) *Reader

New returns a reader for the specified dwarf data.

func (*Reader) AddrFor

func (reader *Reader) AddrFor(name string) (uint64, error)

Returns the address for the named entry.

func (*Reader) AddrForMember

func (reader *Reader) AddrForMember(member string, initialInstructions []byte) (uint64, error)

Returns the address for the named struct member. Expects the reader to be at the parent entry or one of the parents children, thus does not seek to parent by itself.

func (*Reader) FindEntryNamed

func (reader *Reader) FindEntryNamed(name string, member bool) (*dwarf.Entry, error)

Finds the entry for 'name'.

func (*Reader) InstructionsForEntry

func (reader *Reader) InstructionsForEntry(entry *dwarf.Entry) ([]byte, error)

func (*Reader) InstructionsForEntryNamed

func (reader *Reader) InstructionsForEntryNamed(name string, member bool) ([]byte, error)

func (*Reader) NextCompileUnit

func (reader *Reader) NextCompileUnit() (*dwarf.Entry, error)

func (*Reader) NextMemberVariable

func (reader *Reader) NextMemberVariable() (*dwarf.Entry, error)

NextMememberVariable moves the reader to the next debug entry that describes a member variable and returns the entry.

func (*Reader) NextPackageVariable

func (reader *Reader) NextPackageVariable() (*dwarf.Entry, error)

NextPackageVariable moves the reader to the next debug entry that describes a package variable. Any TagVariable entry that is not inside a sub prgram entry and is marked external is considered a package variable.

func (*Reader) NextScopeVariable

func (reader *Reader) NextScopeVariable() (*dwarf.Entry, error)

NextScopeVariable moves the reader to the next debug entry that describes a local variable and returns the entry.

func (*Reader) NextType

func (reader *Reader) NextType() (*dwarf.Entry, error)

func (*Reader) Seek

func (reader *Reader) Seek(off dwarf.Offset)

Seek moves the reader to an arbitrary offset.

func (*Reader) SeekToEntry

func (reader *Reader) SeekToEntry(entry *dwarf.Entry) error

SeekToEntry moves the reader to an arbitrary entry.

func (*Reader) SeekToFunction

func (reader *Reader) SeekToFunction(pc uint64) (*dwarf.Entry, error)

SeekToFunctionEntry moves the reader to the function that includes the specified program counter.

func (*Reader) SeekToType

func (reader *Reader) SeekToType(entry *dwarf.Entry, resolveTypedefs bool, resolvePointerTypes bool) (*dwarf.Entry, error)

SeekToType moves the reader to the type specified by the entry, optionally resolving typedefs and pointer types. If the reader is set to a struct type the NextMemberVariable call can be used to walk all member data.

func (*Reader) SeekToTypeNamed

func (reader *Reader) SeekToTypeNamed(name string) (*dwarf.Entry, error)

SeekToTypeNamed moves the reader to the type specified by the name. If the reader is set to a struct type the NextMemberVariable call can be used to walk all member data.

Jump to

Keyboard shortcuts

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