[FileSystem] Migrate MonitoringProcessLauncher

Use the FileSystem helpers instead of using the file system directly.

llvm-svn: 348207
This commit is contained in:
Jonas Devlieghere 2018-12-03 22:41:32 +00:00
parent 44c1f81b27
commit 0bbe9a7a98
1 changed files with 6 additions and 11 deletions

View File

@ -12,7 +12,6 @@
#include "lldb/Host/HostProcess.h"
#include "lldb/Target/ProcessLaunchInfo.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Status.h"
#include "llvm/Support/FileSystem.h"
@ -30,20 +29,16 @@ MonitoringProcessLauncher::LaunchProcess(const ProcessLaunchInfo &launch_info,
error.Clear();
FileSystem &fs = FileSystem::Instance();
FileSpec exe_spec(resolved_info.GetExecutableFile());
llvm::sys::fs::file_status stats;
status(exe_spec.GetPath(), stats);
if (!exists(stats)) {
if (!fs.Exists(exe_spec))
FileSystem::Instance().Resolve(exe_spec);
status(exe_spec.GetPath(), stats);
}
if (!exists(stats)) {
FileSystem::Instance().ResolveExecutableLocation(exe_spec);
status(exe_spec.GetPath(), stats);
}
if (!exists(stats)) {
if (!fs.Exists(exe_spec))
FileSystem::Instance().ResolveExecutableLocation(exe_spec);
if (!fs.Exists(exe_spec)) {
error.SetErrorStringWithFormatv("executable doesn't exist: '{0}'",
exe_spec);
return HostProcess();