diff options
Diffstat (limited to 'lldb/source/Plugins')
4 files changed, 26 insertions, 12 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp index 7d8ee9cca9c..9220c2f4f94 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp @@ -382,10 +382,11 @@ DYLDRendezvous::ReadSOEntryFromMemory(lldb::addr_t addr, SOEntry &entry) // FreeBSD and NetBSD (need to validate other OSes). // http://svnweb.freebsd.org/base/head/sys/sys/link_elf.h?revision=217153&view=markup#l57 const ArchSpec &arch = m_process->GetTarget().GetArchitecture(); - if (arch.GetCore() == ArchSpec::eCore_mips64) + if ((arch.GetTriple().getOS() == llvm::Triple::FreeBSD + || arch.GetTriple().getOS() == llvm::Triple::NetBSD) && + (arch.GetMachine() == llvm::Triple::mips || arch.GetMachine() == llvm::Triple::mipsel + || arch.GetMachine() == llvm::Triple::mips64 || arch.GetMachine() == llvm::Triple::mips64el)) { - assert (arch.GetTriple().getOS() == llvm::Triple::FreeBSD || - arch.GetTriple().getOS() == llvm::Triple::NetBSD); addr_t mips_l_offs; if (!(addr = ReadPointer(addr, &mips_l_offs))) return false; diff --git a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp index ea057caeec7..1f07994f8f5 100644 --- a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp +++ b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp @@ -76,7 +76,8 @@ EmulateInstructionMIPS64::CreateInstance (const ArchSpec &arch, InstructionType { if (EmulateInstructionMIPS64::SupportsEmulatingInstructionsOfTypeStatic(inst_type)) { - if (arch.GetTriple().getArch() == llvm::Triple::mips64) + if (arch.GetTriple().getArch() == llvm::Triple::mips64 + || arch.GetTriple().getArch() == llvm::Triple::mips64el) { std::auto_ptr<EmulateInstructionMIPS64> emulate_insn_ap (new EmulateInstructionMIPS64 (arch)); if (emulate_insn_ap.get()) @@ -90,7 +91,8 @@ EmulateInstructionMIPS64::CreateInstance (const ArchSpec &arch, InstructionType bool EmulateInstructionMIPS64::SetTargetTriple (const ArchSpec &arch) { - if (arch.GetTriple().getArch () == llvm::Triple::mips64) + if (arch.GetTriple().getArch () == llvm::Triple::mips64 + || arch.GetTriple().getArch () == llvm::Triple::mips64el) return true; return false; } diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index 7e3ec71eb81..7bab472ffa7 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -286,17 +286,22 @@ static uint32_t mipsVariantFromElfFlags(const elf::elf_word e_flags, uint32_t endian) { const uint32_t mips_arch = e_flags & llvm::ELF::EF_MIPS_ARCH; - uint32_t arch_variant = LLDB_INVALID_CPUTYPE; + uint32_t arch_variant = ArchSpec::eMIPSSubType_unknown; switch (mips_arch) { + case llvm::ELF::EF_MIPS_ARCH_32: + return (endian == ELFDATA2LSB) ? ArchSpec::eMIPSSubType_mips32el : ArchSpec::eMIPSSubType_mips32; + case llvm::ELF::EF_MIPS_ARCH_32R2: + return (endian == ELFDATA2LSB) ? ArchSpec::eMIPSSubType_mips32r2el : ArchSpec::eMIPSSubType_mips32r2; + case llvm::ELF::EF_MIPS_ARCH_32R6: + return (endian == ELFDATA2LSB) ? ArchSpec::eMIPSSubType_mips32r6el : ArchSpec::eMIPSSubType_mips32r6; case llvm::ELF::EF_MIPS_ARCH_64: - if (endian == ELFDATA2LSB) - arch_variant = llvm::Triple::mips64el; - else - arch_variant = llvm::Triple::mips64; - break; - + return (endian == ELFDATA2LSB) ? ArchSpec::eMIPSSubType_mips64el : ArchSpec::eMIPSSubType_mips64; + case llvm::ELF::EF_MIPS_ARCH_64R2: + return (endian == ELFDATA2LSB) ? ArchSpec::eMIPSSubType_mips64r2el : ArchSpec::eMIPSSubType_mips64r2; + case llvm::ELF::EF_MIPS_ARCH_64R6: + return (endian == ELFDATA2LSB) ? ArchSpec::eMIPSSubType_mips64r6el : ArchSpec::eMIPSSubType_mips64r6; default: break; } diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index e9014e08f32..205faf0f8f5 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -3559,6 +3559,7 @@ NativeProcessLinux::GetSoftwareBreakpointPCOffset (NativeRegisterContextSP conte // set per architecture. Need ARM, MIPS support here. static const uint8_t g_aarch64_opcode[] = { 0x00, 0x00, 0x20, 0xd4 }; static const uint8_t g_i386_opcode [] = { 0xCC }; + static const uint8_t g_mips64_opcode[] = { 0x00, 0x00, 0x00, 0x0d }; switch (m_arch.GetMachine ()) { @@ -3575,6 +3576,11 @@ NativeProcessLinux::GetSoftwareBreakpointPCOffset (NativeRegisterContextSP conte actual_opcode_size = static_cast<uint32_t> (sizeof(g_i386_opcode)); return Error (); + case llvm::Triple::mips64: + case llvm::Triple::mips64el: + actual_opcode_size = static_cast<uint32_t> (sizeof(g_mips64_opcode)); + return Error (); + default: assert(false && "CPU type not supported!"); return Error ("CPU type not supported"); |