projects
/
pyelftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aea2b47
)
Friendly error in get_location_list_at_offset (#492)
author
Seva Alekseyev
<sevaa@yarxi.ru>
Wed, 23 Aug 2023 14:32:24 +0000
(10:32 -0400)
committer
GitHub
<noreply@github.com>
Wed, 23 Aug 2023 14:32:24 +0000
(07:32 -0700)
elftools/dwarf/locationlists.py
patch
|
blob
|
history
diff --git
a/elftools/dwarf/locationlists.py
b/elftools/dwarf/locationlists.py
index 243834fee0ab89024637e0ae0d18e8b30f0c00bc..9a349779baa02eecf260f846392a2edcd50aa65b 100644
(file)
--- a/
elftools/dwarf/locationlists.py
+++ b/
elftools/dwarf/locationlists.py
@@
-92,6
+92,8
@@
class LocationLists(object):
Passing the die is only neccessary in DWARF5+, for decoding
location entry encodings that contain references to other sections.
"""
+ if self.version >= 5 and die is None:
+ raise DWARFError("For this binary, \"die\" needs to be provided")
self.stream.seek(offset, os.SEEK_SET)
return self._parse_location_list_from_stream_v5(die.cu) if self.version >= 5 else self._parse_location_list_from_stream()