[Lldb-commits] [lldb] [lldb] Fix FindProcessImpl() for iOS simulators (PR #139174)

via lldb-commits lldb-commits at lists.llvm.org
Sat Jun 21 14:51:04 PDT 2025


================
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <thread>
+#if !defined(_WIN32)
+#include <unistd.h>
+#endif
+
+static void print_pid() {
+  #if defined(_WIN32)
+    fprintf(stderr, "PID: %d\n", ::GetCurrentProcessId());
----------------
royitaqi wrote:

I copied this snippet from from `TestAppleSimulatorOSType`'s `main.cpp` (see [code](https://github.com/llvm/llvm-project/blob/c455f4a32d91436c131a751fc9587d7fa3ded614/lldb/test/API/tools/lldb-server/main.cpp#L45-L51)).

However, it's OS-dependent, and I don't have a Windows machine to verify.

Questions:
1. What header files do I need to include for `::GetCurrentProcessId()`?
2. Does the test run in Windows? If not, maybe I can just remove this `#if`.

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


More information about the lldb-commits mailing list