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 ¶
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.