diff options
author | Greg Clayton <gclayton@apple.com> | 2018-05-07 14:21:04 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2018-05-07 14:21:04 +0000 |
commit | d68dbd5ad653a7ea9415ce94e8b3d5cdaee1220a (patch) | |
tree | 3c169217e082599fb9f0052b8f4448888a698e58 /lldb/source/Target/TargetList.cpp | |
parent | f9b3fc5e2bc77f036759d7f0a13d18e741f39bb4 (diff) | |
download | bcm5719-llvm-d68dbd5ad653a7ea9415ce94e8b3d5cdaee1220a.tar.gz bcm5719-llvm-d68dbd5ad653a7ea9415ce94e8b3d5cdaee1220a.zip |
Fix "file ./a.out" and file "../a.out" so that is works after recent FileSpec normalization path changes.
Test coming soon, but I want to unbreak people.
llvm-svn: 331637
Diffstat (limited to 'lldb/source/Target/TargetList.cpp')
-rw-r--r-- | lldb/source/Target/TargetList.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lldb/source/Target/TargetList.cpp b/lldb/source/Target/TargetList.cpp index b245a6d167f..12307b6ac06 100644 --- a/lldb/source/Target/TargetList.cpp +++ b/lldb/source/Target/TargetList.cpp @@ -367,16 +367,12 @@ Status TargetList::CreateTargetInternal(Debugger &debugger, user_exe_path_is_bundle = true; if (file.IsRelative() && !user_exe_path.empty()) { - // Ignore paths that start with "./" and "../" - if (!user_exe_path.startswith("./") && !user_exe_path.startswith("../")) { - llvm::SmallString<64> cwd; - if (! llvm::sys::fs::current_path(cwd)) { - cwd += '/'; - cwd += user_exe_path; - FileSpec cwd_file(cwd, false); - if (cwd_file.Exists()) - file = cwd_file; - } + llvm::SmallString<64> cwd; + if (! llvm::sys::fs::current_path(cwd)) { + FileSpec cwd_file(cwd.c_str(), false); + cwd_file.AppendPathComponent(file); + if (cwd_file.Exists()) + file = cwd_file; } } |