[Lldb-commits] [lldb] r212583 - __arm64__ and __aarch64__ #ifdef adjustments

Todd Fiala todd.fiala at gmail.com
Tue Jul 8 18:29:06 PDT 2014


Author: tfiala
Date: Tue Jul  8 20:29:05 2014
New Revision: 212583

URL: http://llvm.org/viewvc/llvm-project?rev=212583&view=rev
Log:
__arm64__ and __aarch64__ #ifdef adjustments

Change by Paul Osmialowski

See http://reviews.llvm.org/D4379 for details.

Modified:
    lldb/trunk/source/Core/Error.cpp
    lldb/trunk/source/Host/common/Host.cpp
    lldb/trunk/source/Host/macosx/Host.mm
    lldb/trunk/source/Host/macosx/Symbols.cpp
    lldb/trunk/source/Interpreter/CommandInterpreter.cpp
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/main.m
    lldb/trunk/tools/debugserver/source/DNB.cpp
    lldb/trunk/tools/debugserver/source/DNBDefs.h
    lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h
    lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h
    lldb/trunk/tools/debugserver/source/RNBDefs.h
    lldb/trunk/tools/debugserver/source/RNBRemote.cpp

Modified: lldb/trunk/source/Core/Error.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Error.cpp?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/source/Core/Error.cpp (original)
+++ lldb/trunk/source/Core/Error.cpp Tue Jul  8 20:29:05 2014
@@ -21,7 +21,7 @@
 #include <cerrno>
 #include <cstdarg>
 
-#if (defined (__arm__) || defined (__arm64__)) && defined (__APPLE__)
+#if (defined (__arm__) || defined (__arm64__) || defined (__aarch64__)) && defined (__APPLE__)
 #include <SpringBoardServices/SpringBoardServer.h>
 #endif
 

Modified: lldb/trunk/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Tue Jul  8 20:29:05 2014
@@ -1069,7 +1069,7 @@ Host::GetLLDBPath (PathType path_type, F
                     if (framework_pos)
                     {
                         framework_pos += strlen("LLDB.framework");
-#if defined (__arm__) || defined (__arm64__)
+#if defined (__arm__) || defined (__arm64__) || defined (__aarch64__)
                         // Shallow bundle
                         *framework_pos = '\0';
 #else

Modified: lldb/trunk/source/Host/macosx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/Host.mm Tue Jul  8 20:29:05 2014
@@ -228,7 +228,7 @@ Host::ResolveExecutableInBundle (FileSpe
 lldb::pid_t
 Host::LaunchApplication (const FileSpec &app_file_spec)
 {
-#if defined (__arm__) || defined(__arm64__)
+#if defined (__arm__) || defined(__arm64__) || defined(__aarch64__)
     return LLDB_INVALID_PROCESS_ID;
 #else
     char app_path[PATH_MAX];
@@ -321,7 +321,7 @@ WaitForProcessToSIGSTOP (const lldb::pid
     }
     return false;
 }
-#if !defined(__arm__) && !defined(__arm64__)
+#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
 
 //static lldb::pid_t
 //LaunchInNewTerminalWithCommandFile 
@@ -669,7 +669,7 @@ LaunchInNewTerminalWithAppleScript (cons
     return error;
 }
 
-#endif // #if !defined(__arm__)
+#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
 
 
 // On MacOSX CrashReporter will display a string for each shared library if
@@ -728,7 +728,7 @@ Host::SetCrashDescription (const char *c
 bool
 Host::OpenFileInExternalEditor (const FileSpec &file_spec, uint32_t line_no)
 {
-#if defined(__arm__) || defined(__arm64__)
+#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
     return false;
 #else
     // We attach this to an 'odoc' event to specify a particular selection
@@ -837,7 +837,7 @@ Host::OpenFileInExternalEditor (const Fi
     }
 
     return true;
-#endif // #if !defined(__arm__)
+#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
 }
 
 
@@ -1507,7 +1507,7 @@ Host::LaunchProcess (ProcessLaunchInfo &
     
     if (launch_info.GetFlags().Test (eLaunchFlagLaunchInTTY))
     {
-#if !defined(__arm__) && !defined(__arm64__)
+#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
         return LaunchInNewTerminalWithAppleScript (exe_path, launch_info);
 #else
         error.SetErrorString ("launching a process in a new terminal is not supported on iOS devices");

Modified: lldb/trunk/source/Host/macosx/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Symbols.cpp?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Symbols.cpp (original)
+++ lldb/trunk/source/Host/macosx/Symbols.cpp Tue Jul  8 20:29:05 2014
@@ -41,7 +41,7 @@ using namespace lldb;
 using namespace lldb_private;
 using namespace llvm::MachO;
 
-#if !defined (__arm__) && !defined (__arm64__) // No DebugSymbols on the iOS devices
+#if !defined (__arm__) && !defined (__arm64__) && !defined (__aarch64__) // No DebugSymbols on the iOS devices
 extern "C" {
 
 CFURLRef DBGCopyFullDSYMURLForUUID (CFUUIDRef uuid, CFURLRef exec_url);
@@ -293,7 +293,7 @@ LocateMacOSXFilesUsingDebugSymbols
     if (out_dsym_fspec)
         out_dsym_fspec->Clear();
 
-#if !defined (__arm__) && !defined (__arm64__) // No DebugSymbols on the iOS devices
+#if !defined (__arm__) && !defined (__arm64__) && !defined (__aarch64__) // No DebugSymbols on the iOS devices
 
     const UUID *uuid = module_spec.GetUUIDPtr();
     const ArchSpec *arch = module_spec.GetArchitecturePtr();
@@ -461,7 +461,7 @@ LocateMacOSXFilesUsingDebugSymbols
             }
         }
     }
-#endif // #if !defined (__arm__)
+#endif // #if !defined (__arm__) && !defined (__arm64__) && !defined (__aarch64__)
 
     return items_found;
 }

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Tue Jul  8 20:29:05 2014
@@ -327,7 +327,7 @@ CommandInterpreter::Initialize ()
     if (cmd_obj_sp)
     {
         alias_arguments_vector_sp.reset (new OptionArgVector);
-#if defined (__arm__) || defined (__arm64__)
+#if defined (__arm__) || defined (__arm64__) || defined (__aarch64__)
         ProcessAliasOptionsArgs (cmd_obj_sp, "--", alias_arguments_vector_sp);
 #else
         ProcessAliasOptionsArgs (cmd_obj_sp, "--shell=" LLDB_DEFAULT_SHELL " --", alias_arguments_vector_sp);

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Tue Jul  8 20:29:05 2014
@@ -45,7 +45,7 @@
 
 #include "ObjectFileMachO.h"
 
-#if defined (__APPLE__) && (defined (__arm__) || defined (__arm64__))
+#if defined (__APPLE__) && (defined (__arm__) || defined (__arm64__) || defined (__aarch64__))
 // GetLLDBSharedCacheUUID() needs to call dlsym()
 #include <dlfcn.h>
 #endif
@@ -2043,7 +2043,7 @@ ObjectFileMachO::ParseSymtab ()
 
                 bool data_was_read = false;
 
-#if defined (__APPLE__) && (defined (__arm__) || defined (__arm64__))
+#if defined (__APPLE__) && (defined (__arm__) || defined (__arm64__) || defined (__aarch64__))
                 if (m_header.flags & 0x80000000u && process->GetAddressByteSize() == sizeof (void*))
                 {
                     // This mach-o memory file is in the dyld shared cache. If this
@@ -2302,7 +2302,7 @@ ObjectFileMachO::ParseSymtab ()
             }
         }
 
-#if defined (__APPLE__) && (defined (__arm__) || defined (__arm64__))
+#if defined (__APPLE__) && (defined (__arm__) || defined (__arm64__) || defined (__aarch64__))
 
         // Some recent builds of the dyld_shared_cache (hereafter: DSC) have been optimized by moving LOCAL
         // symbols out of the memory mapped portion of the DSC. The symbol information has all been retained,
@@ -4905,7 +4905,7 @@ UUID
 ObjectFileMachO::GetLLDBSharedCacheUUID ()
 {
     UUID uuid;
-#if defined (__APPLE__) && (defined (__arm__) || defined (__arm64__))
+#if defined (__APPLE__) && (defined (__arm__) || defined (__arm64__) || defined (__aarch64__))
     uint8_t *(*dyld_get_all_image_infos)(void);
     dyld_get_all_image_infos = (uint8_t*(*)()) dlsym (RTLD_DEFAULT, "_dyld_get_all_image_infos");
     if (dyld_get_all_image_infos)

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp Tue Jul  8 20:29:05 2014
@@ -650,7 +650,7 @@ PlatformDarwinKernel::ExamineKextForMatc
 bool
 PlatformDarwinKernel::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch)
 {
-#if defined (__arm__) || defined (__arm64__)
+#if defined (__arm__) || defined (__arm64__) || defined (__aarch64__)
     return ARMGetSupportedArchitectureAtIndex (idx, arch);
 #else
     return x86GetSupportedArchitectureAtIndex (idx, arch);

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp Tue Jul  8 20:29:05 2014
@@ -312,7 +312,7 @@ PlatformMacOSX::GetFileWithUUID (const l
 bool
 PlatformMacOSX::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch)
 {
-#if defined (__arm__) || defined (__arm64__)
+#if defined (__arm__) || defined (__arm64__) || defined (__aarch64__)
     return ARMGetSupportedArchitectureAtIndex (idx, arch);
 #else
     return x86GetSupportedArchitectureAtIndex (idx, arch);

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp Tue Jul  8 20:29:05 2014
@@ -1113,7 +1113,7 @@ RegisterContextDarwin_arm64::ConvertRegi
 uint32_t
 RegisterContextDarwin_arm64::NumSupportedHardwareWatchpoints ()
 {
-#if defined (__arm64__)
+#if defined (__arm64__) || defined (__aarch64__)
     // autodetect how many watchpoints are supported dynamically...
     static uint32_t g_num_supported_hw_watchpoints = UINT32_MAX;
     if (g_num_supported_hw_watchpoints == UINT32_MAX)

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp Tue Jul  8 20:29:05 2014
@@ -149,7 +149,7 @@ RegisterContextMacOSXFrameBackchain::Rea
 
             // TOOD: need a better way to detect when "long double" types are
             // the same bytes size as "double"
-#if !defined(__arm__) && !defined(__arm64__) && !defined(_MSC_VER) && !defined(__mips__)
+#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__) && !defined(_MSC_VER) && !defined(__mips__)
         case sizeof (long double):
             if (sizeof (long double) == sizeof(uint32_t))
             {

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp Tue Jul  8 20:29:05 2014
@@ -1253,21 +1253,21 @@ GDBRemoteCommunicationServer::Handle_qHo
     }
 #if defined(__APPLE__)
 
-#if defined(__arm__) || defined(__arm64__)
+#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
     // For iOS devices, we are connected through a USB Mux so we never pretend
     // to actually have a hostname as far as the remote lldb that is connecting
     // to this lldb-platform is concerned
     response.PutCString ("hostname:");
     response.PutCStringAsRawHex8("127.0.0.1");
     response.PutChar(';');
-#else   // #if defined(__arm__) || defined(__arm64__)
+#else   // #if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
     if (Host::GetHostname (s))
     {
         response.PutCString ("hostname:");
         response.PutCStringAsRawHex8(s.c_str());
         response.PutChar(';');
     }
-#endif  // #if defined(__arm__) || defined(__arm64__)
+#endif  // #if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
 
 #else   // #if defined(__APPLE__)
     if (Host::GetHostname (s))

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Tue Jul  8 20:29:05 2014
@@ -181,7 +181,7 @@ namespace {
 #define HIGH_PORT   (49151u)
 #endif
 
-#if defined(__APPLE__) && (defined(__arm__) || defined(__arm64__))
+#if defined(__APPLE__) && (defined(__arm__) || defined(__arm64__) || defined(__aarch64__))
 static bool rand_initialized = false;
 
 static inline uint16_t
@@ -2701,7 +2701,7 @@ ProcessGDBRemote::LaunchAndConnectToDebu
         debugserver_launch_info.SetMonitorProcessCallback (MonitorDebugserverProcess, this, false);
         debugserver_launch_info.SetUserID(process_info.GetUserID());
 
-#if defined (__APPLE__) && (defined (__arm__) || defined (__arm64__))
+#if defined (__APPLE__) && (defined (__arm__) || defined (__arm64__) || defined (__aarch64__))
         // On iOS, still do a local connection using a random port
         const char *hostname = "127.0.0.1";
         uint16_t port = get_random_port ();

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/main.m
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/main.m?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/main.m (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/main.m Tue Jul  8 20:29:05 2014
@@ -10,7 +10,7 @@
 #import <Foundation/Foundation.h>
 
 #if defined(__APPLE__)
-#if defined(__arm__) || defined(__arm64__)
+#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
 #define IOS
 #endif
 #endif

Modified: lldb/trunk/tools/debugserver/source/DNB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNB.cpp?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/DNB.cpp (original)
+++ lldb/trunk/tools/debugserver/source/DNB.cpp Tue Jul  8 20:29:05 2014
@@ -2309,7 +2309,7 @@ DNBInitialize()
 #if defined (__i386__) || defined (__x86_64__)
     DNBArchImplI386::Initialize();
     DNBArchImplX86_64::Initialize();
-#elif defined (__arm__) || defined (__arm64__)
+#elif defined (__arm__) || defined (__arm64__) || defined (__aarch64__)
     DNBArchMachARM::Initialize();
     DNBArchMachARM64::Initialize();
 #endif
@@ -2329,7 +2329,7 @@ DNBSetArchitecture (const char *arch)
             return DNBArchProtocol::SetArchitecture (CPU_TYPE_I386);
         else if ((strcasecmp (arch, "x86_64") == 0) || (strcasecmp (arch, "x86_64h") == 0))
             return DNBArchProtocol::SetArchitecture (CPU_TYPE_X86_64);
-        else if (strstr (arch, "arm64") == arch || strstr (arch, "armv8") == arch)
+        else if (strstr (arch, "arm64") == arch || strstr (arch, "armv8") == arch || strstr (arch, "aarch64") == arch)
             return DNBArchProtocol::SetArchitecture (CPU_TYPE_ARM64);
         else if (strstr (arch, "arm") == arch)
             return DNBArchProtocol::SetArchitecture (CPU_TYPE_ARM);

Modified: lldb/trunk/tools/debugserver/source/DNBDefs.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNBDefs.h?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/DNBDefs.h (original)
+++ lldb/trunk/tools/debugserver/source/DNBDefs.h Tue Jul  8 20:29:05 2014
@@ -23,7 +23,7 @@
 //----------------------------------------------------------------------
 // Define nub_addr_t and the invalid address value from the architecture
 //----------------------------------------------------------------------
-#if defined (__x86_64__) || defined (__ppc64__) || defined (__arm64__)
+#if defined (__x86_64__) || defined (__ppc64__) || defined (__arm64__) || defined (__aarch64__)
 
 //----------------------------------------------------------------------
 // 64 bit address architectures

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp Tue Jul  8 20:29:05 2014
@@ -323,7 +323,7 @@ MachThreadList::UpdateThreadList(MachPro
             DNBArchProtocol::SetArchitecture(CPU_TYPE_X86_64);
         else
             DNBArchProtocol::SetArchitecture(CPU_TYPE_I386);
-#elif defined (__arm__) || defined (__arm64__)
+#elif defined (__arm__) || defined (__arm64__) || defined (__aarch64__)
         if (m_is_64_bit)
             DNBArchProtocol::SetArchitecture(CPU_TYPE_ARM64);
         else

Modified: lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp Tue Jul  8 20:29:05 2014
@@ -11,7 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#if defined (__arm__) || defined (__arm64__)
+#if defined (__arm__) || defined (__arm64__) || defined (__aarch64__)
 
 #include "MacOSX/arm/DNBArchImpl.h"
 #include "MacOSX/MachProcess.h"
@@ -286,7 +286,7 @@ DNBArchMachARM::GetDBGState(bool force)
         return KERN_SUCCESS;
 
     // Read the registers from our thread
-#if defined (ARM_DEBUG_STATE32) && defined (__arm64__)
+#if defined (ARM_DEBUG_STATE32) && (defined (__arm64__) || defined (__aarch64__))
     mach_msg_type_number_t count = ARM_DEBUG_STATE32_COUNT;
     kern_return_t kret = ::thread_get_state(m_thread->MachPortNumber(), ARM_DEBUG_STATE32, (thread_state_t)&m_state.dbg, &count);
 #else
@@ -332,7 +332,7 @@ kern_return_t
 DNBArchMachARM::SetDBGState(bool also_set_on_task)
 {
     int set = e_regSetDBG;
-#if defined (ARM_DEBUG_STATE32) && defined (__arm64__)
+#if defined (ARM_DEBUG_STATE32) && (defined (__arm64__) || defined (__aarch64__))
     kern_return_t kret = ::thread_set_state (m_thread->MachPortNumber(), ARM_DEBUG_STATE32, (thread_state_t)&m_state.dbg, ARM_DEBUG_STATE32_COUNT);
     if (also_set_on_task)
     {
@@ -549,7 +549,7 @@ DNBArchMachARM::EnableHardwareSingleStep
 // an armv8 device, regardless of whether it was built for arch arm or arch arm64,
 // it needs to use the MDSCR_EL1 SS bit to single instruction step.
 
-#if defined (__arm64__)
+#if defined (__arm64__) || defined (__aarch64__)
     if (enable)
     {
         DNBLogThreadedIf(LOG_STEP, "%s: Setting MDSCR_EL1 Single Step bit at pc 0x%llx", __FUNCTION__, (uint64_t) m_state.context.gpr.__pc);
@@ -723,7 +723,7 @@ DNBArchMachARM::NumSupportedHardwareBrea
         }
         else
         {
-#if !defined (__arm64__)
+#if !defined (__arm64__) && !defined (__aarch64__)
             // Read the DBGDIDR to get the number of available hardware breakpoints
             // However, in some of our current armv7 processors, hardware
             // breakpoints/watchpoints were not properly connected. So detect those
@@ -784,7 +784,7 @@ DNBArchMachARM::NumSupportedHardwareWatc
         }
         else
         {
-#if !defined (__arm64__)
+#if !defined (__arm64__) && !defined (__aarch64__)
             // Read the DBGDIDR to get the number of available hardware breakpoints
             // However, in some of our current armv7 processors, hardware
             // breakpoints/watchpoints were not properly connected. So detect those
@@ -928,7 +928,7 @@ DNBArchMachARM::DisableHardwareBreakpoin
 // armv8 device, armv7 processes can watch dwords.  But on a genuine armv7
 // device I tried, only word watchpoints are supported.
 
-#if defined (__arm64__)
+#if defined (__arm64__) || defined (__aarch64__)
 #define WATCHPOINTS_ARE_DWORD 1
 #else
 #undef WATCHPOINTS_ARE_DWORD

Modified: lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h Tue Jul  8 20:29:05 2014
@@ -14,7 +14,7 @@
 #ifndef __DebugNubArchMachARM_h__
 #define __DebugNubArchMachARM_h__
 
-#if defined (__arm__) || defined (__arm64__)
+#if defined (__arm__) || defined (__arm64__) || defined (__aarch64__)
 
 #include "DNBArch.h"
 
@@ -89,7 +89,7 @@ public:
     virtual bool            StepNotComplete ();
     virtual uint32_t        GetHardwareWatchpointHit(nub_addr_t &addr);
 
-#if defined (ARM_DEBUG_STATE32) && defined (__arm64__)
+#if defined (ARM_DEBUG_STATE32) && (defined (__arm64__) || defined (__aarch64__))
     typedef arm_debug_state32_t DBG;
 #else
     typedef arm_debug_state_t DBG;
@@ -115,7 +115,7 @@ protected:
         e_regSetGPR = ARM_THREAD_STATE,
         e_regSetVFP = ARM_VFP_STATE,
         e_regSetEXC = ARM_EXCEPTION_STATE,
-#if defined (ARM_DEBUG_STATE32) && defined (__arm64__)
+#if defined (ARM_DEBUG_STATE32) && (defined (__arm64__) || defined (__aarch64__))
         e_regSetDBG = ARM_DEBUG_STATE32,
 #else
         e_regSetDBG = ARM_DEBUG_STATE,

Modified: lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp Tue Jul  8 20:29:05 2014
@@ -11,7 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#if defined (__arm__) || defined (__arm64__)
+#if defined (__arm__) || defined (__arm64__) || defined (__aarch64__)
 
 #include "MacOSX/arm64/DNBArchImplARM64.h"
 
@@ -233,7 +233,7 @@ DNBArchMachARM64::GetVFPState(bool force
     kern_return_t kret = ::thread_get_state(m_thread->MachPortNumber(), ARM_NEON_STATE64, (thread_state_t)&m_state.context.vfp, &count);
     if (DNBLogEnabledForAny (LOG_THREAD))
     {
-#if defined (__arm64__)
+#if defined (__arm64__) || defined (__aarch64__)
         DNBLogThreaded("thread_get_state(0x%4.4x, %u, &vfp, %u) => 0x%8.8x (count = %u) regs"
                        "\n   q0  = 0x%16.16llx%16.16llx"
                        "\n   q1  = 0x%16.16llx%16.16llx"
@@ -1506,7 +1506,7 @@ const char *g_invalidate_v29[] {"v29", "
 const char *g_invalidate_v30[] {"v30", "d30", "s30", NULL };
 const char *g_invalidate_v31[] {"v31", "d31", "s31", NULL };
 
-#if defined (__arm64__)
+#if defined (__arm64__) || defined (__aarch64__)
 #define VFP_V_OFFSET_IDX(idx) (offsetof (DNBArchMachARM64::FPU, __v) + (idx * 16) + offsetof (DNBArchMachARM64::Context, vfp))
 #else
 #define VFP_V_OFFSET_IDX(idx) (offsetof (DNBArchMachARM64::FPU, opaque) + (idx * 16) + offsetof (DNBArchMachARM64::Context, vfp))
@@ -1753,7 +1753,7 @@ DNBArchMachARM64::GetRegisterValue(int s
 
             if (reg >= vfp_v0 && reg <= vfp_v31)
             {
-#if defined (__arm64__)
+#if defined (__arm64__) || defined (__aarch64__)
                 memcpy (&value->value.v_uint8, &m_state.context.vfp.__v[reg - vfp_v0], 16);
 #else
                 memcpy (&value->value.v_uint8, ((uint8_t *) &m_state.context.vfp.opaque) + ((reg - vfp_v0) * 16), 16);
@@ -1762,7 +1762,7 @@ DNBArchMachARM64::GetRegisterValue(int s
             }
             else if (reg == vfp_fpsr)
             {
-#if defined (__arm64__)
+#if defined (__arm64__) || defined (__aarch64__)
                 memcpy (&value->value.uint32, &m_state.context.vfp.__fpsr, 4);
 #else
                 memcpy (&value->value.uint32, ((uint8_t *) &m_state.context.vfp.opaque) + (32 * 16) + 0, 4);
@@ -1771,7 +1771,7 @@ DNBArchMachARM64::GetRegisterValue(int s
             }
             else if (reg == vfp_fpcr)
             {
-#if defined (__arm64__)
+#if defined (__arm64__) || defined (__aarch64__)
                 memcpy (&value->value.uint32, &m_state.context.vfp.__fpcr, 4);
 #else
                 memcpy (&value->value.uint32, ((uint8_t *) &m_state.context.vfp.opaque) + (32 * 16) + 4, 4);
@@ -1780,7 +1780,7 @@ DNBArchMachARM64::GetRegisterValue(int s
             }
             else if (reg >= vfp_s0 && reg <= vfp_s31)
             {
-#if defined (__arm64__)
+#if defined (__arm64__) || defined (__aarch64__)
                 memcpy (&value->value.v_uint8, &m_state.context.vfp.__v[reg - vfp_s0], 4);
 #else
                 memcpy (&value->value.v_uint8, ((uint8_t *) &m_state.context.vfp.opaque) + ((reg - vfp_s0) * 16), 4);
@@ -1789,7 +1789,7 @@ DNBArchMachARM64::GetRegisterValue(int s
             }
             else if (reg >= vfp_d0 && reg <= vfp_d31)
             {
-#if defined (__arm64__)
+#if defined (__arm64__) || defined (__aarch64__)
                 memcpy (&value->value.v_uint8, &m_state.context.vfp.__v[reg - vfp_d0], 8);
 #else
                 memcpy (&value->value.v_uint8, ((uint8_t *) &m_state.context.vfp.opaque) + ((reg - vfp_d0) * 16), 8);
@@ -1851,7 +1851,7 @@ DNBArchMachARM64::SetRegisterValue(int s
         case e_regSetVFP:
             if (reg >= vfp_v0 && reg <= vfp_v31)
             {
-#if defined (__arm64__)
+#if defined (__arm64__) || defined (__aarch64__)
                 memcpy (&m_state.context.vfp.__v[reg - vfp_v0], &value->value.v_uint8, 16);
 #else
                 memcpy (((uint8_t *) &m_state.context.vfp.opaque) + ((reg - vfp_v0) * 16), &value->value.v_uint8, 16);
@@ -1860,7 +1860,7 @@ DNBArchMachARM64::SetRegisterValue(int s
             }
             else if (reg == vfp_fpsr)
             {
-#if defined (__arm64__)
+#if defined (__arm64__) || defined (__aarch64__)
                 memcpy (&m_state.context.vfp.__fpsr, &value->value.uint32, 4);
 #else
                 memcpy (((uint8_t *) &m_state.context.vfp.opaque) + (32 * 16) + 0, &value->value.uint32, 4);
@@ -1869,7 +1869,7 @@ DNBArchMachARM64::SetRegisterValue(int s
             }
             else if (reg == vfp_fpcr)
             {
-#if defined (__arm64__)
+#if defined (__arm64__) || defined (__aarch64__)
                 memcpy (&m_state.context.vfp.__fpcr, &value->value.uint32, 4);
 #else
                 memcpy (((uint8_t *) m_state.context.vfp.opaque) + (32 * 16) + 4, &value->value.uint32, 4);
@@ -1878,7 +1878,7 @@ DNBArchMachARM64::SetRegisterValue(int s
             }
             else if (reg >= vfp_s0 && reg <= vfp_s31)
             {
-#if defined (__arm64__)
+#if defined (__arm64__) || defined (__aarch64__)
                 memcpy (&m_state.context.vfp.__v[reg - vfp_s0], &value->value.v_uint8, 4);
 #else
                 memcpy (((uint8_t *) &m_state.context.vfp.opaque) + ((reg - vfp_s0) * 16), &value->value.v_uint8, 4);
@@ -1887,7 +1887,7 @@ DNBArchMachARM64::SetRegisterValue(int s
             }
             else if (reg >= vfp_d0 && reg <= vfp_d31)
             {
-#if defined (__arm64__)
+#if defined (__arm64__) || defined (__aarch64__)
                 memcpy (&m_state.context.vfp.__v[reg - vfp_d0], &value->value.v_uint8, 8);
 #else
                 memcpy (((uint8_t *) &m_state.context.vfp.opaque) + ((reg - vfp_d0) * 16), &value->value.v_uint8, 8);
@@ -2090,4 +2090,4 @@ DNBArchMachARM64::RestoreRegisterState (
 
 
 #endif  // #if defined (ARM_THREAD_STATE64_COUNT)
-#endif  // #if defined (__arm__)
+#endif  // #if defined (__arm__) || defined (__arm64__) || defined (__aarch64__)

Modified: lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h Tue Jul  8 20:29:05 2014
@@ -11,7 +11,7 @@
 #ifndef __DNBArchImplARM64_h__
 #define __DNBArchImplARM64_h__
 
-#if defined (__arm__) || defined (__arm64__)
+#if defined (__arm__) || defined (__arm64__) || defined (__aarch64__)
 
 #include <map>
 #include <mach/thread_status.h>

Modified: lldb/trunk/tools/debugserver/source/RNBDefs.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBDefs.h?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/RNBDefs.h (original)
+++ lldb/trunk/tools/debugserver/source/RNBDefs.h Tue Jul  8 20:29:05 2014
@@ -45,7 +45,7 @@ extern "C" const double debugserverVersi
 
 #define RNB_ARCH    "ppc"
 
-#elif defined (__arm64__)
+#elif defined (__arm64__) || defined (__aarch64__)
 
 #define RNB_ARCH    "arm64"
 

Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=212583&r1=212582&r2=212583&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original)
+++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Tue Jul  8 20:29:05 2014
@@ -798,7 +798,7 @@ RNBRemote::ThreadFunctionReadRemoteData(
 static cpu_type_t
 best_guess_cpu_type ()
 {
-#if defined (__arm__) || defined (__arm64__)
+#if defined (__arm__) || defined (__arm64__) || defined (__aarch64__)
     if (sizeof (char *) == 8)
     {
         return CPU_TYPE_ARM64;
@@ -4488,7 +4488,7 @@ RNBRemote::HandlePacket_qProcessInfo (co
     }
 #elif defined (__arm__)
     rep << "ptrsize:4;";
-#elif defined (__arm64__) && defined (ARM_UNIFIED_THREAD_STATE)
+#elif (defined (__arm64__) || defined (__aarch64__)) && defined (ARM_UNIFIED_THREAD_STATE)
     nub_thread_t thread = DNBProcessGetCurrentThreadMachPort (pid);
     kern_return_t kr;
     arm_unified_thread_state_t gp_regs;





More information about the lldb-commits mailing list