a bit progress on locationlists
diff --git a/elftools/dwarf/locationlists.py b/elftools/dwarf/locationlists.py
index 4ea8877..afe12e3 100644
--- a/elftools/dwarf/locationlists.py
+++ b/elftools/dwarf/locationlists.py
@@ -11,8 +11,34 @@
from ..common.utils import struct_parse
+LocationEntry = namedtuple('LocationEntry', 'begin_offset end_offset loc_expr')
+BaseAddressEntry = namedtuple('BaseAddressEntry', 'base_address')
+
+
class LocationLists(object):
def __init__(self, stream, structs):
- pass
+ self._max_addr = 2 ** (self.structs.address_size * 8) - 1
+ def get_location_list_at_offset(self, offset):
+ pass
+
+ def iter_location_lists(self):
+ pass
+
+ def _parse_location_list_from_stream(self):
+ lst = []
+ while True:
+ begin_offset = struct_parse(
+ self.structs.Dwarf_target_addr(''), self.stream)
+ end_offset = struct_parse(
+ self.structs.Dwarf_target_addr(''), self.stream)
+ if begin_offset == 0 and end_offset == 0:
+ # End of list - we're done.
+ break
+ elif begin_offset == self._max_addr:
+ # base
+ else:
+ # entry...
+
+