Documentation ¶
Index ¶
- Constants
- Variables
- type DebugLineInfo
- func (lineInfo *DebugLineInfo) AllPCsBetween(begin, end uint64, excludeFile string, excludeLine int) ([]uint64, error)
- func (lineInfo *DebugLineInfo) AllPCsForFileLines(f string, m map[int][]uint64)
- func (lineInfo *DebugLineInfo) FirstFile() string
- func (lineInfo *DebugLineInfo) FirstStmtForLine(start, end uint64) (pc uint64, file string, line int, ok bool)
- func (lineInfo *DebugLineInfo) LineToPCs(filename string, lineno int) []PCStmt
- func (lineInfo *DebugLineInfo) PCToLine(basePC, pc uint64) (string, int)
- func (lineInfo *DebugLineInfo) PrologueEndPC(start, end uint64) (pc uint64, file string, line int, ok bool)
- type DebugLinePrologue
- type DebugLines
- type FileEntry
- type Location
- type PCStmt
- 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 DW_LNS_prologue_end = 10 DW_LNS_epilogue_begin = 11 DW_LNS_set_isa = 12 )
Special opcodes
const ( DW_LINE_end_sequence = 1 DW_LINE_set_address = 2 DW_LINE_define_file = 3 DW_LINE_set_discriminator = 4 )
Extended opcodes
Variables ¶
var ErrBufferUnderflow = errors.New("buffer underflow")
var ErrNoSource = 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 Logf func(string, ...interface{}) // contains filtered or unexported fields }
DebugLineInfo info of .debug_line data.
func Parse ¶
func Parse(compdir string, buf *bytes.Buffer, debugLineStr []byte, logfn func(string, ...interface{}), staticBase uint64, normalizeBackslash bool, ptrSize int) *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, excludeFile string, excludeLine int) ([]uint64, error)
AllPCsBetween returns all PC addresses between begin and end (including both begin and end) that have the is_stmt flag set and do not belong to excludeFile:excludeLine.
func (*DebugLineInfo) AllPCsForFileLines ¶ added in v1.3.0
func (lineInfo *DebugLineInfo) AllPCsForFileLines(f string, m map[int][]uint64)
AllPCsForFileLines Adds all PCs for a given file and set (domain of map) of lines to the map value corresponding to each line.
func (*DebugLineInfo) FirstFile ¶ added in v1.4.0
func (lineInfo *DebugLineInfo) FirstFile() string
func (*DebugLineInfo) FirstStmtForLine ¶ added in v1.4.0
func (lineInfo *DebugLineInfo) FirstStmtForLine(start, end uint64) (pc uint64, file string, line int, ok bool)
FirstStmtForLine looks in the half open interval [start, end) for the first PC address marked as stmt for the line at address 'start'.
func (*DebugLineInfo) LineToPCs ¶ added in v1.7.3
func (lineInfo *DebugLineInfo) LineToPCs(filename string, lineno int) []PCStmt
LineToPCs returns all PCs 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.
func (*DebugLineInfo) PrologueEndPC ¶ added in v1.1.0
func (lineInfo *DebugLineInfo) PrologueEndPC(start, end uint64) (pc uint64, file string, line int, ok bool)
PrologueEndPC returns the first PC address marked as prologue_end in the half open interval [start, end)
type DebugLinePrologue ¶
type DebugLinePrologue struct { UnitLength uint32 Version uint16 Length uint32 MinInstrLength uint8 MaxOpPerInstr uint8 InitialIsStmt uint8 LineBase int8 LineRange uint8 OpcodeBase uint8 StdOpLengths []uint8 }
DebugLinePrologue prologue of .debug_line data.
type DebugLines ¶
type DebugLines []*DebugLineInfo
type StateMachine ¶
type StateMachine struct {
// contains filtered or unexported fields
}