diff options
Diffstat (limited to 'lldb/source/Plugins')
16 files changed, 51 insertions, 13 deletions
diff --git a/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp b/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp index a9c57dfdb24..6473ccf9a19 100644 --- a/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp +++ b/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp @@ -1665,7 +1665,8 @@ ABIMacOSX_arm64::CreateInstance(ProcessSP process_sp, const ArchSpec &arch) { const llvm::Triple::VendorType vendor_type = arch.GetTriple().getVendor(); if (vendor_type == llvm::Triple::Apple) { - if (arch_type == llvm::Triple::aarch64) { + if (arch_type == llvm::Triple::aarch64 || + arch_type == llvm::Triple::aarch64_32) { return ABISP( new ABIMacOSX_arm64(std::move(process_sp), MakeMCRegisterInfo(arch))); } diff --git a/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp b/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp index 781d71c6c05..89a1f2b3cf0 100644 --- a/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp +++ b/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp @@ -1668,7 +1668,8 @@ ABISysV_arm64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) const llvm::Triple::VendorType vendor_type = arch.GetTriple().getVendor(); if (vendor_type != llvm::Triple::Apple) { - if (arch_type == llvm::Triple::aarch64) { + if (arch_type == llvm::Triple::aarch64 || + arch_type == llvm::Triple::aarch64_32) { return ABISP( new ABISysV_arm64(std::move(process_sp), MakeMCRegisterInfo(arch))); } diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp index 87ba029f59e..28c9de2c1e9 100644 --- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp +++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp @@ -1189,10 +1189,12 @@ DisassemblerLLVMC::DisassemblerLLVMC(const ArchSpec &arch, // If any AArch64 variant, enable the ARMv8.5 ISA with SVE extensions so we // can disassemble newer instructions. - if (triple.getArch() == llvm::Triple::aarch64) + if (triple.getArch() == llvm::Triple::aarch64 || + triple.getArch() == llvm::Triple::aarch64_32) features_str += "+v8.5a,+sve2"; - if (triple.getArch() == llvm::Triple::aarch64 + if ((triple.getArch() == llvm::Triple::aarch64 || + triple.getArch() == llvm::Triple::aarch64_32) && triple.getVendor() == llvm::Triple::Apple) { cpu = "apple-latest"; } diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp index 4d7c5623c79..654585cb35e 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp @@ -234,7 +234,8 @@ void DynamicLoaderMacOSXDYLD::DoInitialImageFetch() { ReadDYLDInfoFromMemoryAndSetNotificationCallback(0x7fff5fc00000ull); } else if (exe_arch.GetMachine() == llvm::Triple::arm || exe_arch.GetMachine() == llvm::Triple::thumb || - exe_arch.GetMachine() == llvm::Triple::aarch64) { + exe_arch.GetMachine() == llvm::Triple::aarch64 || + exe_arch.GetMachine() == llvm::Triple::aarch64_32) { ReadDYLDInfoFromMemoryAndSetNotificationCallback(0x2fe00000); } else { ReadDYLDInfoFromMemoryAndSetNotificationCallback(0x8fe00000); diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp index ee890ac08e6..21cb33402e7 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp @@ -302,7 +302,8 @@ bool ClangExpressionSourceCode::GetText( Target *target = exe_ctx.GetTargetPtr(); if (target) { - if (target->GetArchitecture().GetMachine() == llvm::Triple::aarch64) { + if (target->GetArchitecture().GetMachine() == llvm::Triple::aarch64 || + target->GetArchitecture().GetMachine() == llvm::Triple::aarch64_32) { target_specific_defines = "typedef bool BOOL;\n"; } if (target->GetArchitecture().GetMachine() == llvm::Triple::x86_64) { diff --git a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp index 6ab968539c4..3e06fca2504 100644 --- a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp +++ b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp @@ -149,7 +149,8 @@ EmulateInstructionARM64::CreateInstance(const ArchSpec &arch, InstructionType inst_type) { if (EmulateInstructionARM64::SupportsEmulatingInstructionsOfTypeStatic( inst_type)) { - if (arch.GetTriple().getArch() == llvm::Triple::aarch64) { + if (arch.GetTriple().getArch() == llvm::Triple::aarch64 || + arch.GetTriple().getArch() == llvm::Triple::aarch64_32) { return new EmulateInstructionARM64(arch); } } diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index be02eaec2d3..fa8064690b3 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -5189,6 +5189,7 @@ lldb_private::Address ObjectFileMachO::GetEntryPointAddress() { } break; case llvm::MachO::CPU_TYPE_ARM64: + case llvm::MachO::CPU_TYPE_ARM64_32: if (flavor == 6) // ARM_THREAD_STATE64 from mach/arm/thread_status.h { offset += 256; // This is the offset of pc in the GPR thread state @@ -5469,6 +5470,7 @@ ObjectFileMachO::GetThreadContextAtIndex(uint32_t idx, switch (m_header.cputype) { case llvm::MachO::CPU_TYPE_ARM64: + case llvm::MachO::CPU_TYPE_ARM64_32: reg_ctx_sp = std::make_shared<RegisterContextDarwin_arm64_Mach>(thread, data); break; @@ -6029,6 +6031,7 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp, bool make_core = false; switch (target_arch.GetMachine()) { case llvm::Triple::aarch64: + case llvm::Triple::aarch64_32: case llvm::Triple::arm: case llvm::Triple::thumb: case llvm::Triple::x86: @@ -6131,6 +6134,7 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp, if (thread_sp) { switch (mach_header.cputype) { case llvm::MachO::CPU_TYPE_ARM64: + case llvm::MachO::CPU_TYPE_ARM64_32: RegisterContextDarwin_arm64_Mach::Create_LC_THREAD( thread_sp.get(), LC_THREAD_datas[thread_idx]); break; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp index 241f9eb037e..6a3e6b4cade 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -418,11 +418,10 @@ PlatformDarwin::GetSoftwareBreakpointTrapOpcode(Target &target, llvm::Triple::ArchType machine = target.GetArchitecture().GetMachine(); switch (machine) { + case llvm::Triple::aarch64_32: case llvm::Triple::aarch64: { - // TODO: fix this with actual darwin breakpoint opcode for arm64. - // right now debugging uses the Z packets with GDB remote so this is not - // needed, but the size needs to be correct... - static const uint8_t g_arm64_breakpoint_opcode[] = {0xFE, 0xDE, 0xFF, 0xE7}; + // 'brk #0' or 0xd4200000 in BE byte order + static const uint8_t g_arm64_breakpoint_opcode[] = {0x00, 0x00, 0x20, 0xD4}; trap_opcode = g_arm64_breakpoint_opcode; trap_opcode_size = sizeof(g_arm64_breakpoint_opcode); } break; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp index 9fb388c26c7..fa190dbd10f 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp @@ -75,6 +75,7 @@ PlatformSP PlatformRemoteAppleWatch::CreateInstance(bool force, switch (arch->GetMachine()) { case llvm::Triple::arm: case llvm::Triple::aarch64: + case llvm::Triple::aarch64_32: case llvm::Triple::thumb: { const llvm::Triple &triple = arch->GetTriple(); llvm::Triple::VendorType vendor = triple.getVendor(); @@ -176,6 +177,9 @@ bool PlatformRemoteAppleWatch::GetSupportedArchitectureAtIndex(uint32_t idx, case 6: arch.SetTriple("thumbv7s-apple-watchos"); return true; + case 7: + arch.SetTriple("arm64_32-apple-watchos"); + return true; default: break; } @@ -204,6 +208,9 @@ bool PlatformRemoteAppleWatch::GetSupportedArchitectureAtIndex(uint32_t idx, case 6: arch.SetTriple("thumbv7s-apple-watchos"); return true; + case 7: + arch.SetTriple("arm64_32-apple-watchos"); + return true; default: break; } @@ -229,6 +236,9 @@ bool PlatformRemoteAppleWatch::GetSupportedArchitectureAtIndex(uint32_t idx, case 5: arch.SetTriple("thumbv7s-apple-watchos"); return true; + case 6: + arch.SetTriple("arm64_32-apple-watchos"); + return true; default: break; } @@ -254,6 +264,9 @@ bool PlatformRemoteAppleWatch::GetSupportedArchitectureAtIndex(uint32_t idx, case 5: arch.SetTriple("thumbv7s-apple-watchos"); return true; + case 6: + arch.SetTriple("arm64_32-apple-watchos"); + return true; default: break; } @@ -273,6 +286,9 @@ bool PlatformRemoteAppleWatch::GetSupportedArchitectureAtIndex(uint32_t idx, case 3: arch.SetTriple("thumbv7-apple-watchos"); return true; + case 4: + arch.SetTriple("arm64_32-apple-watchos"); + return true; default: break; } diff --git a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp index 5d3f294599e..a86880af226 100644 --- a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp +++ b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp @@ -536,6 +536,7 @@ void DynamicRegisterInfo::Finalize(const ArchSpec &arch) { if (!generic_regs_specified) { switch (arch.GetMachine()) { case llvm::Triple::aarch64: + case llvm::Triple::aarch64_32: case llvm::Triple::aarch64_be: for (auto ® : m_regs) { if (strcmp(reg.name, "pc") == 0) diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp index 99b897d441b..db1aa1b8b09 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp @@ -109,6 +109,7 @@ RegisterContextPOSIX_arm64::RegisterContextPOSIX_arm64( switch (register_info->m_target_arch.GetMachine()) { case llvm::Triple::aarch64: + case llvm::Triple::aarch64_32: m_reg_info.num_registers = k_num_registers_arm64; m_reg_info.num_gpr_registers = k_num_gpr_registers_arm64; m_reg_info.num_fpr_registers = k_num_fpr_registers_arm64; @@ -184,6 +185,7 @@ RegisterContextPOSIX_arm64::GetRegisterSet(size_t set) { if (IsRegisterSetAvailable(set)) { switch (m_register_info_up->m_target_arch.GetMachine()) { case llvm::Triple::aarch64: + case llvm::Triple::aarch64_32: return &g_reg_sets_arm64[set]; default: assert(false && "Unhandled target architecture."); diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp index f7471526d05..8b367bdc644 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp @@ -57,6 +57,7 @@ static const lldb_private::RegisterInfo * GetRegisterInfoPtr(const lldb_private::ArchSpec &target_arch) { switch (target_arch.GetMachine()) { case llvm::Triple::aarch64: + case llvm::Triple::aarch64_32: return g_register_infos_arm64_le; default: assert(false && "Unhandled target architecture."); @@ -68,6 +69,7 @@ static uint32_t GetRegisterInfoCount(const lldb_private::ArchSpec &target_arch) { switch (target_arch.GetMachine()) { case llvm::Triple::aarch64: + case llvm::Triple::aarch64_32: return static_cast<uint32_t>(sizeof(g_register_infos_arm64_le) / sizeof(g_register_infos_arm64_le[0])); default: diff --git a/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp b/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp index 5cb0db29d60..6d03bd534f3 100644 --- a/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp +++ b/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp @@ -416,6 +416,7 @@ StopInfoSP StopInfoMachException::CreateStopReasonWithMachException( } break; + case llvm::Triple::aarch64_32: case llvm::Triple::aarch64: { if (exc_code == 1 && exc_sub_code == 0) // EXC_ARM_BREAKPOINT { diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 2ac635358d1..c85f491c81d 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1271,6 +1271,7 @@ bool GDBRemoteCommunicationClient::GetHostInfo(bool force) { host_triple.getOS() == llvm::Triple::Darwin) { switch (m_host_arch.GetMachine()) { case llvm::Triple::aarch64: + case llvm::Triple::aarch64_32: case llvm::Triple::arm: case llvm::Triple::thumb: host_triple.setOS(llvm::Triple::IOS); @@ -3182,7 +3183,8 @@ bool GDBRemoteCommunicationClient::AvoidGPackets(ProcessGDBRemote *process) { if (arch.IsValid() && arch.GetTriple().getVendor() == llvm::Triple::Apple && arch.GetTriple().getOS() == llvm::Triple::IOS && - arch.GetTriple().getArch() == llvm::Triple::aarch64) { + (arch.GetTriple().getArch() == llvm::Triple::aarch64 || + arch.GetTriple().getArch() == llvm::Triple::aarch64_32)) { m_avoid_g_packets = eLazyBoolYes; uint32_t gdb_server_version = GetGDBServerProgramVersion(); if (gdb_server_version != 0) { diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp index 20f5c5f9ec9..37980d914dc 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp @@ -231,6 +231,7 @@ GDBRemoteCommunicationServerCommon::Handle_qHostInfo( #else if (host_arch.GetMachine() == llvm::Triple::aarch64 || + host_arch.GetMachine() == llvm::Triple::aarch64_32 || host_arch.GetMachine() == llvm::Triple::aarch64_be || host_arch.GetMachine() == llvm::Triple::arm || host_arch.GetMachine() == llvm::Triple::armeb || host_arch.IsMIPS()) @@ -1243,6 +1244,7 @@ void GDBRemoteCommunicationServerCommon:: case llvm::Triple::arm: case llvm::Triple::thumb: case llvm::Triple::aarch64: + case llvm::Triple::aarch64_32: ostype = "ios"; break; default: diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp index 2bd0234f63e..c06c9527708 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp @@ -637,7 +637,9 @@ bool GDBRemoteRegisterContext::WriteAllRegisterValues( if (m_thread.GetProcess().get()) { const ArchSpec &arch = m_thread.GetProcess()->GetTarget().GetArchitecture(); - if (arch.IsValid() && arch.GetMachine() == llvm::Triple::aarch64 && + if (arch.IsValid() && + (arch.GetMachine() == llvm::Triple::aarch64 || + arch.GetMachine() == llvm::Triple::aarch64_32) && arch.GetTriple().getVendor() == llvm::Triple::Apple && arch.GetTriple().getOS() == llvm::Triple::IOS) { arm64_debugserver = true; |