From: Gabriel Corona Date: Tue, 4 Mar 2014 09:12:26 +0000 (+0100) Subject: [mc] Add support for inheritance X-Git-Tag: v3_11~199^2~2^2~4 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a4ff507efa9c473f29ade8357ce148274fbd1e97 [mc] Add support for inheritance DW_TAG_inheritance relations are stored with DW_TAG_member and handled by the same logic but are flaged as DW_TAG_inheritance. --- diff --git a/src/mc/mc_dwarf.c b/src/mc/mc_dwarf.c index f646d51bf8..871e55b60c 100644 --- a/src/mc/mc_dwarf.c +++ b/src/mc/mc_dwarf.c @@ -452,7 +452,8 @@ static void MC_dwarf_add_members(mc_object_info_t info, Dwarf_Die* die, Dwarf_Di xbt_assert(!type->members); type->members = xbt_dynar_new(sizeof(dw_type_t), (void(*)(void*))dw_type_free); for (res=dwarf_child(die, &child); res==0; res=dwarf_siblingof(&child,&child)) { - if (dwarf_tag(&child)==DW_TAG_member) { + int tag = dwarf_tag(&child); + if (tag==DW_TAG_member || tag==DW_TAG_inheritance) { // Skip declarations: if (MC_dwarf_attr_flag(&child, DW_AT_declaration, false)) @@ -464,8 +465,10 @@ static void MC_dwarf_add_members(mc_object_info_t info, Dwarf_Die* die, Dwarf_Di // TODO, we should use another type (because is is not a type but a member) dw_type_t member = xbt_new0(s_dw_type_t, 1); - member->type = -1; - member->id = NULL; + member->type = tag; + + // Global Offset: + member->id = (void *) dwarf_dieoffset(&child); const char* name = MC_dwarf_attr_string(&child, DW_AT_name); if(name)