Documentation ¶
Index ¶
- Variables
- type Entry
- type Reader
- func (reader *Reader) AddrFor(name string) (uint64, error)
- func (reader *Reader) AddrForMember(member string, initialInstructions []byte) (uint64, error)
- func (reader *Reader) FindEntryNamed(name string, member bool) (*dwarf.Entry, error)
- func (reader *Reader) InstructionsForEntry(entry *dwarf.Entry) ([]byte, error)
- func (reader *Reader) InstructionsForEntryNamed(name string, member bool) ([]byte, error)
- func (reader *Reader) NextCompileUnit() (*dwarf.Entry, error)
- func (reader *Reader) NextMemberVariable() (*dwarf.Entry, error)
- func (reader *Reader) NextPackageVariable() (*dwarf.Entry, error)
- func (reader *Reader) NextType() (*dwarf.Entry, error)
- func (reader *Reader) Seek(off dwarf.Offset)
- func (reader *Reader) SeekToEntry(entry *dwarf.Entry) error
- func (reader *Reader) SeekToFunction(pc uint64) (*dwarf.Entry, error)
- func (reader *Reader) SeekToType(entry *dwarf.Entry, resolveTypedefs bool, resolvePointerTypes bool) (*dwarf.Entry, error)
- func (reader *Reader) SeekToTypeNamed(name string) (*dwarf.Entry, error)
- type VariableReader
Constants ¶
This section is empty.
Variables ¶
var TypeNotFoundErr = errors.New("no type entry found, use 'types' for a list of valid types")
Functions ¶
This section is empty.
Types ¶
type Entry ¶ added in v1.0.0
Entry represents a debug_info entry. When calling Val, if the entry does not have the specified attribute, the entry specified by DW_AT_abstract_origin will be searched recursively.
type Reader ¶
func (*Reader) AddrForMember ¶
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 ¶
Finds the entry for 'name'.
func (*Reader) InstructionsForEntry ¶
func (*Reader) InstructionsForEntryNamed ¶
func (*Reader) NextMemberVariable ¶
NextMememberVariable moves the reader to the next debug entry that describes a member variable and returns the entry.
func (*Reader) NextPackageVariable ¶
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) SeekToEntry ¶
SeekToEntry moves the reader to an arbitrary entry.
func (*Reader) SeekToFunction ¶
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.
type VariableReader ¶ added in v1.0.0
type VariableReader struct {
// contains filtered or unexported fields
}
VariableReader provides a way of reading the local variables and formal parameters of a function that are visible at the specified PC address.
func Variables ¶ added in v1.0.0
func Variables(dwarf *dwarf.Data, off dwarf.Offset, pc uint64, line int, onlyVisible bool) *VariableReader
Variables returns a VariableReader for the function or lexical block at off. If onlyVisible is true only variables visible at pc will be returned by the VariableReader.
func (*VariableReader) Depth ¶ added in v1.0.0
func (vrdr *VariableReader) Depth() int
Depth returns the depth of the current scope
func (*VariableReader) Entry ¶ added in v1.0.0
func (vrdr *VariableReader) Entry() *dwarf.Entry
Entry returns the current variable entry.
func (*VariableReader) Err ¶ added in v1.0.0
func (vrdr *VariableReader) Err() error
Err returns the error if there was one.
func (*VariableReader) Next ¶ added in v1.0.0
func (vrdr *VariableReader) Next() bool
Next reads the next variable entry, returns false if there aren't any.