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

Method add_enum_members

ghidra_scripts/gimport/extract_info.py:324–337  ·  view source on GitHub ↗
(self, die: DIEV1)

Source from the content-addressed store, hash-verified

322 self.globals.append(global_variable)
323
324 def add_enum_members(self, die: DIEV1):
325 enum_type: GStructType = self.offset_to_type[die.offset]
326 enum_type.byte_size = die.attributes[DW_AT.byte_size].value
327 data: List[int] = die.attributes[DW_AT.element_list].value
328 index = 0
329 while index < len(data):
330 value = int.from_bytes(data[index:index+4], byteorder='big')
331 index += 4
332 name_start = index
333 while data[index] != 0:
334 index += 1
335 name = bytes(data[name_start:index]).decode("UTF-8")
336 index += 1
337 enum_type.enum_values.append((name, value))
338
339 def process_die(self, die: DIEV1):
340 if die.tag == DW_TAG.structure_type or die.tag == DW_TAG.union_type or \

Callers 1

process_dieMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected