From 1181e784849f9dd594e73fa05aed24927e7ad542 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Wed, 2 Jun 2021 20:46:21 +0200 Subject: [PATCH] elf_mem_map: handle all pointer types correctly --- tools/elf_mem_map | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/elf_mem_map b/tools/elf_mem_map index 6d08abb95..dc985ab0c 100755 --- a/tools/elf_mem_map +++ b/tools/elf_mem_map @@ -75,12 +75,12 @@ def get_elf_globals(path): byte_size = None array_dim = [] while True: - if 'DW_AT_byte_size' in type_DIE.attributes: + if byte_size is None and 'DW_AT_byte_size' in type_DIE.attributes: byte_size = type_DIE.attributes.get('DW_AT_byte_size') if 'DW_AT_type' not in type_DIE.attributes: break type_DIE = type_DIE.get_DIE_from_attribute('DW_AT_type') - if type_DIE.tag == 'DW_TAG_array_type': + if len(array_dim) == 0 and type_DIE.tag == 'DW_TAG_array_type': # fetch array dimensions (if known) for range_DIE in type_DIE.iter_children(): if range_DIE.tag == 'DW_TAG_subrange_type' and \