From 875a16bcfc28ba4959d67e2a4ad853f909d4ab83 Mon Sep 17 00:00:00 2001 From: Robin Giese Date: Mon, 9 Aug 2021 17:16:12 +0200 Subject: [PATCH] [lldb] Fix break introduced in 14735ca The `File::OpenOptions` were renamed; this fixes up a callsite that breaks for macOS builds. (See https://github.com/llvm/llvm-project/commit/14735cab655441ba45c4b88ad82f11267e5fe916) Differential Revision: https://reviews.llvm.org/D107767 --- .../objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm b/lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm index 91d6252aa0b16..3069214e47b84 100644 --- a/lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm +++ b/lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm @@ -425,10 +425,12 @@ static Status HandleFileAction(ProcessLaunchInfo &launch_info, open(file_spec.GetPath().c_str(), oflag, S_IRUSR | S_IWUSR); if (created_fd >= 0) { auto file_options = File::OpenOptions(0); - if ((oflag & O_RDWR) || (oflag & O_RDONLY)) - file_options |= File::eOpenOptionRead; - if ((oflag & O_RDWR) || (oflag & O_RDONLY)) - file_options |= File::eOpenOptionWrite; + if (oflag & O_RDWR) + file_options |= File::eOpenOptionReadWrite; + else if (oflag & O_WRONLY) + file_options |= File::eOpenOptionWriteOnly; + else if (oflag & O_RDONLY) + file_options |= File::eOpenOptionReadOnly; file = std::make_shared(created_fd, file_options, true); [options setValue:[NSNumber numberWithInteger:created_fd] forKey:key]; return error; // Success