summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/windows/HostInfoWindows.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-05-13 19:44:57 +0000
committerZachary Turner <zturner@google.com>2015-05-13 19:44:57 +0000
commitff33eefcc7d35bf11330240416a26804c6ff0d2e (patch)
tree58e2c45307105009d13669d078eb65d37b738733 /lldb/source/Host/windows/HostInfoWindows.cpp
parent1aa755ce772a311a1c5280578d6303be8d088203 (diff)
downloadbcm5719-llvm-ff33eefcc7d35bf11330240416a26804c6ff0d2e.tar.gz
bcm5719-llvm-ff33eefcc7d35bf11330240416a26804c6ff0d2e.zip
Fix an issue with finding python on Windows.
Someone must have changed the behavior of FileSpec slightly relating to whether or not there is a trailing backslash when calling GetPath() and GetDirectory(). This caused ScriptInterpreterPython to find the wrong values when initializing sys.path, and as a result we couldn't find the lldb module. This patch fixes the issue, and also adds a test to make sure that GetDirectory() does not return a string containing a trailing slash. llvm-svn: 237282
Diffstat (limited to 'lldb/source/Host/windows/HostInfoWindows.cpp')
-rw-r--r--lldb/source/Host/windows/HostInfoWindows.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lldb/source/Host/windows/HostInfoWindows.cpp b/lldb/source/Host/windows/HostInfoWindows.cpp
index b1c880f0ffe..6dce71d9172 100644
--- a/lldb/source/Host/windows/HostInfoWindows.cpp
+++ b/lldb/source/Host/windows/HostInfoWindows.cpp
@@ -109,8 +109,7 @@ HostInfoWindows::ComputePythonDirectory(FileSpec &file_spec)
FileSpec lldb_file_spec;
if (!GetLLDBPath(lldb::ePathTypeLLDBShlibDir, lldb_file_spec))
return false;
- llvm::SmallString<64> path;
- lldb_file_spec.GetPath(path);
+ llvm::SmallString<64> path(lldb_file_spec.GetDirectory().AsCString());
llvm::sys::path::remove_filename(path);
llvm::sys::path::append(path, "lib", "site-packages");
std::replace(path.begin(), path.end(), '\\', '/');
OpenPOWER on IntegriCloud