diff --git a/main.py b/main.py index 46c7dfb..70b9469 100644 --- a/main.py +++ b/main.py @@ -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():