From: Nicholas Nethercote Date: Thu, 25 Aug 2005 00:20:56 +0000 (+0000) Subject: Only show the "line number too large" warning once. X-Git-Tag: svn/VALGRIND_3_1_0~529 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3abe14bc4917a1d88eb8187a5b19f4289b4cb3e7;p=thirdparty%2Fvalgrind.git Only show the "line number too large" warning once. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4511 --- diff --git a/coregrind/m_debuginfo/symtab.c b/coregrind/m_debuginfo/symtab.c index 6024dbb6c3..577c36fb04 100644 --- a/coregrind/m_debuginfo/symtab.c +++ b/coregrind/m_debuginfo/symtab.c @@ -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;