[Lldb-commits] [lldb] [lldb] Fix pid_t redefinition on Windows in ScriptInterpreterPythonInterfaces (PR #181493)
via lldb-commits
lldb-commits at lists.llvm.org
Sat Feb 14 09:41:39 PST 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: None (rchamala)
<details>
<summary>Changes</summary>
## Summary
Include `lldb-python.h` as the first include inside the `LLDB_ENABLE_PYTHON` block in `ScriptInterpreterPythonInterfaces.cpp`, matching the pattern used by every other Python interface `.cpp` file in this directory.
On Windows, `lldb-python.h` defines `NO_PID_T` before including `Python.h`. This prevents `PosixApi.h` (transitively included via `lldb-private.h`) from redefining `pid_t` with a conflicting type (`uint32_t` vs `int`).
The issue was introduced by #<!-- -->181334 (ScriptedSymbolLocator plugin), which added a new header whose include chain transitively reaches `PosixApi.h`.
Fixes Windows build failures on lldb-aarch64-windows, lldb-x86_64-win, and lldb-remote-linux-win.
## Test plan
- [ ] lldb-aarch64-windows build passes
- [ ] lldb-x86_64-win build passes
- [ ] lldb-remote-linux-win build passes
---
Full diff: https://github.com/llvm/llvm-project/pull/181493.diff
1 Files Affected:
- (modified) lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.cpp (+5-1)
``````````diff
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.cpp
index c460b16ba8405..47972805e7a37 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.cpp
@@ -7,13 +7,17 @@
//===----------------------------------------------------------------------===//
#include "lldb/Host/Config.h"
-#include "lldb/lldb-enumerations.h"
#if LLDB_ENABLE_PYTHON
+// Include lldb-python.h first to define NO_PID_T on Windows before any
+// LLDB header transitively pulls in PosixApi.h.
+#include "../lldb-python.h"
+
#include "ScriptInterpreterPythonInterfaces.h"
#include "lldb/Core/PluginManager.h"
+#include "lldb/lldb-enumerations.h"
using namespace lldb;
using namespace lldb_private;
``````````
</details>
https://github.com/llvm/llvm-project/pull/181493
More information about the lldb-commits
mailing list