[Lldb-commits] [lldb] [lldb] Support PtrAuth in the expression evaluator (PR #186001)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Thu Mar 12 03:30:36 PDT 2026
================
@@ -0,0 +1,29 @@
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestPtrAuthFixups(TestBase):
+ @skipUnlessDarwin
+ @skipUnlessArch("arm64")
+ def test_static_function_pointer(self):
+ """Test that a static function pointer initialized in an expression
+ gets correctly signed on arm64e via the pointer signing fixup pass."""
+ self.build()
+
+ lldbutil.run_to_source_breakpoint(
+ self, "// break here", lldb.SBFileSpec("main.c", False)
+ )
+
+ self.expect_expr(
+ "static int (*fp)(int, int) = &add; fp(5, 6);",
----------------
DavidSpickett wrote:
Please add a comment here to explain why this must be signed.
My understanding so far is that `fp` ends up signed, I'm not sure why it **has** to be though. I know arm64e does sign a lot of things but I don't know what enforces that I cannot just call the function at its normal, unsigned, address.
https://github.com/llvm/llvm-project/pull/186001
More information about the lldb-commits
mailing list