if name not in d:
self.__attrs__.append(name)
d[name] = value
+ def __contains__(self, name):
+ return name in self.__dict__
def __getitem__(self, name):
return self.__dict__[name]
def __delitem__(self, name):
from elftools.elf.elffile import ELFFile
from elftools.elf.sections import *
+from elftools.dwarf.dwarfrelocationmanager import DWARFRelocationManager
+
# read a little-endian, 64-bit file
es = ELFStructs(True, 64)
print 'CU header', cu.header
topdie = cu.get_top_DIE()
-print topdie
-
-#~ print 'siblings.....'
-
-#~ for s in c.iter_siblings():
- #~ print s
-
-#~ from elftools.dwarf.location_expr import DW_OP_name2opcode, DW_OP_opcode2name
-
-#~ print hex(DW_OP_name2opcode['DW_OP_lit14'])
-#~ print DW_OP_opcode2name[0x0e]
+#print topdie
+dinfo_sec = efile.get_section_by_name('.debug_info')
+relman = DWARFRelocationManager(efile, dinfo_sec.name, dinfo_sec['sh_offset'])
+print relman._reloc_section.name, relman._reloc_section['sh_offset']
+pprint.pprint(relman._relocs)