from collections import defaultdict
from .constants import *
+from .location_expr import LocationExpressionDumper
def describe_attr_value(attr, die, section_offset):
if attr.form in ('DW_FORM_data4', 'DW_FORM_data8'):
return '(location list)'
else:
- return '<<ZZZ>> %s %s' % (attr.value, type(attr.value))
+ location_expr_dumper = LocationExpressionDumper(die.cu.structs)
+ location_expr_dumper.process_expr(attr.value)
+ return '(' + location_expr_dumper.get_str() + ')'
_EXTRA_INFO_DESCRIPTION_MAP = defaultdict(
add('DW_OP_breg%s' % n,
self._make_visitor_arg_struct(self.structs.Dwarf_sleb128('')))
+ add('DW_OP_fbreg',
+ self._make_visitor_arg_struct(self.structs.Dwarf_sleb128('')))
add('DW_OP_regx',
self._make_visitor_arg_struct(self.structs.Dwarf_uleb128('')))
add('DW_OP_bregx',
'DW_OP_const4u', 'DW_OP_const4s', 'DW_OP_constu', 'DW_OP_consts',
'DW_OP_pick', 'DW_OP_plus_uconst', 'DW_OP_bra', 'DW_OP_skip',
'DW_OP_fbreg', 'DW_OP_piece', 'DW_OP_deref_size',
- 'DW_OP_xderef_size', 'DW_OP_regx', 'DW_OP_fbreg', ])
+ 'DW_OP_xderef_size', 'DW_OP_regx',])
for n in range(0, 32):
self._ops_with_decimal_arg.add('DW_OP_breg%s' % n)
self.visitor.process_expr([0x74, 0x82, 0x01])
self.assertEqual(self.visitor.get_str(),
'DW_OP_breg4: 130')
+
+ self.setUp()
+ self.visitor.process_expr([0x91, 0x82, 0x01])
+ self.assertEqual(self.visitor.get_str(),
+ 'DW_OP_fbreg: 130')
self.setUp()
self.visitor.process_expr([0x9d, 0x8f, 0x0A, 0x90, 0x01])