From bf65f19bce88fd9f1a74154d92afe37193ecd7a5 Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Mon, 10 Feb 2020 14:33:44 -0800 Subject: [PATCH] Revert "[Host.mm] Check for the right macro instead of inlining it" This breaks macOS, because TARGET_OS_EMBEDDED is always defined. Thanks to Jason Molenda for pointing this out. Revert "Do not define AcceptPIDFromInferior when it will not be used" This reverts commit d23c15a687ff15327b88fa64da3184395012c2dc. This reverts commit 936d1427da1432d724dfa5851097347bcdf7c521. --- lldb/source/Host/macosx/objcxx/Host.mm | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lldb/source/Host/macosx/objcxx/Host.mm b/lldb/source/Host/macosx/objcxx/Host.mm index 778cf3d90869..233734109c41 100644 --- a/lldb/source/Host/macosx/objcxx/Host.mm +++ b/lldb/source/Host/macosx/objcxx/Host.mm @@ -9,10 +9,9 @@ #include "lldb/Host/Host.h" #include -#include // On device doesn't have supporty for XPC. -#if defined(__APPLE__) && defined(TARGET_OS_EMBEDDED) +#if defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) #define NO_XPC_SERVICES 1 #endif @@ -136,8 +135,6 @@ bool Host::ResolveExecutableInBundle(FileSpec &file) { return false; } -#if !NO_XPC_SERVICES - static void *AcceptPIDFromInferior(void *arg) { const char *connect_url = (const char *)arg; ConnectionFileDescriptor file_conn; @@ -156,6 +153,8 @@ static void *AcceptPIDFromInferior(void *arg) { return NULL; } +#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__) + const char *applscript_in_new_tty = "tell application \"Terminal\"\n" " activate\n" " do script \"/bin/bash -c '%s';exit\"\n" @@ -308,11 +307,11 @@ LaunchInNewTerminalWithAppleScript(const char *exe_path, return error; } -#endif // #if !NO_XPC_SERVICES +#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__) bool Host::OpenFileInExternalEditor(const FileSpec &file_spec, uint32_t line_no) { -#if NO_XPC_SERVICES +#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__) return false; #else // We attach this to an 'odoc' event to specify a particular selection @@ -405,7 +404,7 @@ bool Host::OpenFileInExternalEditor(const FileSpec &file_spec, } return true; -#endif // #if !NO_XPC_SERVICES +#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__) } Environment Host::GetEnvironment() { return Environment(*_NSGetEnviron()); } @@ -1264,7 +1263,7 @@ Status Host::LaunchProcess(ProcessLaunchInfo &launch_info) { } if (launch_info.GetFlags().Test(eLaunchFlagLaunchInTTY)) { -#if !NO_XPC_SERVICES +#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__) return LaunchInNewTerminalWithAppleScript(exe_spec.GetPath().c_str(), launch_info); #else