diff options
| author | Pavel Labath <labath@google.com> | 2017-03-07 13:19:15 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2017-03-07 13:19:15 +0000 |
| commit | 30e6cbfcfca4836c2b3497d84ffc2043b548b2a6 (patch) | |
| tree | 3b24106c96c514a5490b04bfe541e2e6a2ac5518 /lldb/source/Plugins/Process | |
| parent | 3d0af578ccc071dc1f9fc1672af55a969e0beb5a (diff) | |
| download | bcm5719-llvm-30e6cbfcfca4836c2b3497d84ffc2043b548b2a6.tar.gz bcm5719-llvm-30e6cbfcfca4836c2b3497d84ffc2043b548b2a6.zip | |
Revert "Use LLVM for all stat-related functionality."
this reverts r297116 because it breaks the unittests and
TestCompDirSymlink. The ModuleCache unit test is trivially fixable, but
the CompDirSymlink failure is a symptom of a deeper problem: llvm's stat
functionality is not a drop-in replacement for lldb's. The former is
based on stat(2) (which does symlink resolution), while the latter is
based on lstat(2) (which does not).
This also reverts subsequent build fixes (r297128, r297120, 297117) and
r297119 (Remove FileSpec dependency on FileSystem) which builds on top
of this.
llvm-svn: 297139
Diffstat (limited to 'lldb/source/Plugins/Process')
3 files changed, 7 insertions, 10 deletions
diff --git a/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp b/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp index 65ab12fe1ad..b231f259208 100644 --- a/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp +++ b/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp @@ -31,8 +31,6 @@ #include "MachException.h" -#include "llvm/Support/FileSystem.h" - using namespace lldb; using namespace lldb_private; using namespace lldb_private::process_darwin; @@ -65,7 +63,7 @@ Error NativeProcessProtocol::Launch( FileSpec working_dir(launch_info.GetWorkingDirectory()); if (working_dir && (!working_dir.ResolvePath() || - !llvm::sys::fs::is_directory(working_dir.GetPath())) { + working_dir.GetFileType() != FileSpec::eFileTypeDirectory)) { error.SetErrorStringWithFormat("No such file or directory: %s", working_dir.GetCString()); return error; diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp index 1f02385d50d..f0a62e85458 100644 --- a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp @@ -46,7 +46,6 @@ #include "lldb/Host/posix/Fcntl.h" -#include "llvm/Support/FileSystem.h" #include "llvm/Support/Threading.h" using namespace lldb; @@ -362,9 +361,9 @@ Error ProcessFreeBSD::DoLaunch(Module *module, ProcessLaunchInfo &launch_info) { assert(m_monitor == NULL); FileSpec working_dir = launch_info.GetWorkingDirectory(); - namespace fs = llvm::sys::fs; - if (working_dir && (!working_dir.ResolvePath() || - !fs::is_directory(working_dir.GetPath()))) { + if (working_dir && + (!working_dir.ResolvePath() || + working_dir.GetFileType() != FileSpec::eFileTypeDirectory)) { error.SetErrorStringWithFormat("No such file or directory: %s", working_dir.GetCString()); return error; diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index a3df09cdc4f..05276294f0e 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -49,7 +49,6 @@ #include "ProcFileReader.h" #include "Procfs.h" -#include "llvm/Support/FileSystem.h" #include "llvm/Support/Threading.h" #include <linux/unistd.h> @@ -225,8 +224,9 @@ Error NativeProcessProtocol::Launch( // Verify the working directory is valid if one was specified. FileSpec working_dir{launch_info.GetWorkingDirectory()}; - if (working_dir && (!working_dir.ResolvePath() || - !llvm::sys::fs::is_directory(working_dir.GetPath()))) { + if (working_dir && + (!working_dir.ResolvePath() || + working_dir.GetFileType() != FileSpec::eFileTypeDirectory)) { error.SetErrorStringWithFormat("No such file or directory: %s", working_dir.GetCString()); return error; |

