fix examples/dwarf_location_info.py (#490)
authorNick Desaulniers <nickdesaulniers@users.noreply.github.com>
Wed, 23 Aug 2023 12:23:34 +0000 (05:23 -0700)
committerGitHub <noreply@github.com>
Wed, 23 Aug 2023 12:23:34 +0000 (05:23 -0700)
commitaea2b479bfe494a84253f5b80a941c8ac70054d9
treed6158e847ef2b2766c7ac289083950270a2c8c9e
parent747e81751f47cec696b19be1a1ab1cc692afa794
fix examples/dwarf_location_info.py (#490)

Pass along the DIE otherwise the following error is observed:

    Traceback (most recent call last):
      File "/tmp/pyelftools/examples/dwarf_location_info.py", line 110, in <module>
        process_file(filename)
      File "/tmp/pyelftools/examples/dwarf_location_info.py", line 78, in process_file
        loc = loc_parser.parse_from_attribute(attr,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/tmp/pyelftools/elftools/dwarf/locationlists.py", line 307, in parse_from_attribute
        return self.location_lists.get_location_list_at_offset(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/tmp/pyelftools/elftools/dwarf/locationlists.py", line 96, in get_location_list_at_offset
        return self._parse_location_list_from_stream_v5(die.cu) if self.version >= 5 else self._parse_location_list_from_stream()
                                                        ^^^^^^
    AttributeError: 'NoneType' object has no attribute 'cu'
examples/dwarf_location_info.py