https://github.com/bulbazord updated https://github.com/llvm/llvm-project/pull/196204
>From e94bfb296fab7675db572cf5824344c71c870ce5 Mon Sep 17 00:00:00 2001 From: Alex Langford <[email protected]> Date: Wed, 6 May 2026 15:51:54 -0700 Subject: [PATCH 1/2] [lldb] Strip metadata bits on function pointer in IndirectCallEdge::GetCallee 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. --- lldb/source/Symbol/Function.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp index cc8347fd5c510..e3cb42f248e73 100644 --- a/lldb/source/Symbol/Function.cpp +++ b/lldb/source/Symbol/Function.cpp @@ -235,6 +235,12 @@ 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"); >From cc85091ac03568b3017b81852be51e04ad32c5b6 Mon Sep 17 00:00:00 2001 From: Alex Langford <[email protected]> Date: Thu, 7 May 2026 10:59:51 -0700 Subject: [PATCH 2/2] Update lldb/source/Symbol/Function.cpp Co-authored-by: Jonas Devlieghere <[email protected]> --- lldb/source/Symbol/Function.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp index e3cb42f248e73..23ec058ae9c82 100644 --- a/lldb/source/Symbol/Function.cpp +++ b/lldb/source/Symbol/Function.cpp @@ -235,11 +235,12 @@ Function *IndirectCallEdge::GetCallee(ModuleList &images, return nullptr; } - if (auto *process = exe_ctx.GetProcessPtr()) + if (auto *process = exe_ctx.GetProcessPtr()) { raw_addr = process->FixCodeAddress(raw_addr); - else + } 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-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
