Author: sewardj Date: 2008-02-26 12:53:06 +0000 (Tue, 26 Feb 2008) New Revision: 7473
Log: Handle a couple more missing cases. Modified: branches/DATASYMS/coregrind/m_debuginfo/readdwarf3.c branches/DATASYMS/coregrind/m_debuginfo/tytypes.c Modified: branches/DATASYMS/coregrind/m_debuginfo/readdwarf3.c =================================================================== --- branches/DATASYMS/coregrind/m_debuginfo/readdwarf3.c 2008-02-26 12:52:00 UTC (rev 7472) +++ branches/DATASYMS/coregrind/m_debuginfo/readdwarf3.c 2008-02-26 12:53:06 UTC (rev 7473) @@ -8,7 +8,7 @@ This file is part of Valgrind, a dynamic binary instrumentation framework. - Copyright (C) 2008-2008 OpenWorks LLP and others + Copyright (C) 2008-2008 OpenWorks LLP [EMAIL PROTECTED] This program is free software; you can redistribute it and/or @@ -1260,7 +1260,7 @@ vg_assert( VG_(sizeXA)( parser->filenameTable ) == 0 ); /* Add a dummy index-zero entry. DWARF3 numbers its files from 1, for some reason. */ - str = ML_(addStr)( cc->di, "<unknown>", -1 ); + str = ML_(addStr)( cc->di, "<unknown_file>", -1 ); VG_(addToXA)( parser->filenameTable, &str ); while (peek_UChar(&c) != 0) { str = get_AsciiZ(&c); @@ -1921,6 +1921,13 @@ } } } + + /* Invent a name if it doesn't have one. gcc-4.3 + -ftree-vectorize is observed to emit nameless base types. */ + if (!type->Ty.Base.name) + type->Ty.Base.name + = ML_(addStr)( cc->di, "<anon_base_type>", -1 ); + /* Do we have something that looks sane? */ if (/* must have a name */ type->Ty.Base.name == NULL @@ -1948,12 +1955,17 @@ goto acquire_Type; } - if (dtag == DW_TAG_pointer_type || dtag == DW_TAG_reference_type) { + if (dtag == DW_TAG_pointer_type || dtag == DW_TAG_reference_type + || dtag == DW_TAG_ptr_to_member_type) { + /* This seems legit for _pointer_type and _reference_type. I + don't know if rolling _ptr_to_member_type in here really is + legit, but it's better than not handling it at all. */ type = ML_(new_Type)(); type->tag = Ty_PorR; /* target type defaults to void */ type->Ty.PorR.typeR = D3_FAKEVOID_CUOFF; - type->Ty.PorR.isPtr = dtag == DW_TAG_pointer_type; + type->Ty.PorR.isPtr = dtag == DW_TAG_pointer_type + || dtag == DW_TAG_ptr_to_member_type; /* Pointer types don't *have* to specify their size, in which case we assume it's a machine word. But if they do specify it, it must be a machine word :-) This probably assumes that @@ -3105,7 +3117,7 @@ VG_(printf)("<%lx> addVar: level %d: %s :: ", varp->dioff, varp->level, - varp->name ? varp->name : (UChar*)"<anonymous>" ); + varp->name ? varp->name : (UChar*)"<anon_var>" ); if (varp->typeR) { ML_(pp_Type_C_ishly)( varp->typeR ); } else { @@ -3178,7 +3190,7 @@ /* Give it a name if it doesn't have one. */ if (!varp->name) - varp->name = ML_(addStr)( di, "<anonymous>", -1 ); + varp->name = ML_(addStr)( di, "<anon_var>", -1 ); /* So now does it have enough info to be useful? */ /* NOTE: re typeR: this is a hack. If typeR is NULL then the Modified: branches/DATASYMS/coregrind/m_debuginfo/tytypes.c =================================================================== --- branches/DATASYMS/coregrind/m_debuginfo/tytypes.c 2008-02-26 12:52:00 UTC (rev 7472) +++ branches/DATASYMS/coregrind/m_debuginfo/tytypes.c 2008-02-26 12:53:06 UTC (rev 7473) @@ -208,6 +208,10 @@ void ML_(pp_Type) ( Type* ty ) { + if (!ty) { + VG_(printf)("**type=NULL**"); + return; + } switch (ty->tag) { case Ty_Base: VG_(printf)("Ty_Base(%d,%c,\"%s\")", @@ -292,6 +296,10 @@ been converted into pointers) */ void ML_(pp_Type_C_ishly) ( Type* ty ) { + if (!ty) { + VG_(printf)("**type=NULL**"); + return; + } switch (ty->tag) { case Ty_Base: if (!ty->Ty.Base.name) goto unhandled; @@ -377,6 +385,7 @@ { Word i; MaybeUWord eszB; + vg_assert(ty); switch (ty->tag) { case Ty_Base: vg_assert(ty->Ty.Base.szB > 0); ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers