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/ThreadPlanStepInRange.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/ThreadPlanStepInRange.cpp')
-rw-r--r-- | lldb/source/Target/ThreadPlanStepInRange.cpp | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/lldb/source/Target/ThreadPlanStepInRange.cpp b/lldb/source/Target/ThreadPlanStepInRange.cpp index 2065fa55fa6..ff6553e4557 100644 --- a/lldb/source/Target/ThreadPlanStepInRange.cpp +++ b/lldb/source/Target/ThreadPlanStepInRange.cpp @@ -148,7 +148,7 @@ bool ThreadPlanStepInRange::ShouldStop(Event *event_ptr) { s.Address( m_thread.GetRegisterContext()->GetPC(), m_thread.CalculateTarget()->GetArchitecture().GetAddressByteSize()); - log->Printf("ThreadPlanStepInRange reached %s.", s.GetData()); + LLDB_LOGF(log, "ThreadPlanStepInRange reached %s.", s.GetData()); } if (IsPlanComplete()) @@ -197,13 +197,14 @@ bool ThreadPlanStepInRange::ShouldStop(Event *event_ptr) { CheckShouldStopHereAndQueueStepOut(frame_order, m_status); if (log) { if (m_sub_plan_sp) - log->Printf("ShouldStopHere found plan to step out of this frame."); + LLDB_LOGF(log, + "ShouldStopHere found plan to step out of this frame."); else - log->Printf("ShouldStopHere no plan to step out of this frame."); + LLDB_LOGF(log, "ShouldStopHere no plan to step out of this frame."); } } else if (log) { - log->Printf( - "Thought I stepped out, but in fact arrived at a trampoline."); + LLDB_LOGF( + log, "Thought I stepped out, but in fact arrived at a trampoline."); } } else if (frame_order == eFrameCompareEqual && InSymbol()) { // If we are not in a place we should step through, we're done. One @@ -237,9 +238,10 @@ bool ThreadPlanStepInRange::ShouldStop(Event *event_ptr) { if (log) { if (m_sub_plan_sp) - log->Printf("Found a step through plan: %s", m_sub_plan_sp->GetName()); + LLDB_LOGF(log, "Found a step through plan: %s", + m_sub_plan_sp->GetName()); else - log->Printf("No step through plan found."); + LLDB_LOGF(log, "No step through plan found."); } // If not, give the "should_stop" callback a chance to push a plan to get @@ -289,8 +291,7 @@ bool ThreadPlanStepInRange::ShouldStop(Event *event_ptr) { if (bytes_to_skip != 0) { func_start_address.Slide(bytes_to_skip); log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP); - if (log) - log->Printf("Pushing past prologue "); + LLDB_LOGF(log, "Pushing past prologue "); m_sub_plan_sp = m_thread.QueueThreadPlanForRunToAddress( false, func_start_address, true, m_status); @@ -373,11 +374,12 @@ bool ThreadPlanStepInRange::FrameMatchesAvoidCriteria() { if (log) { std::string match; regex_match.GetMatchAtIndex(frame_function_name, 0, match); - log->Printf("Stepping out of function \"%s\" because it matches " - "the avoid regexp \"%s\" - match substring: \"%s\".", - frame_function_name, - avoid_regexp_to_use->GetText().str().c_str(), - match.c_str()); + LLDB_LOGF(log, + "Stepping out of function \"%s\" because it matches " + "the avoid regexp \"%s\" - match substring: \"%s\".", + frame_function_name, + avoid_regexp_to_use->GetText().str().c_str(), + match.c_str()); } } return return_value; @@ -424,10 +426,11 @@ bool ThreadPlanStepInRange::DefaultShouldStopHereCallback( should_stop_here = false; } if (log && !should_stop_here) - log->Printf("Stepping out of frame %s which did not match step into " - "target %s.", - sc.GetFunctionName().AsCString(), - step_in_range_plan->m_step_into_target.AsCString()); + LLDB_LOGF(log, + "Stepping out of frame %s which did not match step into " + "target %s.", + sc.GetFunctionName().AsCString(), + step_in_range_plan->m_step_into_target.AsCString()); } } @@ -496,10 +499,10 @@ bool ThreadPlanStepInRange::DoWillResume(lldb::StateType resume_state, bool step_without_resume = m_thread.DecrementCurrentInlinedDepth(); if (step_without_resume) { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP)); - if (log) - log->Printf("ThreadPlanStepInRange::DoWillResume: returning false, " - "inline_depth: %d", - m_thread.GetCurrentInlinedDepth()); + LLDB_LOGF(log, + "ThreadPlanStepInRange::DoWillResume: returning false, " + "inline_depth: %d", + m_thread.GetCurrentInlinedDepth()); SetStopInfo(StopInfo::CreateStopReasonToTrace(m_thread)); // FIXME: Maybe it would be better to create a InlineStep stop reason, but |