di->loctab_size = new_sz;
}
-#define COMPLAIN_ONCE(what, limit, limit_op) \
+// Complain once, unless VG_(debugLog_getLevel)() > 3
+// showinfo is called if VG_(debugLog_getLevel)() >= 1
+#define COMPLAIN_ONCE(what, limit, limit_op, showinfo) \
{ \
static Bool complained = False; \
if (!complained) { \
- complained = True; \
+ complained = VG_(debugLog_getLevel)() <= 3; \
VG_(message)(Vg_UserMsg, \
"warning: Can't handle " what " with " \
"line number %d " limit_op " than %d\n", \
lineno, limit); \
- VG_(message)(Vg_UserMsg, \
- "(Nb: this message is only shown once)\n"); \
- } \
+ if (VG_(debugLog_getLevel)() >= 1) showinfo; \
+ if (complained) \
+ VG_(message)(Vg_UserMsg, \
+ "(Nb: this message is only shown once)\n"); \
+ } \
}
DiLoc loc;
UWord size = next - this;
+# define SHOWLINEINFO \
+ VG_(message)(Vg_DebugMsg, \
+ "addLoc: addr %#lx, size %lu, line %d, fndn_ix %u\n", \
+ this,size,lineno,fndn_ix)
+
/* Ignore zero-sized locs */
if (this == next) return;
}
if (lineno < 0) {
- COMPLAIN_ONCE("line info entry", 0, "smaller");
+ COMPLAIN_ONCE("line info entry", 0, "smaller", SHOWLINEINFO);
return;
}
if (lineno > MAX_LINENO) {
- COMPLAIN_ONCE("line info entry", MAX_LINENO, "greater");
+ /* With --enable-lto, gcc 9 creates huge line numbers e.g. in the tool
+ => only complain with some debug level. */
+ if (VG_(debugLog_getLevel)() >= 1)
+ COMPLAIN_ONCE("line info entry", MAX_LINENO, "greater", SHOWLINEINFO);
return;
}
loc.size = (UShort)size;
loc.lineno = lineno;
- if (0) VG_(message)(Vg_DebugMsg,
- "addLoc: addr %#lx, size %lu, line %d, fndn_ix %u\n",
- this,size,lineno,fndn_ix);
+ if (0) SHOWLINEINFO;
addLoc ( di, &loc, fndn_ix );
+# undef SHOWLINEINFO
}
/* Add an inlined call info to the inlined call table.
{
DiInlLoc inl;
+# define SHOWLINEINFO \
+ VG_(message) (Vg_DebugMsg, \
+ "addInlInfo: fn %s inlined as addr_lo %#lx,addr_hi %#lx," \
+ "caller fndn_ix %u %s:%d\n", \
+ inlinedfn, addr_lo, addr_hi, fndn_ix, \
+ ML_(fndn_ix2filename) (di, fndn_ix), lineno)
+
/* Similar paranoia as in ML_(addLineInfo). Unclear if needed. */
if (addr_lo >= addr_hi) {
if (VG_(clo_verbosity) > 2) {
VG_(message)(Vg_DebugMsg,
"warning: inlined info addresses out of order "
"at: 0x%lx 0x%lx\n", addr_lo, addr_hi);
+ SHOWLINEINFO;
}
addr_hi = addr_lo + 1;
}
if (lineno < 0) {
- COMPLAIN_ONCE ("inlined call info entry", 0, "smaller");
+ COMPLAIN_ONCE ("inlined call info entry", 0, "smaller", SHOWLINEINFO);
return;
}
if (lineno > MAX_LINENO) {
- COMPLAIN_ONCE ("inlined call info entry", MAX_LINENO, "greater");
+ /* With --enable-lto, gcc 9 creates huge line numbers e.g. in the tool
+ => only complain with some debug level. */
+ if (VG_(debugLog_getLevel)() >= 1)
+ COMPLAIN_ONCE ("inlined call info entry", MAX_LINENO, "greater",
+ SHOWLINEINFO);
return;
}
inl.lineno = lineno;
inl.level = level;
- if (0) VG_(message)
- (Vg_DebugMsg,
- "addInlInfo: fn %s inlined as addr_lo %#lx,addr_hi %#lx,"
- "caller fndn_ix %u %s:%d\n",
- inlinedfn, addr_lo, addr_hi, fndn_ix,
- ML_(fndn_ix2filename) (di, fndn_ix), lineno);
+ if (0) SHOWLINEINFO;
addInl ( di, &inl );
+# undef SHOWLINEINFO
}
DiCfSI_m* ML_(get_cfsi_m) (const DebugInfo* di, UInt pos)