|
From: <sv...@va...> - 2006-01-02 20:41:32
|
Author: dirk
Date: 2006-01-02 20:41:28 +0000 (Mon, 02 Jan 2006)
New Revision: 5479
Log:
backport r5470 from trunk:
r5470 | sewardj | 2006-01-02 00:00:49 +0100 (Mon, 02 Jan 2006) | 5 lines
Read dwarf2 line number information even if a .debug_str section was
not found. This is believed to fix the regression in 3.1.X wherein
debug info was sometimes not read from icc-8.1 generated executables.
Modified:
branches/VALGRIND_3_1_BRANCH/coregrind/m_debuginfo/dwarf.c
branches/VALGRIND_3_1_BRANCH/coregrind/m_debuginfo/symtab.c
Modified: branches/VALGRIND_3_1_BRANCH/coregrind/m_debuginfo/dwarf.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_1_BRANCH/coregrind/m_debuginfo/dwarf.c 2006-01-02=
19:34:53 UTC (rev 5478)
+++ branches/VALGRIND_3_1_BRANCH/coregrind/m_debuginfo/dwarf.c 2006-01-02=
20:41:28 UTC (rev 5479)
@@ -847,9 +847,14 @@
/* Those cases extract the data properly */
case 0x05: /* FORM_data2 */ cval =3D *((UShort*)p); p +=3D=
2; break;
case 0x06: /* FORM_data4 */ cval =3D *((UInt*)p);p +=3D4=
; break;
- case 0x0e: /* FORM_strp */ sval =3D debugstr + *((UInt*=
)p);=20
- p +=3D 4; break;
- /* pointer in .debug_str */
+ case 0x0e: /* FORM_strp */ /* pointer in .debug_str */
+ /* 2006-01-01: only generate a value if
+ debugstr is non-NULL (which means that a
+ debug_str section was found) */
+ if (debugstr)
+ sval =3D debugstr + *((UI=
nt*)p);=20
+ p +=3D 4;=20
+ break;
case 0x08: /* FORM_string */ sval =3D (Char*)p;=20
p +=3D VG_(strlen)((Char*)p)=
+ 1; break;
case 0x0b: /* FORM_data1 */ cval =3D *p; p++; break;
Modified: branches/VALGRIND_3_1_BRANCH/coregrind/m_debuginfo/symtab.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_1_BRANCH/coregrind/m_debuginfo/symtab.c 2006-01-0=
2 19:34:53 UTC (rev 5478)
+++ branches/VALGRIND_3_1_BRANCH/coregrind/m_debuginfo/symtab.c 2006-01-0=
2 20:41:28 UTC (rev 5479)
@@ -1727,7 +1727,12 @@
stabstr, stabstr_sz );
}
# endif
- if (debug_info && debug_abbv && debug_line && debug_str) {
+ /* jrs 2006-01-01: icc-8.1 has been observed to generate
+ binaries without debug_str sections. Don't preclude
+ debuginfo reading for that reason, but, in
+ read_unitinfo_dwarf2, do check that debugstr is non-NULL
+ before using it. */
+ if (debug_info && debug_abbv && debug_line /* && debug_str */) {
ML_(read_debuginfo_dwarf2) ( si,=20
debug_info, debug_info_sz,
debug_abbv,
|