From: Julian Seward Date: Sun, 1 Jan 2006 23:00:49 +0000 (+0000) Subject: Read dwarf2 line number information even if a .debug_str section was X-Git-Tag: svn/VALGRIND_3_2_0~425 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80e79b5bc52d89719e7ef832736d8dbf052561aa;p=thirdparty%2Fvalgrind.git 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. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5470 --- diff --git a/coregrind/m_debuginfo/dwarf.c b/coregrind/m_debuginfo/dwarf.c index fcc5493779..044d7f7468 100644 --- a/coregrind/m_debuginfo/dwarf.c +++ b/coregrind/m_debuginfo/dwarf.c @@ -847,9 +847,14 @@ void read_unitinfo_dwarf2( /*OUT*/UnitInfo* ui, /* Those cases extract the data properly */ case 0x05: /* FORM_data2 */ cval = *((UShort*)p); p +=2; break; case 0x06: /* FORM_data4 */ cval = *((UInt*)p);p +=4; break; - case 0x0e: /* FORM_strp */ sval = debugstr + *((UInt*)p); - p += 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 = debugstr + *((UInt*)p); + p += 4; + break; case 0x08: /* FORM_string */ sval = (Char*)p; p += VG_(strlen)((Char*)p) + 1; break; case 0x0b: /* FORM_data1 */ cval = *p; p++; break; diff --git a/coregrind/m_debuginfo/symtab.c b/coregrind/m_debuginfo/symtab.c index 203d8da580..bf7a2ec07d 100644 --- a/coregrind/m_debuginfo/symtab.c +++ b/coregrind/m_debuginfo/symtab.c @@ -1743,7 +1743,12 @@ Bool read_lib_symbols ( SegInfo* si ) 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, debug_info, debug_info_sz, debug_abbv,