[Lldb-commits] [lldb] [lldb][windows] fix undeclared identifier error GetModulePath (PR #180989)

via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 11 10:30:14 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Charles Zablit (charles-zablit)

<details>
<summary>Changes</summary>

`LLDB_PYTHON_DLL_RELATIVE_PATH` can be unset while `LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME` is, since it's set automatically by CMake. This situation causes a build failure which this patch fixes.

---
Full diff: https://github.com/llvm/llvm-project/pull/180989.diff


1 Files Affected:

- (modified) lldb/source/Host/windows/PythonPathSetup/PythonPathSetup.cpp (+1-1) 


``````````diff
diff --git a/lldb/source/Host/windows/PythonPathSetup/PythonPathSetup.cpp b/lldb/source/Host/windows/PythonPathSetup/PythonPathSetup.cpp
index 937977a6851c6..b71e10b9c82e7 100644
--- a/lldb/source/Host/windows/PythonPathSetup/PythonPathSetup.cpp
+++ b/lldb/source/Host/windows/PythonPathSetup/PythonPathSetup.cpp
@@ -19,7 +19,6 @@
 
 using namespace llvm;
 
-#ifdef LLDB_PYTHON_DLL_RELATIVE_PATH
 static std::string GetModulePath(HMODULE module) {
   std::vector<WCHAR> buffer(MAX_PATH);
   while (buffer.size() <= PATHCCH_MAX_CCH) {
@@ -41,6 +40,7 @@ static std::string GetModulePath(HMODULE module) {
 /// Returns the full path to the lldb.exe executable.
 static std::string GetPathToExecutable() { return GetModulePath(NULL); }
 
+#ifdef LLDB_PYTHON_DLL_RELATIVE_PATH
 bool AddPythonDLLToSearchPath() {
   std::string path_str = GetPathToExecutable();
   if (path_str.empty())

``````````

</details>


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


More information about the lldb-commits mailing list