#if !defined(MOZ_ZUCCHINI) void DumpWithoutCrashing(LogMessage* log_message, const base::Location& location) { // Copy the LogMessage message to stack memory to make sure it can be // recovered in crash dumps. This is easier to recover in minidumps than crash // keys during local debugging.
DEBUG_ALIAS_FOR_CSTR(log_message_str, log_message->BuildCrashString().c_str(), 1024);
// Report from the same location at most once every 30 days (unless the // process has died). This attempts to prevent us from flooding ourselves with // repeat reports for the same bug.
base::debug::DumpWithoutCrashing(location, base::Days(30));
} #endif// !defined(MOZ_ZUCCHINI)
CheckError::~CheckError() { // TODO(crbug.com/1409729): Consider splitting out CHECK from DCHECK so that // the destructor can be marked [[noreturn]] and we don't need to check // severity in the destructor. constbool is_fatal = log_message_->severity() == LOGGING_FATAL; // Note: This function ends up in crash stack traces. If its full name // changes, the crash server's magic signature logic needs to be updated. // See cl/306632920. delete log_message_;
// Make sure we crash even if LOG(FATAL) has been overridden. // TODO(crbug.com/1409729): Remove severity checking in the destructor when // LOG(FATAL) is [[noreturn]] and can't be overridden. if (is_fatal) {
base::ImmediateCrash();
}
}
NotReachedError NotReachedError::NotReached(const base::Location& location) { const LogSeverity severity = []() { // NOTREACHED() instances may be hit before base::FeatureList is enabled. #if !defined(MOZ_ZUCCHINI) if (base::FeatureList::GetInstance() &&
base::FeatureList::IsEnabled(base::features::kNotReachedIsFatal)) { return LOGGING_FATAL;
} #endif// !defined(MOZ_ZUCCHINI) return DCHECK_IS_ON() ? LOGGING_DCHECK : LOGGING_ERROR;
}(); auto* const log_message = new NotReachedLogMessage(location, severity);
// TODO(pbos): Consider a better message for NotReached(), this is here to // match existing behavior + test expectations.
log_message->stream() << "Check failed: false. "; return NotReachedError(log_message);
}
void NotReachedError::TriggerNotReached() { // This triggers a NOTREACHED() error as the returned NotReachedError goes out // of scope.
NotReached()
<< "NOTREACHED log messages are omitted in official builds. Sorry!";
}
// Note: This function ends up in crash stack traces. If its full name changes, // the crash server's magic signature logic needs to be updated. See // cl/306632920.
NotReachedNoreturnError::~NotReachedNoreturnError() { delete log_message_;
// Make sure we die if we haven't. // TODO(crbug.com/1409729): Replace this with NOTREACHED_NORETURN() once // LOG(FATAL) is [[noreturn]].
base::ImmediateCrash();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.