[Lldb-commits] [lldb] [lldb] Strip code pointers in lldb-server test binary on arm64e (PR #203988)

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 15 13:57:23 PDT 2026


https://github.com/bulbazord created https://github.com/llvm/llvm-project/pull/203988

Otherwise an unstripped pointer will be sent to debugserver. LLDB strips pointers before sending them to debugserver, so debugserver does not know how to handle it.

This fixes TestGdbRemoteSingleStep.py, TestGdbRemote_qMemoryRegion.py, and TestGdbRemote_vCont.py on arm64e.

>From 3d61814d987300843d33860afe04ec6bd7f7bd46 Mon Sep 17 00:00:00 2001
From: Alex Langford <alangford at apple.com>
Date: Mon, 15 Jun 2026 13:54:14 -0700
Subject: [PATCH] [lldb] Strip code pointers in lldb-server test binary on
 arm64e

Otherwise an unstripped pointer will be sent to debugserver. LLDB strips
pointers before sending them to debugserver, so debugserver does not
know how to handle it.

This fixes TestGdbRemoteSingleStep.py, TestGdbRemote_qMemoryRegion.py,
and TestGdbRemote_vCont.py on arm64e.
---
 lldb/test/API/tools/lldb-server/main.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lldb/test/API/tools/lldb-server/main.cpp b/lldb/test/API/tools/lldb-server/main.cpp
index 7e84552b0f25d..bbe523fc3c2f7 100644
--- a/lldb/test/API/tools/lldb-server/main.cpp
+++ b/lldb/test/API/tools/lldb-server/main.cpp
@@ -330,6 +330,9 @@ int main(int argc, char **argv) {
         func_p = swap_chars;
 
       std::lock_guard<std::mutex> lock(g_print_mutex);
+#if defined(__arm64e__)
+      func_p = __builtin_ptrauth_strip(func_p, /*ptrauth_key_asib*/ 1);
+#endif
       printf("code address: %p\n", func_p);
     } else if (consume_front(arg, "call-function:")) {
       void (*func_p)() = nullptr;



More information about the lldb-commits mailing list