================
@@ -225,11 +235,23 @@ bool 
ProcessFreeBSDKernelCore::DoUpdateThreadList(ThreadList &old_thread_list,
     // the end of the list, so we have to walk it backwards. First collect all
     // the processes in the list order.
     std::vector<lldb::addr_t> process_addrs;
-    for (lldb::addr_t proc =
-             ReadPointerFromMemory(FindSymbol("allproc"), error);
-         proc != 0 && proc != LLDB_INVALID_ADDRESS;
-         proc = ReadPointerFromMemory(proc + offset_p_list, error)) {
-      process_addrs.push_back(proc);
+
+    lldb::addr_t zombproc_addr = FindSymbol("zombproc");
+    if (zombproc_addr != LLDB_INVALID_ADDRESS) {
+      for (lldb::addr_t proc = ReadPointerFromMemory(zombproc_addr, error);
+           proc != 0 && proc != LLDB_INVALID_ADDRESS;
+           proc = ReadPointerFromMemory(proc + offset_p_list, error)) {
+        process_addrs.push_back(proc);
+      }
+    }
+
+    lldb::addr_t allproc_addr = FindSymbol("allproc");
+    if (allproc_addr != LLDB_INVALID_ADDRESS) {
+      for (lldb::addr_t proc = ReadPointerFromMemory(allproc_addr, error);
----------------
DavidSpickett wrote:

Both of these loops need to check whether the error is a failure. If we read 
one valid proc, and then we fail to read the next, that could trick the loop 
into thinking that we had read a valid proc again, but it's in fact just the 
first one.

https://github.com/llvm/llvm-project/pull/183981
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to