]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Read dwarf2 line number information even if a .debug_str section was
authorJulian Seward <jseward@acm.org>
Sun, 1 Jan 2006 23:00:49 +0000 (23:00 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 1 Jan 2006 23:00:49 +0000 (23:00 +0000)
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

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

index fcc54937793fa67f1bcef777f53b3f51aeca4015..044d7f746863b01750ea7edaaff6ff4e6cbe8ff5 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 203d8da580e9bec04532a2447d5fe6957673721f..bf7a2ec07df90e64cf4d07dc79c883c0abdfb648 100644 (file)
@@ -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,