self._ops_with_hex_arg = set(
['DW_OP_addr', 'DW_OP_call2', 'DW_OP_call4', 'DW_OP_call_ref'])
- def _after_visit(self, opcode, opcode_name, args):
- self._str_parts.append(self._dump_to_string(opcode, opcode_name, args))
-
def _dump_to_string(self, opcode, opcode_name, args):
if len(args) == 0:
if opcode_name.startswith('DW_OP_reg'):
DW_OP_opcode2name = dict((v, k) for k, v in iteritems(DW_OP_name2opcode))
+# Each parsed DWARF expression is returned as this type with its numeric opcode,
+# op name (as a string) and a list of arguments.
DwarfExprOp = namedtuple('DwarfExprOp', 'op op_name args')
def parse_expr(expr, structs):
- """TODO
+ """ Parses expr (a list of integers) into a list of DwarfExprOp.
+
+ The list can potentially be nested.
"""
dispatch_table = _init_dispatch_table(structs)