]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Only show the "line number too large" warning once.
authorNicholas Nethercote <njn@valgrind.org>
Thu, 25 Aug 2005 00:20:56 +0000 (00:20 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Thu, 25 Aug 2005 00:20:56 +0000 (00:20 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4511

coregrind/m_debuginfo/symtab.c

index 6024dbb6c3aa1af235b651e566c5114568be5802..577c36fb04d38ef47874127165e90ce48999695d 100644 (file)
@@ -273,23 +273,29 @@ void ML_(addLineInfo) ( SegInfo* si,
    /* vg_assert(this < si->start + si->size && next-1 >= si->start); */
    if (this >= si->start + si->size || next-1 < si->start) {
        if (0)
-       VG_(message)(Vg_DebugMsg, 
-                    "warning: ignoring line info entry falling "
-                    "outside current SegInfo: %p %p %p %p",
-                    si->start, si->start + si->size, 
-                    this, next-1);
+          VG_(message)(Vg_DebugMsg, 
+                       "warning: ignoring line info entry falling "
+                       "outside current SegInfo: %p %p %p %p",
+                       si->start, si->start + si->size, 
+                       this, next-1);
        return;
    }
 
    vg_assert(lineno >= 0);
    if (lineno > MAX_LINENO) {
-       VG_(message)(Vg_UserMsg, 
-                    "warning: ignoring line info entry with "
-                    "huge line number (%d)", lineno);
-       VG_(message)(Vg_UserMsg, 
-                    "         Can't handle line numbers "
-                    "greater than %d, sorry", MAX_LINENO);
-       return;
+      static Bool complained = False;
+      if (!complained) {
+         complained = True;
+         VG_(message)(Vg_UserMsg, 
+                      "warning: ignoring line info entry with "
+                      "huge line number (%d)", lineno);
+         VG_(message)(Vg_UserMsg, 
+                      "         Can't handle line numbers "
+                      "greater than %d, sorry", MAX_LINENO);
+         VG_(message)(Vg_UserMsg, 
+                      "(Nb: this message is only shown once)");
+      }
+      return;
    }
 
    loc.addr      = this;