scripts: fixed missing argument in parse_from_attribute call.

In size_report script, if the DWARF section of ELF file contains both
debug_loc and a debug_loclists sections, LocationListsPair class is
used to track locations. In that case, parse_from_attribute was missing
one argument which was causing the script to fail.

Signed-off-by: Zhani Baramidze <jbaramidze@meta.com>
This commit is contained in:
Zhani Baramidze 2024-06-17 11:45:25 -07:00 committed by Anas Nashif
commit 6ced73e552

View file

@ -82,7 +82,7 @@ def get_die_mapped_address(die, parser, dwarfinfo):
if 'DW_AT_location' in die.attributes:
loc_attr = die.attributes['DW_AT_location']
if parser.attribute_has_location(loc_attr, die.cu['version']):
loc = parser.parse_from_attribute(loc_attr, die.cu['version'])
loc = parser.parse_from_attribute(loc_attr, die.cu['version'], die)
if isinstance(loc, LocationExpr):
addr = describe_DWARF_expr(loc.loc_expr,
dwarfinfo.structs)