Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
extract_structures_json: skip pre-declarations
Browse files Browse the repository at this point in the history
Declarations don't contain any interesting structure, may as well ignore
them.

Skip unknown types (but with warning) instead of crashing.
  • Loading branch information
laanwj committed Nov 7, 2016
1 parent a7efe69 commit 04dd2cd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/extract_structures_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ def process_compile_unit(dwarf, cu, roots):
if die is None or die.offset in visited:
continue
visited.add(die.offset)
if get_flag(die, "declaration"): # only predeclaration, skip
continue

if DEBUG:
print("[%s]" % (type_name(die)))
Expand All @@ -169,8 +171,8 @@ def process_compile_unit(dwarf, cu, roots):
elif die.tag in [DW_TAG.enumeration_type]:
type_info = visit_enumeration_type(die, cu.dies_dict)
else:
print('%s not handled' % DW_TAG[die.tag])
exit(1)
warning('%s not handled' % DW_TAG[die.tag])
type_info = {}

type_info['name'] = type_name(die)
types[type_info['name']] = type_info
Expand Down

0 comments on commit 04dd2cd

Please sign in to comment.