Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Skip declaration of data_members (C++)
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 25 Feb 2014 10:03:38 +0000 (11:03 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 25 Feb 2014 10:03:38 +0000 (11:03 +0100)
Skip declaration in in header:

    struct foo {
     [...]
     static int bar
    }

We are interested in (.cpp):

   int foo:bar = 42;

src/mc/mc_dwarf.c

index 696f1d0..28866c2 100644 (file)
@@ -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;