From 63e5fb76ecfed3434252868d8cf07d676f979f2f Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 24 Jul 2019 17:56:10 +0000 Subject: [Logging] Replace Log::Printf with LLDB_LOG macro (NFC) This patch replaces explicit calls to log::Printf with the new LLDB_LOGF macro. The macro is similar to LLDB_LOG but supports printf-style format strings, instead of formatv-style format strings. So instead of writing: if (log) log->Printf("%s\n", str); You'd write: LLDB_LOG(log, "%s\n", str); This change was done mechanically with the command below. I replaced the spurious if-checks with vim, since I know how to do multi-line replacements with it. find . -type f -name '*.cpp' -exec \ sed -i '' -E 's/log->Printf\(/LLDB_LOGF\(log, /g' "{}" + Differential revision: https://reviews.llvm.org/D65128 llvm-svn: 366936 --- lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp') diff --git a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp index 6607bce4488..8a6a58c5545 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp @@ -215,8 +215,7 @@ StructuredData::ObjectSP ThreadGDBRemote::FetchThreadExtendedInfo() { StructuredData::ObjectSP object_sp; const lldb::user_id_t tid = GetProtocolID(); Log *log(GetLogIfAnyCategoriesSet(GDBR_LOG_THREAD)); - if (log) - log->Printf("Fetching extended information for thread %4.4" PRIx64, tid); + LLDB_LOGF(log, "Fetching extended information for thread %4.4" PRIx64, tid); ProcessSP process_sp(GetProcess()); if (process_sp) { ProcessGDBRemote *gdb_process = @@ -230,9 +229,8 @@ void ThreadGDBRemote::WillResume(StateType resume_state) { int signo = GetResumeSignal(); const lldb::user_id_t tid = GetProtocolID(); Log *log(GetLogIfAnyCategoriesSet(GDBR_LOG_THREAD)); - if (log) - log->Printf("Resuming thread: %4.4" PRIx64 " with state: %s.", tid, - StateAsCString(resume_state)); + LLDB_LOGF(log, "Resuming thread: %4.4" PRIx64 " with state: %s.", tid, + StateAsCString(resume_state)); ProcessSP process_sp(GetProcess()); if (process_sp) { -- cgit v1.2.3