From: Gabriel Corona Date: Tue, 25 Feb 2014 10:03:38 +0000 (+0100) Subject: [mc] Skip declaration of data_members (C++) X-Git-Tag: v3_11~199^2~2^2~22^2~5 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/bce40f9889d9056f9b9d8822d71525ad17de648f [mc] Skip declaration of data_members (C++) Skip declaration in in header: struct foo { [...] static int bar } We are interested in (.cpp): int foo:bar = 42; --- diff --git a/src/mc/mc_dwarf.c b/src/mc/mc_dwarf.c index 696f1d04e8..28866c2e97 100644 --- a/src/mc/mc_dwarf.c +++ b/src/mc/mc_dwarf.c @@ -623,6 +623,10 @@ static void MC_dwarf_add_members(mc_object_info_t info, Dwarf_Die* die, Dwarf_Di for (res=dwarf_child(die, &child); res==0; res=dwarf_siblingof(&child,&child)) { if (dwarf_tag(&child)==DW_TAG_member) { + // Skip declarations: + if (MC_dwarf_attr_flag(&child, DW_AT_declaration, false)) + continue; + // Skip compile time constants: if(dwarf_hasattr(&child, DW_AT_const_value)) continue;