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 <bkoz@redhat.com>
Reported-by: Mark Wieelard <mjw@redhat.com>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=962571
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2016-03-15 16:37:48 -03:00
parent 8af5ccd86d
commit 9df42c6826
3 changed files with 9 additions and 0 deletions

View File

@ -1583,6 +1583,7 @@ static struct tag *__die__process_tag(Dwarf_Die *die, struct cu *cu,
tag = die__create_new_function(die, cu); break; tag = die__create_new_function(die, cu); break;
case DW_TAG_subroutine_type: case DW_TAG_subroutine_type:
tag = die__create_new_subroutine_type(die, cu); break; tag = die__create_new_subroutine_type(die, cu); break;
case DW_TAG_rvalue_reference_type:
case DW_TAG_typedef: case DW_TAG_typedef:
tag = die__create_new_typedef(die, cu); break; tag = die__create_new_typedef(die, cu); break;
case DW_TAG_union_type: case DW_TAG_union_type:

View File

@ -302,6 +302,7 @@ reevaluate:
case DW_TAG_array_type: case DW_TAG_array_type:
case DW_TAG_const_type: case DW_TAG_const_type:
case DW_TAG_typedef: case DW_TAG_typedef:
case DW_TAG_rvalue_reference_type:
case DW_TAG_volatile_type: { case DW_TAG_volatile_type: {
struct tag *tag = cu__type(cu, type->type); struct tag *tag = cu__type(cu, type->type);
if (type == NULL) { if (type == NULL) {

View File

@ -359,6 +359,11 @@ static inline int tag__is_typedef(const struct tag *tag)
return tag->tag == DW_TAG_typedef; 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) static inline int tag__is_union(const struct tag *tag)
{ {
return tag->tag == DW_TAG_union_type; 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) || return tag__is_union(tag) ||
tag__is_struct(tag) || tag__is_struct(tag) ||
tag__is_typedef(tag) || tag__is_typedef(tag) ||
tag__is_rvalue_reference_type(tag) ||
tag__is_enumeration(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_base_type ||
tag->tag == DW_TAG_const_type || tag->tag == DW_TAG_const_type ||
tag->tag == DW_TAG_pointer_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_ptr_to_member_type ||
tag->tag == DW_TAG_reference_type || tag->tag == DW_TAG_reference_type ||
tag->tag == DW_TAG_subroutine_type || tag->tag == DW_TAG_subroutine_type ||