Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lldb/include/lldb/Breakpoint/BreakpointSite.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ class BreakpointSite : public std::enable_shared_from_this<BreakpointSite>,
/// would be valid for this thread, false otherwise.
bool ValidForThisThread(Thread &thread);

/// Returns true if at least one constituent is both public and valid for
/// `thread`.
bool ContainsUserBreakpointForThread(Thread &thread);

/// Print a description of this breakpoint site to the stream \a s.
/// GetDescription tells you about the breakpoint site's constituents. Use
/// BreakpointSite::Dump(Stream *) to get information about the breakpoint
Expand Down
16 changes: 16 additions & 0 deletions lldb/source/Breakpoint/BreakpointSite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,22 @@ bool BreakpointSite::ValidForThisThread(Thread &thread) {
return m_constituents.ValidForThisThread(thread);
}

bool BreakpointSite::ContainsUserBreakpointForThread(Thread &thread) {
if (ThreadSP backed_thread = thread.GetBackedThread())
return ContainsUserBreakpointForThread(*backed_thread);

std::lock_guard<std::recursive_mutex> guard(m_constituents_mutex);
for (const BreakpointLocationSP &bp_loc :
m_constituents.BreakpointLocations()) {
const Breakpoint &bp = bp_loc->GetBreakpoint();
if (bp.IsInternal())
continue;
if (bp_loc->ValidForThisThread(thread))
return true;
}
return false;
}

void BreakpointSite::BumpHitCounts() {
std::lock_guard<std::recursive_mutex> guard(m_constituents_mutex);
for (BreakpointLocationSP loc_sp : m_constituents.BreakpointLocations()) {
Expand Down
11 changes: 4 additions & 7 deletions lldb/source/Target/ThreadPlanStepOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,10 @@ bool ThreadPlanStepOut::DoPlanExplainsStop(Event *event_ptr) {
}
}

// If there was only one owner, then we're done. But if we also hit
// some user breakpoint on our way out, we should mark ourselves as
// done, but also not claim to explain the stop, since it is more
// important to report the user breakpoint than the step out
// completion.

if (site_sp->GetNumberOfConstituents() == 1)
// If the thread also hit a user breakpoint on its way out, the plan is
// done but should not claim to explain the stop. It is more important
// to report the user breakpoint than the step out completion.
if (!site_sp->ContainsUserBreakpointForThread(GetThread()))
return true;
}
return false;
Expand Down