Author: rchamala
Date: 2026-02-14T09:44:46-08:00
New Revision: 0773c83e6666ac5cbd4c9b89ebb2e78e7c494821

URL: 
https://github.com/llvm/llvm-project/commit/0773c83e6666ac5cbd4c9b89ebb2e78e7c494821
DIFF: 
https://github.com/llvm/llvm-project/commit/0773c83e6666ac5cbd4c9b89ebb2e78e7c494821.diff

LOG: [lldb] Fix pid_t redefinition on Windows in 
ScriptInterpreterPythonInterfaces (#181493)

## 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

Co-authored-by: Rahul Reddy Chamala <[email protected]>

Added: 
    

Modified: 
    
lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.cpp

Removed: 
    


################################################################################
diff  --git 
a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.cpp
 
b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.cpp
index c460b16ba8405..7cb5c90f8e14b 100644
--- 
a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.cpp
+++ 
b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.cpp
@@ -11,6 +11,10 @@
 
 #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"


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

Reply via email to