summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/HostInfoBase.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2015-09-18 21:39:31 +0000
committerSean Callanan <scallanan@apple.com>2015-09-18 21:39:31 +0000
commitdb7d8083cd1f32dc7ffd699ac66ae5bbef7405f0 (patch)
treecb2111794c3654ed669700de75da47cd41d392e7 /lldb/source/Host/common/HostInfoBase.cpp
parentc021abfaffc48f561022645888e84d79ef2e5e5d (diff)
downloadbcm5719-llvm-db7d8083cd1f32dc7ffd699ac66ae5bbef7405f0.tar.gz
bcm5719-llvm-db7d8083cd1f32dc7ffd699ac66ae5bbef7405f0.zip
Added support for resolving symbolic links to FileSpec.
We use the symbolic link to resolver to find the target of the LLDB shlib symlink if there is a symlink. This allows us to find shlib-relative resources even when running under the testsuite, where _lldb.so is a symlink in the Python resource directory. Also changed a comment to be slightly more clear about what resolve_path in the constructor for FileSpec means, since if we were actually using realpath() this code wouldn't have been necessary. http://reviews.llvm.org/D12984 llvm-svn: 248048
Diffstat (limited to 'lldb/source/Host/common/HostInfoBase.cpp')
-rw-r--r--lldb/source/Host/common/HostInfoBase.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lldb/source/Host/common/HostInfoBase.cpp b/lldb/source/Host/common/HostInfoBase.cpp
index 7a6ea0c2b84..e7340c538f3 100644
--- a/lldb/source/Host/common/HostInfoBase.cpp
+++ b/lldb/source/Host/common/HostInfoBase.cpp
@@ -306,7 +306,10 @@ HostInfoBase::ComputeSharedLibraryDirectory(FileSpec &file_spec)
FileSpec lldb_file_spec(
Host::GetModuleFileSpecForHostAddress(reinterpret_cast<void *>(reinterpret_cast<intptr_t>(HostInfoBase::GetLLDBPath))));
-
+
+ // This is necessary because when running the testsuite the shlib might be a symbolic link inside the Python resource dir.
+ lldb_file_spec = lldb_file_spec.ResolveSymbolicLink();
+
// Remove the filename so that this FileSpec only represents the directory.
file_spec.GetDirectory() = lldb_file_spec.GetDirectory();
OpenPOWER on IntegriCloud