[Lldb-commits] [lldb] [lldb][Process/FreeBSDKernel] Fix broken debugging on aarch64 (PR #180222)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 12 07:50:38 PST 2026


================
@@ -43,64 +49,120 @@ bool RegisterContextFreeBSDKernel_arm64::ReadRegister(
     return false;
 
   // https://cgit.freebsd.org/src/tree/sys/arm64/include/pcb.h
+  struct {
+    llvm::support::ulittle64_t x[12];
+    llvm::support::ulittle64_t sp;
+  } pcb;
+
+  // https://cgit.freebsd.org/src/tree/sys/arm64/include/pcb.h?h=stable%2F13
   struct {
     llvm::support::ulittle64_t x[30];
     llvm::support::ulittle64_t lr;
     llvm::support::ulittle64_t _reserved;
     llvm::support::ulittle64_t sp;
-  } pcb;
+  } pcb13;
 
   Status error;
-  size_t rd =
-      m_thread.GetProcess()->ReadMemory(m_pcb_addr, &pcb, sizeof(pcb), error);
-  if (rd != sizeof(pcb))
-    return false;
+  constexpr int FBSD14 = 1400084;
+  static const int osreldate = 1400084;
----------------
DavidSpickett wrote:

If you think the function may be called over and over and therefore lookup osreldate over and over, you can address that another way in another PR.

https://github.com/llvm/llvm-project/pull/180222


More information about the lldb-commits mailing list