From 4040072a3aa76be5aaed35455c8cf9c893619db5 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Wed, 20 Aug 2008 08:14:07 +0000 Subject: [PATCH] Make the absolute bare minimum changes needed to stop the Dwarf3 variable & type reader dying on gcc-4.3.x produced Dwarf3. This is done by handling DW_TAG_class_type and treating it the same as DW_TAG_structure_type. I don't know if this is really correct or not. This reader is still grossly inefficient in terms of space use, and could be majorly improved, by storing information in arrays rather than in linked lists with (sometimes) more than 5 million elements. But this will have to wait. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8534 --- coregrind/m_debuginfo/readdwarf3.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c index c6a8797775..ec33bde821 100644 --- a/coregrind/m_debuginfo/readdwarf3.c +++ b/coregrind/m_debuginfo/readdwarf3.c @@ -2195,7 +2195,11 @@ static void parse_type_DIE ( /*OUT*/TyAdmin** admin, goto acquire_Atom; } - if (dtag == DW_TAG_structure_type || dtag == DW_TAG_union_type) { + /* Treat DW_TAG_class_type as if it was a DW_TAG_structure_type. I + don't know if this is correct, but it at least makes this reader + usable for gcc-4.3 produced Dwarf3. */ + if (dtag == DW_TAG_structure_type || dtag == DW_TAG_class_type + || dtag == DW_TAG_union_type) { Bool have_szB = False; Bool is_decl = False; Bool is_spec = False; @@ -2207,7 +2211,8 @@ static void parse_type_DIE ( /*OUT*/TyAdmin** admin, = VG_(newXA)( ML_(dinfo_zalloc), ML_(dinfo_free), sizeof(TyAtom*) ); type->Ty.StOrUn.complete = True; - type->Ty.StOrUn.isStruct = dtag == DW_TAG_structure_type; + type->Ty.StOrUn.isStruct = dtag == DW_TAG_structure_type + || dtag == DW_TAG_class_type; while (True) { DW_AT attr = (DW_AT) get_ULEB128( c_abbv ); DW_FORM form = (DW_FORM)get_ULEB128( c_abbv ); -- 2.47.2