diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-07-24 17:56:10 +0000 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-07-24 17:56:10 +0000 |
| commit | 63e5fb76ecfed3434252868d8cf07d676f979f2f (patch) | |
| tree | 349d6bd303f53aa57b988dee284c7f264404a8fc /lldb/source/Target/ThreadPlanStepInstruction.cpp | |
| parent | 2bf871be4c35d70db080dde789cf9bb334c04057 (diff) | |
| download | bcm5719-llvm-63e5fb76ecfed3434252868d8cf07d676f979f2f.tar.gz bcm5719-llvm-63e5fb76ecfed3434252868d8cf07d676f979f2f.zip | |
[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
Diffstat (limited to 'lldb/source/Target/ThreadPlanStepInstruction.cpp')
| -rw-r--r-- | lldb/source/Target/ThreadPlanStepInstruction.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lldb/source/Target/ThreadPlanStepInstruction.cpp b/lldb/source/Target/ThreadPlanStepInstruction.cpp index a11b623c8ac..0c75cb81115 100644 --- a/lldb/source/Target/ThreadPlanStepInstruction.cpp +++ b/lldb/source/Target/ThreadPlanStepInstruction.cpp @@ -114,8 +114,9 @@ bool ThreadPlanStepInstruction::IsPlanStale() { return !m_step_over; } else { if (log) { - log->Printf("ThreadPlanStepInstruction::IsPlanStale - Current frame is " - "older than start frame, plan is stale."); + LLDB_LOGF(log, + "ThreadPlanStepInstruction::IsPlanStale - Current frame is " + "older than start frame, plan is stale."); } return true; } @@ -127,9 +128,9 @@ bool ThreadPlanStepInstruction::ShouldStop(Event *event_ptr) { StackFrameSP cur_frame_sp = m_thread.GetStackFrameAtIndex(0); if (!cur_frame_sp) { - if (log) - log->Printf( - "ThreadPlanStepInstruction couldn't get the 0th frame, stopping."); + LLDB_LOGF( + log, + "ThreadPlanStepInstruction couldn't get the 0th frame, stopping."); SetPlanComplete(); return true; } @@ -168,8 +169,9 @@ bool ThreadPlanStepInstruction::ShouldStop(Event *event_ptr) { cur_frame_sp->GetConcreteFrameIndex()) { SetPlanComplete(); if (log) { - log->Printf("Frame we stepped into is inlined into the frame " - "we were stepping from, stopping."); + LLDB_LOGF(log, + "Frame we stepped into is inlined into the frame " + "we were stepping from, stopping."); } return true; } @@ -188,7 +190,7 @@ bool ThreadPlanStepInstruction::ShouldStop(Event *event_ptr) { s.Address(return_addr, m_thread.CalculateTarget() ->GetArchitecture() .GetAddressByteSize()); - log->Printf("%s.", s.GetData()); + LLDB_LOGF(log, "%s.", s.GetData()); } // StepInstruction should probably have the tri-state RunMode, but @@ -209,8 +211,7 @@ bool ThreadPlanStepInstruction::ShouldStop(Event *event_ptr) { return true; } } else { - if (log) - log->Printf("Could not find previous frame, stopping."); + LLDB_LOGF(log, "Could not find previous frame, stopping."); SetPlanComplete(); return true; } @@ -243,8 +244,7 @@ bool ThreadPlanStepInstruction::WillStop() { return true; } bool ThreadPlanStepInstruction::MischiefManaged() { if (IsPlanComplete()) { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP)); - if (log) - log->Printf("Completed single instruction step plan."); + LLDB_LOGF(log, "Completed single instruction step plan."); ThreadPlan::MischiefManaged(); return true; } else { |

