MCPcopy Create free account
hub / github.com/dispatchrun/wzprof / getDwarfLocationAddress

Function getDwarfLocationAddress

python.go:97–111  ·  view source on GitHub ↗
(ent *dwarf.Entry)

Source from the content-addressed store, hash-verified

95}
96
97func getDwarfLocationAddress(ent *dwarf.Entry) uint32 {
98 f := ent.AttrField(dwarf.AttrLocation)
99 if f == nil {
100 return 0
101 }
102 if f.Class != dwarf.ClassExprLoc {
103 panic(fmt.Errorf("invalid location class: %s", f.Class))
104 }
105 const DW_OP_addr = 0x3
106 loc := f.Val.([]byte)
107 if len(loc) == 0 || loc[0] != DW_OP_addr {
108 panic(fmt.Errorf("unexpected address format: %X", loc))
109 }
110 return binary.LittleEndian.Uint32(loc[1:])
111}
112
113// Padding of fields in various CPython structs. They are calculated
114// by writing a function in any CPython module, and executing it with

Callers 1

pythonAddressFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected