Skip to content

Commit 2bde6e8

Browse files
check if python.dll can be found after adding it to the search path
1 parent 8b34fea commit 2bde6e8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lldb/tools/driver/Driver.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,20 @@ bool IsPythonDLLInPath() {
492492
}
493493
#endif
494494

495+
/// Try to setup the DLL search path for the Python Runtime Library
496+
/// (python3xx.dll).
497+
///
498+
/// If `LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME` is set, we first check if
499+
/// python3xx.dll is in the search path. If it's not, we try to add it and
500+
/// check for it a second time.
501+
/// If only `LLDB_PYTHON_DLL_RELATIVE_PATH` is set, we try to add python3xx.dll
502+
/// to the search path python.dll is already in the search path or not.
495503
void SetupPythonRuntimeLibrary() {
496504
#ifdef LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME
497505
if (IsPythonDLLInPath())
498506
return;
499507
#ifdef LLDB_PYTHON_DLL_RELATIVE_PATH
500-
if (AddPythonDLLToSearchPath())
508+
if (AddPythonDLLToSearchPath() && IsPythonDLLInPath())
501509
return;
502510
#endif
503511
llvm::errs() << "error: unable to find '"

0 commit comments

Comments
 (0)