summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2016-10-31 16:22:07 +0000
committerPavel Labath <labath@google.com>2016-10-31 16:22:07 +0000
commit218770b827cac5e36e9739d0c47f4c67d05434ea (patch)
treeec346f3ceb1522bcd2515c0c3fc148d58dc9e784 /lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
parent543283bad2ae71f3f2e9335024497ab69a899aab (diff)
downloadbcm5719-llvm-218770b827cac5e36e9739d0c47f4c67d05434ea.tar.gz
bcm5719-llvm-218770b827cac5e36e9739d0c47f4c67d05434ea.zip
Improve ".." handling in FileSpec normalization
Summary: .. handling for windows path was completely broken because the function was expecting \ as path separators, but we were passing it normalized file paths, where these have been replaced by forward slashes. Apart from this, the function was incorrect for posix paths as well in some corner cases, as well as being generally hard to follow. The corner cases were: - /../bar -> should be same as /bar - /bar/.. -> should be same as / (slightly dodgy as the former depends on /bar actually existing, but since we're doing it in an abstract way, I think the transformation is reasonable) I rewrite the function to fix these corner cases and handle windows paths more correctly. The function should now handle the posix paths (modulo symlinks, but we cannot really do anything about that without a real filesystem). For windows paths, there are a couple of corner cases left, mostly to do with drive letter handling, which cannot be fixed until the rest of the class understands drive letters better. Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D26081 llvm-svn: 285593
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp')
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index d24380375f5..04bed4eff9f 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -5095,7 +5095,7 @@ uint32_t ObjectFileMachO::GetDependentModules(FileSpecList &files) {
FileSpec file_spec(path, true);
// Remove any redundant parts of the path (like "../foo") since
// LC_RPATH values often contain "..".
- file_spec.NormalizePath();
+ file_spec = file_spec.GetNormalizedPath();
if (file_spec.Exists() && files.AppendIfUnique(file_spec)) {
count++;
break;
OpenPOWER on IntegriCloud