diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index 39468e93f..a0d4d0f53 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -132,8 +132,8 @@ bool CmdLineParser::parseFromArgs(int argc, const char* const argv[]) } // Flag used for various purposes during debugging - else if (std::strcmp(argv[i], "--debug") == 0) - _settings->debug = _settings->debugwarnings = true; + else if (std::strcmp(argv[i], "--debug-simplified") == 0) + _settings->debugSimplified = true; // Show --debug output after the first simplifications else if (std::strcmp(argv[i], "--debug-normal") == 0) diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index 891926e29..dc136b8c3 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -2066,7 +2066,7 @@ void CheckMemoryLeakInFunction::checkScope(const Token *startTok, const std::str simplifycode(tok); - if (mSettings->debug && mSettings->verbose) { + if (mSettings->debugwarnings) { tok->printOut(("Checkmemoryleak: simplifycode result for: " + varname).c_str()); } diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 658278b6a..900fc08e3 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -393,7 +393,7 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string if (mSettings.force || mSettings.maxConfigs > 1) { const unsigned long long checksum = mTokenizer.list.calculateChecksum(); if (checksums.find(checksum) != checksums.end()) { - if (mSettings.isEnabled(Settings::INFORMATION) && (mSettings.debug || mSettings.verbose)) + if (mSettings.debugwarnings) purgedConfigurationMessage(filename, mCurrentConfig); continue; } diff --git a/lib/settings.cpp b/lib/settings.cpp index 2930fcfc2..9ed72d77f 100644 --- a/lib/settings.cpp +++ b/lib/settings.cpp @@ -24,7 +24,7 @@ bool Settings::mTerminated; Settings::Settings() : mEnabled(0), - debug(false), + debugSimplified(false), debugnormal(false), debugwarnings(false), dump(false), diff --git a/lib/settings.h b/lib/settings.h index 7406ea9ee..87bf1c598 100644 --- a/lib/settings.h +++ b/lib/settings.h @@ -73,8 +73,8 @@ public: /** @brief --cppcheck-build-dir */ std::string buildDir; - /** @brief Is --debug given? */ - bool debug; + /** @brief Is --debug-simplified given? */ + bool debugSimplified; /** @brief Is --debug-normal given? */ bool debugnormal; diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index e4a0ab2da..4e69ecbe8 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -4038,7 +4038,7 @@ bool Tokenizer::simplifyTokenList2() void Tokenizer::printDebugOutput(unsigned int simplification) const { - const bool debug = (simplification != 1U && mSettings->debug) || + const bool debug = (simplification != 1U && mSettings->debugSimplified) || (simplification != 2U && mSettings->debugnormal); if (debug && list.front()) {