MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / DwarfAttribute

Class DwarfAttribute

ghidra_scripts/gimport/dwarf.py:150–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148
149
150class DwarfAttribute:
151 def __init__(self):
152 self.name: int = 0
153 self.value: int | List[int] = None
154
155 def parse(self, data: List[int], index: int) -> int:
156 self.name = int.from_bytes(data[index:index+2], byteorder='big')
157 index += 2
158 at_form = self.name & 0xF
159 if at_form == DW_FORM.DATA2:
160 self.value = int.from_bytes(data[index:index+2], byteorder='big')
161 index += 2
162 elif at_form == DW_FORM.REF:
163 self.value = int.from_bytes(data[index:index+4], byteorder='big')
164 index += 4
165 elif at_form == DW_FORM.BLOCK2:
166 block_len = int.from_bytes(data[index:index+2], byteorder='big')
167 index += 2
168 self.value = data[index:index+block_len]
169 index += block_len
170 else:
171 print("Unhandled form:", at_form)
172 exit(0)
173 return index
174
175
176class DwarfLocationAtom:

Callers 1

create_array_typeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected