From 0016b450bee87bec816f764acfb9fa6afc31c352 Mon Sep 17 00:00:00 2001 From: Haibo Huang Date: Tue, 8 Oct 2019 00:33:26 +0000 Subject: [lldb] Reverts part of 61f471a Seems I wrongly merged an old patch. Reverts the change related to python dir for windows. FileSpec should always contain normalized path. I.e. using '/' even in windows. llvm-svn: 373998 --- .../Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 54dc60c3ed0..fefa12c7068 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -319,6 +319,12 @@ void ScriptInterpreterPython::ComputePythonDir( // x86_64, or bin on Windows). llvm::sys::path::remove_filename(path); llvm::sys::path::append(path, LLDB_PYTHON_RELATIVE_LIBDIR); + +#if defined(_WIN32) + // This will be injected directly through FileSpec.GetDirectory().SetString(), + // so we need to normalize manually. + std::replace(path.begin(), path.end(), '\\', '/'); +#endif } FileSpec ScriptInterpreterPython::GetPythonDir() { @@ -334,7 +340,6 @@ FileSpec ScriptInterpreterPython::GetPythonDir() { #else ComputePythonDir(path); #endif - llvm::sys::path::native(path); spec.GetDirectory().SetString(path); return spec; }(); -- cgit v1.2.3