]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Converted some stab-reading assertions into warnings.
authorNicholas Nethercote <njn@valgrind.org>
Sat, 8 Jun 2002 13:34:17 +0000 (13:34 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sat, 8 Jun 2002 13:34:17 +0000 (13:34 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@399

coregrind/vg_symtab2.c
vg_symtab2.c

index 04d762f226184536beca125881130f8f4f9069df..fb17b04ce52cf421de9c5250e78eba738a14c430 100644 (file)
@@ -285,8 +285,25 @@ void addLineInfo ( SegInfo* si,
        return;
    }
 
-   vg_assert(this < si->start + si->size && next-1 >= si->start);
-   vg_assert(lineno >= 0 && lineno <= MAX_LINENO);
+   //vg_assert(this < si->start + si->size && next-1 >= si->start);
+   if (this >= si->start + si->size || next-1 < si->start) {
+       VG_(message)(Vg_DebugMsg, "warning: ignoring stabs entry falling "
+                                 "outside current SegInfo: %x %x %x %x\n",
+                                 si->start, si->start + si->size, 
+                                 this, next-1);
+       return;
+   }
+
+   vg_assert(lineno >= 0);
+   if (lineno > MAX_LINENO) {
+       VG_(message)(Vg_UserMsg, 
+                    "warning: ignoring stabs entry with "
+                    "huge line number (%d)\n", lineno);
+       VG_(message)(Vg_UserMsg, 
+                    "         Can't handle line numbers "
+                    "greater than %d, sorry\n", MAX_LINENO);
+       return;
+   }
 
    loc.addr      = this;
    loc.size      = (UShort)size;
index 04d762f226184536beca125881130f8f4f9069df..fb17b04ce52cf421de9c5250e78eba738a14c430 100644 (file)
@@ -285,8 +285,25 @@ void addLineInfo ( SegInfo* si,
        return;
    }
 
-   vg_assert(this < si->start + si->size && next-1 >= si->start);
-   vg_assert(lineno >= 0 && lineno <= MAX_LINENO);
+   //vg_assert(this < si->start + si->size && next-1 >= si->start);
+   if (this >= si->start + si->size || next-1 < si->start) {
+       VG_(message)(Vg_DebugMsg, "warning: ignoring stabs entry falling "
+                                 "outside current SegInfo: %x %x %x %x\n",
+                                 si->start, si->start + si->size, 
+                                 this, next-1);
+       return;
+   }
+
+   vg_assert(lineno >= 0);
+   if (lineno > MAX_LINENO) {
+       VG_(message)(Vg_UserMsg, 
+                    "warning: ignoring stabs entry with "
+                    "huge line number (%d)\n", lineno);
+       VG_(message)(Vg_UserMsg, 
+                    "         Can't handle line numbers "
+                    "greater than %d, sorry\n", MAX_LINENO);
+       return;
+   }
 
    loc.addr      = this;
    loc.size      = (UShort)size;