Skip to content

Conversation

@labath
Copy link
Collaborator

@labath labath commented Feb 24, 2025

SymbolFileCTF never creates discontinuous functions, so this is technically NFC, but it takes us one step closer to removing the deprecated API.

SymbolFileCTF never creates discontinuous functions, so this is
technically NFC, but it takes us one step closer to removing the
deprecated API.
@labath labath requested a review from JDevlieghere as a code owner February 24, 2025 14:22
@llvmbot llvmbot added the lldb label Feb 24, 2025
@llvmbot
Copy link
Member

llvmbot commented Feb 24, 2025

@llvm/pr-subscribers-lldb

Author: Pavel Labath (labath)

Changes

SymbolFileCTF never creates discontinuous functions, so this is technically NFC, but it takes us one step closer to removing the deprecated API.


Full diff: https://github.com/llvm/llvm-project/pull/128517.diff

1 Files Affected:

  • (modified) lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp (+4-2)
diff --git a/lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp b/lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp
index 0feb927c5c948..0b8862f64ceb8 100644
--- a/lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp
+++ b/lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp
@@ -946,8 +946,10 @@ uint32_t SymbolFileCTF::ResolveSymbolContext(const Address &so_addr,
   // Resolve functions.
   if (resolve_scope & eSymbolContextFunction) {
     for (FunctionSP function_sp : m_functions) {
-      if (function_sp->GetAddressRange().ContainsFileAddress(
-              so_addr.GetFileAddress())) {
+      if (llvm::any_of(
+              function_sp->GetAddressRanges(), [&](const AddressRange range) {
+                return range.ContainsFileAddress(so_addr.GetFileAddress());
+              })) {
         sc.function = function_sp.get();
         resolved_flags |= eSymbolContextFunction;
         break;

@labath labath merged commit f5d80c3 into llvm:main Feb 25, 2025
12 checks passed
@labath labath deleted the ctf branch February 25, 2025 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants