Internals: Show only first warning suppression for low debug levels.

This commit is contained in:
Wilson Snyder 2025-09-16 08:44:14 -04:00
parent f39d6e6108
commit 4d1eea35e1
2 changed files with 9 additions and 4 deletions

View File

@ -74,7 +74,7 @@ string V3ErrorGuarded::msgPrefix() VL_REQUIRES(m_mutex) {
const V3ErrorCode code = m_message.code();
const bool supp = m_errorSuppressed;
if (supp) {
return "-arning-suppressed: ";
return "-arning-suppressed-" + std::string{code.ascii()} + ": ";
} else if (code.severityInfo()) {
return "-Info: ";
} else if (code == V3ErrorCode::EC_FATAL) {
@ -163,10 +163,13 @@ void V3ErrorGuarded::v3errorEndGuts(const std::ostringstream& sstr, const string
m_message.fileline(fileline);
// Skip suppressed messages
if (m_errorSuppressed
if (m_errorSuppressed) {
// On debug, show only non default-off warning to prevent pages of warnings
&& (!debug() || debug() < 3 || m_message.code().defaultsOff()))
return;
if (m_message.code().defaultsOff()) return;
if (!debug() || debug() < 3 || (debug() < 9 && m_showedSuppressed[m_message.code()]))
return;
m_showedSuppressed[m_message.code()] = true;
}
string msg
= V3Error::warnContextBegin() + msgPrefix() + V3Error::warnContextEnd() + sstr.str();

View File

@ -387,6 +387,8 @@ private:
std::array<bool, V3ErrorCode::_ENUM_MAX> m_pretendError VL_GUARDED_BY(m_mutex);
// Told user specifics about this warning
std::array<bool, V3ErrorCode::_ENUM_MAX> m_describedEachWarn VL_GUARDED_BY(m_mutex);
// Debug about suppressed this warning
std::array<bool, V3ErrorCode::_ENUM_MAX> m_showedSuppressed VL_GUARDED_BY(m_mutex);
int m_debugDefault = 0; // Option: --debugi Default debugging level
int m_errorLimit VL_GUARDED_BY(m_mutex)
= MAX_ERRORS; // Option: --error-limit Number of errors before exit