]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
backport r5470 from trunk:
authorDirk Mueller <daywalker@users.sourceforge.net>
Mon, 2 Jan 2006 20:41:28 +0000 (20:41 +0000)
committerDirk Mueller <daywalker@users.sourceforge.net>
Mon, 2 Jan 2006 20:41:28 +0000 (20:41 +0000)
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.

git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_1_BRANCH@5479

coregrind/m_debuginfo/dwarf.c
coregrind/m_debuginfo/symtab.c

index 457c86275f87850fed5bacd9b7323e0565c920ab..143d77ff72defa621a07304f346bbbbf5334793e 100644 (file)
@@ -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;
index a92685f2d26ecb9fefe33b1e82d40745817b9f8c..594448c1d72d09698b4dc72fc0c16425f80b7723 100644 (file)
@@ -1727,7 +1727,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,