Documentation ¶
Index ¶
- Variables
- func InlineStack(root *godwarf.Tree, pc uint64) []*godwarf.Tree
- type Reader
- func (reader *Reader) AddrFor(name string, staticBase uint64, ptrSize int) (uint64, error)
- func (reader *Reader) AddrForMember(member string, initialInstructions []byte, ptrSize int) (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) SeekToType(entry *dwarf.Entry, resolveTypedefs bool, resolvePointerTypes bool) (*dwarf.Entry, error)
- func (reader *Reader) SeekToTypeNamed(name string) (*dwarf.Entry, error)
- type Variable
- type VariablesFlags
Constants ¶
This section is empty.
Variables ¶
var TypeNotFoundErr = errors.New("no type entry found, use 'types' for a list of valid types")
TypeNotFoundErr type not found error
Functions ¶
Types ¶
type Reader ¶
func (*Reader) AddrForMember ¶
func (reader *Reader) AddrForMember(member string, initialInstructions []byte, ptrSize int) (uint64, error)
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 ¶
FindEntryNamed finds the entry for 'name'. 'member' specifies whether 'name' is a member or not, and 'member' implies the expected tag of dwarf.Entry.
func (*Reader) InstructionsForEntry ¶
InstructionsForEntry returns the instructions for 'entry'.
func (*Reader) InstructionsForEntryNamed ¶
InstructionsForEntryNamed returns instructions for 'name'.
func (*Reader) NextCompileUnit ¶
NextCompileUnit moves the reader to the next compile unit debug entry.
func (*Reader) NextMemberVariable ¶
NextMemberVariable 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) 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 Variable ¶
type Variable struct { *godwarf.Tree // Depth represents the depth of the lexical block in which this variable // was declared, relative to a root scope (e.g. a function) passed to // Variables(). The depth is used to figure out if a variable is shadowed at // a particular pc by another one with the same name declared in an inner // block. Depth int }
Variable a variable representation.
type VariablesFlags ¶
type VariablesFlags uint8
VariablesFlags specifies some configuration flags for the Variables function.
const ( VariablesOnlyVisible VariablesFlags = 1 << iota VariablesSkipInlinedSubroutines VariablesTrustDeclLine )