Index: lldb/trunk/include/lldb/Core/Log.h =================================================================== --- lldb/trunk/include/lldb/Core/Log.h +++ lldb/trunk/include/lldb/Core/Log.h @@ -29,7 +29,6 @@ //---------------------------------------------------------------------- #define LLDB_LOG_OPTION_THREADSAFE (1u << 0) #define LLDB_LOG_OPTION_VERBOSE (1u << 1) -#define LLDB_LOG_OPTION_DEBUG (1u << 2) #define LLDB_LOG_OPTION_PREPEND_SEQUENCE (1u << 3) #define LLDB_LOG_OPTION_PREPEND_TIMESTAMP (1u << 4) #define LLDB_LOG_OPTION_PREPEND_PROC_AND_THREAD (1u << 5) @@ -122,8 +121,6 @@ void LogIf(uint32_t mask, const char *fmt, ...) __attribute__((format(printf, 3, 4))); - void Debug(const char *fmt, ...) __attribute__((format(printf, 2, 3))); - void Error(const char *fmt, ...) __attribute__((format(printf, 2, 3))); void VAError(const char *format, va_list args); @@ -142,8 +139,6 @@ bool GetVerbose() const; - bool GetDebug() const; - void SetStream(const std::shared_ptr &stream_sp) { m_stream_sp = stream_sp; } Index: lldb/trunk/source/Commands/CommandObjectLog.cpp =================================================================== --- lldb/trunk/source/Commands/CommandObjectLog.cpp +++ lldb/trunk/source/Commands/CommandObjectLog.cpp @@ -41,7 +41,6 @@ { LLDB_OPT_SET_1, false, "file", 'f', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeFilename, "Set the destination file to log to." }, { LLDB_OPT_SET_1, false, "threadsafe", 't', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Enable thread safe logging to avoid interweaved log lines." }, { LLDB_OPT_SET_1, false, "verbose", 'v', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Enable verbose logging." }, - { LLDB_OPT_SET_1, false, "debug", 'g', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Enable debug logging." }, { LLDB_OPT_SET_1, false, "sequence", 's', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Prepend all log lines with an increasing integer sequence id." }, { LLDB_OPT_SET_1, false, "timestamp", 'T', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Prepend all log lines with a timestamp." }, { LLDB_OPT_SET_1, false, "pid-tid", 'p', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Prepend all log lines with the process and thread ID that generates the log line." }, @@ -110,9 +109,6 @@ case 'v': log_options |= LLDB_LOG_OPTION_VERBOSE; break; - case 'g': - log_options |= LLDB_LOG_OPTION_DEBUG; - break; case 's': log_options |= LLDB_LOG_OPTION_PREPEND_SEQUENCE; break; Index: lldb/trunk/source/Core/Log.cpp =================================================================== --- lldb/trunk/source/Core/Log.cpp +++ lldb/trunk/source/Core/Log.cpp @@ -85,20 +85,6 @@ } //---------------------------------------------------------------------- -// Print debug strings if and only if the global debug option is set to -// a non-zero value. -//---------------------------------------------------------------------- -void Log::Debug(const char *format, ...) { - if (!GetOptions().Test(LLDB_LOG_OPTION_DEBUG)) - return; - - va_list args; - va_start(args, format); - VAPrintf(format, args); - va_end(args); -} - -//---------------------------------------------------------------------- // Log only if all of the bits are set //---------------------------------------------------------------------- void Log::LogIf(uint32_t bits, const char *format, ...) { @@ -308,14 +294,6 @@ bool Log::GetVerbose() const { return m_options.Test(LLDB_LOG_OPTION_VERBOSE); } -//------------------------------------------------------------------ -// Returns true if the debug flag bit is set in this stream. -//------------------------------------------------------------------ -bool Log::GetDebug() const { - // TODO: remove and clean up callers - return false; -} - void Log::WriteHeader(llvm::raw_ostream &OS, llvm::StringRef file, llvm::StringRef function) { static uint32_t g_sequence_id = 0; Index: lldb/trunk/source/Core/StringList.cpp =================================================================== --- lldb/trunk/source/Core/StringList.cpp +++ lldb/trunk/source/Core/StringList.cpp @@ -267,5 +267,5 @@ if (name) strm.Printf("End %s.\n", name); - log->Debug("%s", strm.GetData()); + LLDB_LOGV(log, "{0}", strm.GetData()); } Index: lldb/trunk/source/DataFormatters/FormatManager.cpp =================================================================== --- lldb/trunk/source/DataFormatters/FormatManager.cpp +++ lldb/trunk/source/DataFormatters/FormatManager.cpp @@ -660,11 +660,9 @@ if (log) { log->Printf( "[FormatManager::GetFormat] Cache search success. Returning."); - if (log->GetDebug()) - log->Printf("[FormatManager::GetFormat] Cache hits: %" PRIu64 - " - Cache Misses: %" PRIu64, - m_format_cache.GetCacheHits(), - m_format_cache.GetCacheMisses()); + LLDB_LOGV(log, "Cache hits: {0} - Cache Misses: {1}", + m_format_cache.GetCacheHits(), + m_format_cache.GetCacheMisses()); } return retval; } @@ -705,10 +703,8 @@ match_data.GetTypeForCache().AsCString("")); m_format_cache.SetFormat(match_data.GetTypeForCache(), retval); } - if (log && log->GetDebug()) - log->Printf("[FormatManager::GetFormat] Cache hits: %" PRIu64 - " - Cache Misses: %" PRIu64, - m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses()); + LLDB_LOGV(log, "Cache hits: {0} - Cache Misses: {1}", + m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses()); return retval; } @@ -742,11 +738,9 @@ if (log) { log->Printf("[FormatManager::GetSummaryFormat] Cache search success. " "Returning."); - if (log->GetDebug()) - log->Printf("[FormatManager::GetSummaryFormat] Cache hits: %" PRIu64 - " - Cache Misses: %" PRIu64, - m_format_cache.GetCacheHits(), - m_format_cache.GetCacheMisses()); + LLDB_LOGV(log, "Cache hits: {0} - Cache Misses: {1}", + m_format_cache.GetCacheHits(), + m_format_cache.GetCacheMisses()); } return retval; } @@ -787,10 +781,8 @@ match_data.GetTypeForCache().AsCString("")); m_format_cache.SetSummary(match_data.GetTypeForCache(), retval); } - if (log && log->GetDebug()) - log->Printf("[FormatManager::GetSummaryFormat] Cache hits: %" PRIu64 - " - Cache Misses: %" PRIu64, - m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses()); + LLDB_LOGV(log, "Cache hits: {0} - Cache Misses: {1}", + m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses()); return retval; } @@ -825,11 +817,9 @@ if (log) { log->Printf("[FormatManager::GetSyntheticChildren] Cache search " "success. Returning."); - if (log->GetDebug()) - log->Printf( - "[FormatManager::GetSyntheticChildren] Cache hits: %" PRIu64 - " - Cache Misses: %" PRIu64, - m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses()); + LLDB_LOGV(log, "Cache hits: {0} - Cache Misses: {1}", + m_format_cache.GetCacheHits(), + m_format_cache.GetCacheMisses()); } return retval; } @@ -871,10 +861,8 @@ match_data.GetTypeForCache().AsCString("")); m_format_cache.SetSynthetic(match_data.GetTypeForCache(), retval); } - if (log && log->GetDebug()) - log->Printf("[FormatManager::GetSyntheticChildren] Cache hits: %" PRIu64 - " - Cache Misses: %" PRIu64, - m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses()); + LLDB_LOGV(log, "Cache hits: {0} - Cache Misses: {1}", + m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses()); return retval; } #endif @@ -895,11 +883,9 @@ if (log) { log->Printf( "[FormatManager::GetValidator] Cache search success. Returning."); - if (log->GetDebug()) - log->Printf("[FormatManager::GetValidator] Cache hits: %" PRIu64 - " - Cache Misses: %" PRIu64, - m_format_cache.GetCacheHits(), - m_format_cache.GetCacheMisses()); + LLDB_LOGV(log, "Cache hits: {0} - Cache Misses: {1}", + m_format_cache.GetCacheHits(), + m_format_cache.GetCacheMisses()); } return retval; } @@ -940,10 +926,8 @@ match_data.GetTypeForCache().AsCString("")); m_format_cache.SetValidator(match_data.GetTypeForCache(), retval); } - if (log && log->GetDebug()) - log->Printf("[FormatManager::GetValidator] Cache hits: %" PRIu64 - " - Cache Misses: %" PRIu64, - m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses()); + LLDB_LOGV(log, "Cache hits: {0} - Cache Misses: {1}", + m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses()); return retval; } Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp =================================================================== --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp @@ -339,16 +339,16 @@ lang_rt->GetOverrideExprOptions(m_compiler->getTargetOpts()); if (overridden_target_opts) - if (log) { - log->Debug( - "Using overridden target options for the expression evaluation"); + if (log && log->GetVerbose()) { + LLDB_LOGV( + log, "Using overridden target options for the expression evaluation"); auto opts = m_compiler->getTargetOpts(); - log->Debug("Triple: '%s'", opts.Triple.c_str()); - log->Debug("CPU: '%s'", opts.CPU.c_str()); - log->Debug("FPMath: '%s'", opts.FPMath.c_str()); - log->Debug("ABI: '%s'", opts.ABI.c_str()); - log->Debug("LinkerVersion: '%s'", opts.LinkerVersion.c_str()); + LLDB_LOGV(log, "Triple: '{0}'", opts.Triple); + LLDB_LOGV(log, "CPU: '{0}'", opts.CPU); + LLDB_LOGV(log, "FPMath: '{0}'", opts.FPMath); + LLDB_LOGV(log, "ABI: '{0}'", opts.ABI); + LLDB_LOGV(log, "LinkerVersion: '{0}'", opts.LinkerVersion); StringList::LogDump(log, opts.FeaturesAsWritten, "FeaturesAsWritten"); StringList::LogDump(log, opts.Features, "Features"); StringList::LogDump(log, opts.Reciprocals, "Reciprocals"); Index: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -3128,9 +3128,8 @@ // in numeric fields at the moment uint64_t n_lines; if (val.getAsInteger(10, n_lines)) { - if (log) - log->Debug("Failed to parse non-numeric '.rs.info' section %s", - line->str().c_str()); + LLDB_LOGV(log, "Failed to parse non-numeric '.rs.info' section {0}", + line->str()); continue; } if (info_lines.end() - (line + 1) < (ptrdiff_t)n_lines)