aboutsummaryrefslogtreecommitdiffstats
path: root/source/Target/StopInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Target/StopInfo.cpp')
-rw-r--r--source/Target/StopInfo.cpp117
1 files changed, 55 insertions, 62 deletions
diff --git a/source/Target/StopInfo.cpp b/source/Target/StopInfo.cpp
index 6db0c2b037e9..28179b7e1ce0 100644
--- a/source/Target/StopInfo.cpp
+++ b/source/Target/StopInfo.cpp
@@ -147,10 +147,10 @@ public:
} else {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
- if (log)
- log->Printf(
- "Process::%s could not find breakpoint site id: %" PRId64 "...",
- __FUNCTION__, m_value);
+ LLDB_LOGF(log,
+ "Process::%s could not find breakpoint site id: %" PRId64
+ "...",
+ __FUNCTION__, m_value);
m_should_stop = true;
}
@@ -270,7 +270,7 @@ protected:
if (!thread_sp->IsValid()) {
// This shouldn't ever happen, but just in case, don't do more harm.
if (log) {
- log->Printf("PerformAction got called with an invalid thread.");
+ LLDB_LOGF(log, "PerformAction got called with an invalid thread.");
}
m_should_stop = true;
m_should_stop_is_valid = true;
@@ -339,10 +339,9 @@ protected:
return;
}
- if (log)
- log->Printf("StopInfoBreakpoint::PerformAction - Hit a "
- "breakpoint while running an expression,"
- " not running commands to avoid recursion.");
+ LLDB_LOGF(log, "StopInfoBreakpoint::PerformAction - Hit a "
+ "breakpoint while running an expression,"
+ " not running commands to avoid recursion.");
bool ignoring_breakpoints =
process->GetIgnoreBreakpointsInExpressions();
if (ignoring_breakpoints) {
@@ -359,10 +358,10 @@ protected:
} else {
m_should_stop = true;
}
- if (log)
- log->Printf("StopInfoBreakpoint::PerformAction - in expression, "
- "continuing: %s.",
- m_should_stop ? "true" : "false");
+ LLDB_LOGF(log,
+ "StopInfoBreakpoint::PerformAction - in expression, "
+ "continuing: %s.",
+ m_should_stop ? "true" : "false");
process->GetTarget().GetDebugger().GetAsyncOutputStream()->Printf(
"Warning: hit breakpoint while running function, skipping "
"commands and conditions to prevent recursion.\n");
@@ -402,10 +401,11 @@ protected:
// aren't:
if (!bp_loc_sp->ValidForThisThread(thread_sp.get())) {
if (log) {
- log->Printf("Breakpoint %s hit on thread 0x%llx but it was not "
- "for this thread, continuing.",
- loc_desc.GetData(), static_cast<unsigned long long>(
- thread_sp->GetID()));
+ LLDB_LOGF(log,
+ "Breakpoint %s hit on thread 0x%llx but it was not "
+ "for this thread, continuing.",
+ loc_desc.GetData(),
+ static_cast<unsigned long long>(thread_sp->GetID()));
}
continue;
}
@@ -445,21 +445,18 @@ protected:
error_sp->EOL();
const char *err_str =
condition_error.AsCString("<Unknown Error>");
- if (log)
- log->Printf("Error evaluating condition: \"%s\"\n", err_str);
+ LLDB_LOGF(log, "Error evaluating condition: \"%s\"\n", err_str);
error_sp->PutCString(err_str);
error_sp->EOL();
error_sp->Flush();
} else {
- if (log) {
- log->Printf("Condition evaluated for breakpoint %s on thread "
- "0x%llx conditon_says_stop: %i.",
- loc_desc.GetData(),
- static_cast<unsigned long long>(
- thread_sp->GetID()),
- condition_says_stop);
- }
+ LLDB_LOGF(log,
+ "Condition evaluated for breakpoint %s on thread "
+ "0x%llx conditon_says_stop: %i.",
+ loc_desc.GetData(),
+ static_cast<unsigned long long>(thread_sp->GetID()),
+ condition_says_stop);
if (!condition_says_stop) {
// We don't want to increment the hit count of breakpoints if
// the condition fails. We've already bumped it by the time
@@ -479,9 +476,9 @@ protected:
bool auto_continue_says_stop = true;
if (bp_loc_sp->IsAutoContinue())
{
- if (log)
- log->Printf("Continuing breakpoint %s as AutoContinue was set.",
- loc_desc.GetData());
+ LLDB_LOGF(log,
+ "Continuing breakpoint %s as AutoContinue was set.",
+ loc_desc.GetData());
// We want this stop reported, so you will know we auto-continued
// but only for external breakpoints:
if (!internal_breakpoint)
@@ -533,10 +530,10 @@ protected:
Log *log_process(
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
- if (log_process)
- log_process->Printf(
- "Process::%s could not find breakpoint site id: %" PRId64 "...",
- __FUNCTION__, m_value);
+ LLDB_LOGF(log_process,
+ "Process::%s could not find breakpoint site id: %" PRId64
+ "...",
+ __FUNCTION__, m_value);
}
if ((!m_should_stop || internal_breakpoint) &&
@@ -546,15 +543,15 @@ protected:
// additionally to the breakpoint
m_should_stop = true;
- // Here we clean the preset stop info so the next GetStopInfo call will
- // find the appropriate stop info, which should be the stop info
- // related to the completed plan
- thread_sp->ResetStopInfo();
+ // We know we're stopping for a completed plan and we don't want to
+ // show the breakpoint stop, so compute the public stop info immediately
+ // here.
+ thread_sp->CalculatePublicStopInfo();
}
- if (log)
- log->Printf("Process::%s returning from action with m_should_stop: %d.",
- __FUNCTION__, m_should_stop);
+ LLDB_LOGF(log,
+ "Process::%s returning from action with m_should_stop: %d.",
+ __FUNCTION__, m_should_stop);
}
}
@@ -664,11 +661,10 @@ protected:
} else {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
- if (log)
- log->Printf(
- "Process::%s could not find watchpoint location id: %" PRId64
- "...",
- __FUNCTION__, GetValue());
+ LLDB_LOGF(log,
+ "Process::%s could not find watchpoint location id: %" PRId64
+ "...",
+ __FUNCTION__, GetValue());
m_should_stop = true;
}
@@ -817,15 +813,14 @@ protected:
m_should_stop = false;
} else
m_should_stop = true;
- if (log)
- log->Printf(
- "Condition successfully evaluated, result is %s.\n",
- m_should_stop ? "true" : "false");
+ LLDB_LOGF(log,
+ "Condition successfully evaluated, result is %s.\n",
+ m_should_stop ? "true" : "false");
} else {
m_should_stop = true;
- if (log)
- log->Printf(
- "Failed to get an integer result from the expression.");
+ LLDB_LOGF(
+ log,
+ "Failed to get an integer result from the expression.");
}
}
} else {
@@ -836,8 +831,7 @@ protected:
error_sp->Printf(": \"%s\"", wp_sp->GetConditionText());
error_sp->EOL();
const char *err_str = error.AsCString("<Unknown Error>");
- if (log)
- log->Printf("Error evaluating condition: \"%s\"\n", err_str);
+ LLDB_LOGF(log, "Error evaluating condition: \"%s\"\n", err_str);
error_sp->PutCString(err_str);
error_sp->EOL();
@@ -889,14 +883,13 @@ protected:
Log *log_process(
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
- if (log_process)
- log_process->Printf(
- "Process::%s could not find watchpoint id: %" PRId64 "...",
- __FUNCTION__, m_value);
+ LLDB_LOGF(log_process,
+ "Process::%s could not find watchpoint id: %" PRId64 "...",
+ __FUNCTION__, m_value);
}
- if (log)
- log->Printf("Process::%s returning from action with m_should_stop: %d.",
- __FUNCTION__, m_should_stop);
+ LLDB_LOGF(log,
+ "Process::%s returning from action with m_should_stop: %d.",
+ __FUNCTION__, m_should_stop);
m_should_stop_is_valid = true;
}