src

package
v0.0.0-...-ae7880c Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LineCache

type LineCache struct {
	// contains filtered or unexported fields
}

LineCache reads ranges of lines from a set of files, using caching line position information.

func (*LineCache) Get

func (c *LineCache) Get(fs fs.FS, path string, lineStart, nLines int) ([]byte, error)

Get returns the data for nLines lines beginning at line lineStart for the given file path. Line numbers are 1-based. If lineStart is less than 1, this starts at line 1.

type Range

type Range struct {
	Low, High uint64
}

Range represents a range of addresses [Low, High).

func (Range) String

func (r Range) String() string

type SourceBlock

type SourceBlock struct {
	Path string

	// Func is the TagSubprogram or TagInlinedSubroutine of the function
	// or inlined function that this source code is in. This may be nil
	// if unknown.
	Func *dwarf.Entry

	LineStart int
	NLines    int

	// PCs maps from a line number to a set of PC ranges of instructions
	// that appear at that line.
	PCs map[int][]Range
}

func SourceBlocks

func SourceBlocks(d *dbg.Data, subprogram dbg.Subprogram) ([]SourceBlock, error)

SourceBlocks returns a set of source code blocks for subprogram. Because of inlining, there may be more than one source block.

Jump to

Keyboard shortcuts

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