Use DIE.tag if the DW_AT_name does not exist

Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
Juraj Oravec 2024-05-29 00:35:19 +02:00
parent bd7cbef0c0
commit 20c20d87e6
Signed by: SGOrava
GPG Key ID: 13660A3F1D9F093B

11
main.py
View File

@ -58,7 +58,16 @@ def load_children(parent_die):
def safe_DIE_name(die, default=''):
return die.attributes['DW_AT_name'].value.decode('utf-8', errors='ignore') if 'DW_AT_name' in die.attributes else default
name = ''
if 'DW_AT_name' in die.attributes:
name = die.attributes['DW_AT_name'].value.decode('utf-8', errors='ignore')
elif configuration['print_debug_info']:
name = die.tag
else:
name = default
return name
class Bear():