Skip to content

Commit

Permalink
update facts for cpp
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Mar 28, 2021
1 parent 55ba04c commit 134e6d9
Show file tree
Hide file tree
Showing 2 changed files with 22,680 additions and 4,358 deletions.
20 changes: 14 additions & 6 deletions abi-python/python/asp.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,19 +847,27 @@ def _parse_die_type(self, corpus, die, tag, lookup_die=None):

else:
type_size = type_die.attributes["DW_AT_byte_size"].value * 8
type_name = bytes2str(type_die.attributes["DW_AT_name"].value)
self.gen.fact(
AspFunction(
tag + "_size_in_bits",
args=[corpus.path, die.unique_id, type_size],
)
)
self.gen.fact(
AspFunction(
tag + "_type_name",
args=[corpus.path, die.unique_id, type_name],
type_name = None
if "DW_AT_linkage_name" in type_die.attributes:
type_name = bytes2str(
type_die.attributes["DW_AT_linkage_name"].value
)
elif "DW_AT_name" in type_die.attributes:
type_name = bytes2str(type_die.attributes["DW_AT_name"].value)

if type_name:
self.gen.fact(
AspFunction(
tag + "_type_name",
args=[corpus.path, die.unique_id, type_name],
)
)
)

def _parse_compile_unit(self, corpus, die, tag):
"""
Expand Down

0 comments on commit 134e6d9

Please sign in to comment.