Skip to content

Commit

Permalink
[lldb] Avoid Function::GetAddressRange in ThreadPlanStepRange::InSymb…
Browse files Browse the repository at this point in the history
…ol (#128515)

The existing implementation would probably produce false positives for
discontinuous functions. I haven't tried reproducing it because setting
up discontinuous functions (and executing them, in particular) is pretty
complex and there's nothing particularly interesting happening here.
  • Loading branch information
labath authored Feb 25, 2025
1 parent 3083aea commit 5088e1b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lldb/source/Target/ThreadPlanStepRange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,11 @@ bool ThreadPlanStepRange::InRange() {
bool ThreadPlanStepRange::InSymbol() {
lldb::addr_t cur_pc = GetThread().GetRegisterContext()->GetPC();
if (m_addr_context.function != nullptr) {
return m_addr_context.function->GetAddressRange().ContainsLoadAddress(
cur_pc, &GetTarget());
} else if (m_addr_context.symbol && m_addr_context.symbol->ValueIsAddress()) {
AddressRange unused_range;
return m_addr_context.function->GetRangeContainingLoadAddress(
cur_pc, GetTarget(), unused_range);
}
if (m_addr_context.symbol && m_addr_context.symbol->ValueIsAddress()) {
AddressRange range(m_addr_context.symbol->GetAddressRef(),
m_addr_context.symbol->GetByteSize());
return range.ContainsLoadAddress(cur_pc, &GetTarget());
Expand Down

0 comments on commit 5088e1b

Please sign in to comment.