Skip to content

Commit 5088e1b

Browse files
authored
[lldb] Avoid Function::GetAddressRange in ThreadPlanStepRange::InSymbol (#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.
1 parent 3083aea commit 5088e1b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lldb/source/Target/ThreadPlanStepRange.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,11 @@ bool ThreadPlanStepRange::InRange() {
197197
bool ThreadPlanStepRange::InSymbol() {
198198
lldb::addr_t cur_pc = GetThread().GetRegisterContext()->GetPC();
199199
if (m_addr_context.function != nullptr) {
200-
return m_addr_context.function->GetAddressRange().ContainsLoadAddress(
201-
cur_pc, &GetTarget());
202-
} else if (m_addr_context.symbol && m_addr_context.symbol->ValueIsAddress()) {
200+
AddressRange unused_range;
201+
return m_addr_context.function->GetRangeContainingLoadAddress(
202+
cur_pc, GetTarget(), unused_range);
203+
}
204+
if (m_addr_context.symbol && m_addr_context.symbol->ValueIsAddress()) {
203205
AddressRange range(m_addr_context.symbol->GetAddressRef(),
204206
m_addr_context.symbol->GetByteSize());
205207
return range.ContainsLoadAddress(cur_pc, &GetTarget());

0 commit comments

Comments
 (0)