[Lldb-commits] [lldb] [llvm] [lldb][Process/FreeBSDKernelCore] Improve DoUpdateThreadList() (PR #183981)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 2 02:50:58 PST 2026


================
@@ -217,6 +220,13 @@ bool ProcessFreeBSDKernelCore::DoUpdateThreadList(ThreadList &old_thread_list,
         ReadSignedIntegerFromMemory(FindSymbol("pcb_size"), 4, -1, error);
     lldb::addr_t stoppcbs = FindSymbol("stoppcbs");
 
+    // Read stopped_cpus bitmask and mp_maxid for CPU validation
+    lldb::addr_t stopped_cpus = FindSymbol("stopped_cpus");
+    int32_t mp_maxid =
+        ReadSignedIntegerFromMemory(FindSymbol("mp_maxid"), 4, 0, error);
+    uint32_t long_size = GetAddressByteSize(); // approximation of sizeof(long)
----------------
DavidSpickett wrote:

long_size_bytes

The approximation holds at least for AArch64: https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#types-varying-by-data-model.

Also https://wiki.freebsd.org/EdMaste/ArchitectureSpecifics, assuming it's current. These things don't change often.

It does mention ILP32 but I would assume the kernel is not using that. So it's LP64 and for that, a long is 8 bytes.

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


More information about the lldb-commits mailing list