|
From: <sv...@va...> - 2008-06-24 09:51:47
|
Author: sewardj
Date: 2008-06-24 10:51:55 +0100 (Tue, 24 Jun 2008)
New Revision: 8276
Log:
Handle apparently-bogus DW_TAG_compilation_unit DIE that shows up in
gcc-4.3 output. My reading of the DWARF3 standard is that a
DW_TAG_compilation_unit should have either DW_AT_ranges or a
(DW_AT_low_pc, DW_AT_high_pc) pair, but not both. So I think this is
a gcc bug.
Modified:
trunk/coregrind/m_debuginfo/readdwarf3.c
Modified: trunk/coregrind/m_debuginfo/readdwarf3.c
===================================================================
--- trunk/coregrind/m_debuginfo/readdwarf3.c 2008-06-24 09:48:39 UTC (rev 8275)
+++ trunk/coregrind/m_debuginfo/readdwarf3.c 2008-06-24 09:51:55 UTC (rev 8276)
@@ -1496,7 +1496,20 @@
level,
False/*isFunc*/, NULL/*fbGX*/ );
} else
+ if (have_lo && (!have_hi1) && have_range && ip_lo == 0) {
+ /* broken DIE created by gcc-4.3.X ? Ignore the
+ apparently-redundant DW_AT_low_pc and use the DW_AT_ranges
+ instead. */
+ varstack_push( cc, parser, td3,
+ get_range_list( cc, td3,
+ rangeoff, cc->cu_svma ),
+ level,
+ False/*isFunc*/, NULL/*fbGX*/ );
+ } else {
+ if (0) VG_(printf)("I got hlo %d hhi1 %d hrange %d\n",
+ (Int)have_lo, (Int)have_hi1, (Int)have_range);
goto bad_DIE;
+ }
}
if (dtag == DW_TAG_lexical_block || dtag == DW_TAG_subprogram) {
|