locexpr

package
v0.9.1-0...-f1475b1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package locexpr provides a function to statically execute a DWARF location expression.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(expression []byte) string

Format gives a pretty printing of the location expression for debugging/error reporting purposes

Types

type LocationPiece

type LocationPiece struct {
	// Size of this piece in bytes
	Size int64
	// True if this piece is contained in a register.
	InReg bool
	// Offset from the stackpointer.
	// Only given if the piece resides on the stack.
	StackOffset int64
	// Register number of the piece.
	// Only given if the piece resides in registers.
	Register int
}

LocationPiece is the result of `Exec` (returned as a list), and describes whether the piece of the location is in a register (and if so, which one) or if it is on the stack (and if so, at what offset).

func Exec

func Exec(expression []byte, totalSize int64, pointerSize int) ([]LocationPiece, error)

Exec statically executes a DWARF location expression (see DWARF v4 spec sections 2.5, 2.6, and 7.7 for more info), returning a description of the location that is either in registers or on the stack.

This implementation is based on github.com/go-delve/delve/pkg/proc.(*BinaryInfo).Location: - https://github.com/go-delve/delve/blob/75bbbbb60cecda0d65c63de7ae8cb8b8412d6fc3/pkg/proc/bininfo.go#L1062 which is licensed under MIT.

Jump to

Keyboard shortcuts

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