Documentation ¶
Index ¶
- Constants
- Variables
- type DebugLineInfo
- func (lineInfo *DebugLineInfo) AllPCsBetween(begin, end uint64) ([]uint64, error)
- func (lineInfo *DebugLineInfo) AllPCsForFileLine(f string, l int) (pcs []uint64)
- func (lineInfo *DebugLineInfo) LineToPC(filename string, lineno int) uint64
- func (lineInfo *DebugLineInfo) PCToLine(basePC, pc uint64) (string, int)
- type DebugLinePrologue
- type DebugLines
- type FileEntry
- type Location
- type StateMachine
Constants ¶
const ( DW_LNS_copy = 1 DW_LNS_advance_pc = 2 DW_LNS_advance_line = 3 DW_LNS_set_file = 4 DW_LNS_set_column = 5 DW_LNS_negate_stmt = 6 DW_LNS_set_basic_block = 7 DW_LNS_const_add_pc = 8 DW_LNS_fixed_advance_pc = 9 )
Special opcodes
const ( DW_LINE_end_sequence = 1 DW_LINE_set_address = 2 DW_LINE_define_file = 3 )
Extended opcodes
Variables ¶
var NoSourceError = errors.New("no source available")
Functions ¶
This section is empty.
Types ¶
type DebugLineInfo ¶
type DebugLineInfo struct { Prologue *DebugLinePrologue IncludeDirs []string FileNames []*FileEntry Instructions []byte Lookup map[string]*FileEntry // contains filtered or unexported fields }
func Parse ¶
func Parse(compdir string, buf *bytes.Buffer) *DebugLineInfo
Parse parses a single debug_line segment from buf. Compdir is the DW_AT_comp_dir attribute of the associated compile unit.
func (*DebugLineInfo) AllPCsBetween ¶ added in v1.0.0
func (lineInfo *DebugLineInfo) AllPCsBetween(begin, end uint64) ([]uint64, error)
func (*DebugLineInfo) AllPCsForFileLine ¶ added in v1.0.0
func (lineInfo *DebugLineInfo) AllPCsForFileLine(f string, l int) (pcs []uint64)
Returns all PCs for a given file/line. Useful for loops where the 'for' line could be split amongst 2 PCs.
func (*DebugLineInfo) LineToPC ¶ added in v1.0.0
func (lineInfo *DebugLineInfo) LineToPC(filename string, lineno int) uint64
LineToPC returns the first PC address associated with filename:lineno.
func (*DebugLineInfo) PCToLine ¶ added in v1.0.0
func (lineInfo *DebugLineInfo) PCToLine(basePC, pc uint64) (string, int)
PCToLine returns the filename and line number associated with pc. If pc isn't found inside lineInfo's table it will return the filename and line number associated with the closest PC address preceding pc. basePC will be used for caching, it's normally the entry point for the function containing pc.
type DebugLinePrologue ¶
type DebugLines ¶
type DebugLines []*DebugLineInfo
func ParseAll ¶ added in v1.0.0
func ParseAll(data []byte) DebugLines
ParseAll parses all debug_line segments found in data
type StateMachine ¶
type StateMachine struct {
// contains filtered or unexported fields
}