From 9df42c68265d1750eecbf386fca1c47d428ac207 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Tue, 15 Mar 2016 16:37:48 -0300 Subject: [PATCH] dwarves: Initial support for rvalue_reference_type Need to read more on http://www.artima.com/cppsource/rvalue.html, but handling it mostly like DW_TAG_typedef so that at least references to it are resolved, we can get its byte size, etc. FIXME: look at the vtable parameters, some are resolving to "(null)". Reported-by: Benjamin Kosnik Reported-by: Mark Wieelard Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=962571 Signed-off-by: Arnaldo Carvalho de Melo --- dwarf_loader.c | 1 + dwarves.c | 1 + dwarves.h | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/dwarf_loader.c b/dwarf_loader.c index 168e03a..677237f 100644 --- a/dwarf_loader.c +++ b/dwarf_loader.c @@ -1583,6 +1583,7 @@ static struct tag *__die__process_tag(Dwarf_Die *die, struct cu *cu, tag = die__create_new_function(die, cu); break; case DW_TAG_subroutine_type: tag = die__create_new_subroutine_type(die, cu); break; + case DW_TAG_rvalue_reference_type: case DW_TAG_typedef: tag = die__create_new_typedef(die, cu); break; case DW_TAG_union_type: diff --git a/dwarves.c b/dwarves.c index e6a2af4..68bfae3 100644 --- a/dwarves.c +++ b/dwarves.c @@ -302,6 +302,7 @@ reevaluate: case DW_TAG_array_type: case DW_TAG_const_type: case DW_TAG_typedef: + case DW_TAG_rvalue_reference_type: case DW_TAG_volatile_type: { struct tag *tag = cu__type(cu, type->type); if (type == NULL) { diff --git a/dwarves.h b/dwarves.h index 26996e2..ee65c49 100644 --- a/dwarves.h +++ b/dwarves.h @@ -359,6 +359,11 @@ static inline int tag__is_typedef(const struct tag *tag) return tag->tag == DW_TAG_typedef; } +static inline int tag__is_rvalue_reference_type(const struct tag *tag) +{ + return tag->tag == DW_TAG_rvalue_reference_type; +} + static inline int tag__is_union(const struct tag *tag) { return tag->tag == DW_TAG_union_type; @@ -396,6 +401,7 @@ static inline int tag__is_type(const struct tag *tag) return tag__is_union(tag) || tag__is_struct(tag) || tag__is_typedef(tag) || + tag__is_rvalue_reference_type(tag) || tag__is_enumeration(tag); } @@ -410,6 +416,7 @@ static inline int tag__is_tag_type(const struct tag *tag) tag->tag == DW_TAG_base_type || tag->tag == DW_TAG_const_type || tag->tag == DW_TAG_pointer_type || + tag->tag == DW_TAG_rvalue_reference_type || tag->tag == DW_TAG_ptr_to_member_type || tag->tag == DW_TAG_reference_type || tag->tag == DW_TAG_subroutine_type ||