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

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 02:27:37 PST 2026


================
@@ -217,19 +220,33 @@ bool ProcessFreeBSDKernelCore::DoUpdateThreadList(ThreadList &old_thread_list,
         ReadSignedIntegerFromMemory(FindSymbol("pcb_size"), 4, -1, error);
     lldb::addr_t stoppcbs = FindSymbol("stoppcbs");
 
-    // from FreeBSD sys/param.h
+    // Read stopped_cpus bitmask and mp_maxid for CPU validation
+    lldb::addr_t stopped_cpus = FindSymbol("stopped_cpus");
+
+    // from sys/kern/subr_smp.c
+    uint32_t mp_maxid =
+        ReadUnsignedIntegerFromMemory(FindSymbol("mp_maxid"), 4, 0, error);
+    auto type_system_sp =
+        *GetTarget().GetScratchTypeSystemForLanguage(eLanguageTypeC);
----------------
DavidSpickett wrote:

This can in theory fail, so please check the expected. (in fact I'm surprised an assert does not get hit at runtime because you haven't checked for an error)

Also the CompilerType below, check IsValid on it. (99% of other uses don't do this but in theory they should)

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


More information about the llvm-commits mailing list