Documentation
¶
Overview ¶
nolint:stylecheck,nonamedreturns
Index ¶
- func DecodeSLEB128(buf ByteReaderWithLen) (int64, uint32, error)
- func DecodeULEB128(buf ByteReaderWithLen) (uint64, uint32, error)
- func EncodeSLEB128(out io.ByteWriter, x int64)
- func EncodeULEB128(out io.ByteWriter, x uint64)
- func MakeBuf(d *dwarf.Data, format dataFormat, name string, off dwarf.Offset, data []byte) buf
- func ParseString(data *bytes.Buffer) (string, error)
- func ReadChild(reader *dwarf.Reader, name string) (*dwarf.Entry, error)
- func ReadChildTypeAndOffset(r *dwarf.Reader, name string) (*dwarf.Entry, int64, error)
- func ReadDWARFLengthVersion(data []byte) (length uint64, dwarf64 bool, version uint8, byteOrder binary.ByteOrder)
- func ReadEntry(reader *dwarf.Reader, name string, expectedTag dwarf.Tag) (*dwarf.Entry, error)
- func ReadField(e *dwarf.Entry, key dwarf.Attr) any
- func ReadType(r *dwarf.Reader, e *dwarf.Entry) (*dwarf.Entry, error)
- func ReadUintRaw(reader io.Reader, order binary.ByteOrder, ptrSize int) (uint64, error)
- func ReadUnitVersions(data []byte) map[dwarf.Offset]uint8
- func WriteUint(writer io.Writer, order binary.ByteOrder, ptrSize int, data uint64) error
- type ByteReaderWithLen
- type UnknownFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeSLEB128 ¶
func DecodeSLEB128(buf ByteReaderWithLen) (int64, uint32, error)
DecodeSLEB128 decodes a signed Little Endian Base 128 represented number.
func DecodeULEB128 ¶
func DecodeULEB128(buf ByteReaderWithLen) (uint64, uint32, error)
DecodeULEB128 decodes an unsigned Little Endian Base 128 represented number.
func EncodeSLEB128 ¶
func EncodeSLEB128(out io.ByteWriter, x int64)
EncodeSLEB128 encodes x to the signed Little Endian Base 128 format into out.
func EncodeULEB128 ¶
func EncodeULEB128(out io.ByteWriter, x uint64)
EncodeULEB128 encodes x to the unsigned Little Endian Base 128 format into out.
func ParseString ¶
ParseString reads a null-terminated string from data.
func ReadChildTypeAndOffset ¶ added in v0.31.0
func ReadDWARFLengthVersion ¶ added in v0.28.0
func ReadDWARFLengthVersion(data []byte) (length uint64, dwarf64 bool, version uint8, byteOrder binary.ByteOrder)
ReadDWARFLengthVersion reads a DWARF length field followed by a version field.
func ReadUintRaw ¶
ReadUintRaw reads an integer of ptrSize bytes, with the specified byte order, from reader.
func ReadUnitVersions ¶
ReadUnitVersions reads the DWARF version of each unit in a debug_info section and returns them as a map.
Types ¶
type ByteReaderWithLen ¶
type ByteReaderWithLen interface {
io.ByteReader
io.Reader
Len() int
}
ByteReaderWithLen is a io.ByteReader with a Len method. This interface is satisified by both bytes.Buffer and bytes.Reader.
type UnknownFormat ¶
type UnknownFormat struct{}
Some parts of DWARF have no data format, e.g., abbrevs.