[Lldb-commits] [lldb] r348779 - [Host] Use FileSystem wrapper
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Mon Dec 10 10:17:39 PST 2018
Author: jdevlieghere
Date: Mon Dec 10 10:17:39 2018
New Revision: 348779
URL: http://llvm.org/viewvc/llvm-project?rev=348779&view=rev
Log:
[Host] Use FileSystem wrapper
Fixes Host.mm to use the FileSystem class instead of making native calls
to check if a file exists.
Modified:
lldb/trunk/source/Host/macosx/objcxx/Host.mm
Modified: lldb/trunk/source/Host/macosx/objcxx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/objcxx/Host.mm?rev=348779&r1=348778&r2=348779&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/objcxx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/objcxx/Host.mm Mon Dec 10 10:17:39 2018
@@ -1273,21 +1273,19 @@ static bool ShouldLaunchUsingXPC(Process
Status Host::LaunchProcess(ProcessLaunchInfo &launch_info) {
Status error;
+
+ FileSystem &fs = FileSystem::Instance();
FileSpec exe_spec(launch_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)) {
+
+ if (!fs.Exists(exe_spec))
FileSystem::Instance().ResolveExecutableLocation(exe_spec);
- status(exe_spec.GetPath(), stats);
- }
- if (!exists(stats)) {
+
+ if (!fs.Exists(exe_spec)) {
error.SetErrorStringWithFormatv("executable doesn't exist: '{0}'",
- launch_info.GetExecutableFile());
+ exe_spec);
return error;
}
More information about the lldb-commits
mailing list