elf_mem_map: handle all pointer types correctly

This commit is contained in:
Yuri D'Elia 2021-06-02 20:46:21 +02:00 committed by DRracer
parent c311266a83
commit 1181e78484
1 changed files with 2 additions and 2 deletions

View File

@ -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 \