From bce40f9889d9056f9b9d8822d71525ad17de648f Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Tue, 25 Feb 2014 11:03:38 +0100 Subject: [PATCH] [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; --- src/mc/mc_dwarf.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.20.1