From 7d86ee5ab0ca98edff2f07c373967f34227c960e Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 8 Mar 2017 17:56:08 +0000 Subject: Resubmit FileSystem changes. This was originall reverted due to some test failures in ModuleCache and TestCompDirSymlink. These issues have all been resolved and the code now passes all tests. Differential Revision: https://reviews.llvm.org/D30698 llvm-svn: 297300 --- lldb/source/Host/common/MonitoringProcessLauncher.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lldb/source/Host/common/MonitoringProcessLauncher.cpp') diff --git a/lldb/source/Host/common/MonitoringProcessLauncher.cpp b/lldb/source/Host/common/MonitoringProcessLauncher.cpp index b94c3d24283..2aa6c7f50b6 100644 --- a/lldb/source/Host/common/MonitoringProcessLauncher.cpp +++ b/lldb/source/Host/common/MonitoringProcessLauncher.cpp @@ -17,6 +17,8 @@ #include "lldb/Utility/Error.h" #include "lldb/Utility/Log.h" +#include "llvm/Support/FileSystem.h" + using namespace lldb; using namespace lldb_private; @@ -38,8 +40,9 @@ MonitoringProcessLauncher::LaunchProcess(const ProcessLaunchInfo &launch_info, FileSpec exe_spec(resolved_info.GetExecutableFile()); - FileSpec::FileType file_type = exe_spec.GetFileType(); - if (file_type != FileSpec::eFileTypeRegular) { + llvm::sys::fs::file_status stats; + status(exe_spec.GetPath(), stats); + if (!is_regular_file(stats)) { ModuleSpec module_spec(exe_spec, arch_spec); lldb::ModuleSP exe_module_sp; error = @@ -48,11 +51,13 @@ MonitoringProcessLauncher::LaunchProcess(const ProcessLaunchInfo &launch_info, if (error.Fail()) return HostProcess(); - if (exe_module_sp) + if (exe_module_sp) { exe_spec = exe_module_sp->GetFileSpec(); + status(exe_spec.GetPath(), stats); + } } - if (exe_spec.Exists()) { + if (exists(stats)) { exe_spec.GetPath(exe_path, sizeof(exe_path)); } else { resolved_info.GetExecutableFile().GetPath(exe_path, sizeof(exe_path)); -- cgit v1.2.3