Author: Alex Langford
Date: 2026-05-07T18:13:15Z
New Revision: 835b5ef1e3acee1e70b9ea97ed8c2f579da8c2e8

URL: 
https://github.com/llvm/llvm-project/commit/835b5ef1e3acee1e70b9ea97ed8c2f579da8c2e8
DIFF: 
https://github.com/llvm/llvm-project/commit/835b5ef1e3acee1e70b9ea97ed8c2f579da8c2e8.diff

LOG: [lldb] Strip metadata bits on function pointer in 
IndirectCallEdge::GetCallee (#196204)

IndirectCallEdge::GetCallee calculates the raw address of a function
pointer and tries to resolve a load address for it. If the function
pointer has metadata bits in it (e.g. a signed pointer in arm64e) then
the resolution will fail.

---------

Co-authored-by: Jonas Devlieghere <[email protected]>

Added: 
    

Modified: 
    lldb/source/Symbol/Function.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp
index cc8347fd5c510..9b9dd3fbc0c65 100644
--- a/lldb/source/Symbol/Function.cpp
+++ b/lldb/source/Symbol/Function.cpp
@@ -235,6 +235,13 @@ Function *IndirectCallEdge::GetCallee(ModuleList &images,
     return nullptr;
   }
 
+  if (auto *process = exe_ctx.GetProcessPtr()) {
+    raw_addr = process->FixCodeAddress(raw_addr);
+  } else {
+    LLDB_LOG(log, "IndirectCallEdge: No Process available, unable to call "
+                  "FixCodeAddress on function pointer");
+  }
+
   Address callee_addr;
   if (!exe_ctx.GetTargetPtr()->ResolveLoadAddress(raw_addr, callee_addr)) {
     LLDB_LOG(log, "IndirectCallEdge: Could not resolve callee's load address");


        
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to