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

Method parse_expr

ghidra_scripts/gimport/dwarfone.py:334–356  ·  view source on GitHub ↗
(self, expr)

Source from the content-addressed store, hash-verified

332 self.structs = structs
333
334 def parse_expr(self, expr):
335 stm = BytesIO(bytelist2string(expr))
336 parsed = []
337
338 while True:
339 # Get the next opcode from the stream. If nothing is left in the
340 # stream, we're done.
341 byte = stm.read(1)
342 if len(byte) == 0:
343 break
344
345 # Decode the opcode and its name.
346 op = ord(byte)
347 op_name = DW_OP_opcode2name.get(op, 'OP:0x%x' % op)
348
349 if op <= 4 or op == 0x80:
350 args = [struct_parse(self.structs.Dwarf_target_addr(''), stm),]
351 else:
352 args = []
353
354 parsed.append(DWARFExprOp(op=op, op_name=op_name, args=args, offset=stm.tell()))
355
356 return parsed
357
358
359class DWARFInfoV1(object):

Callers

nothing calls this directly

Calls 1

readMethod · 0.80

Tested by

no test coverage detected