summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
diff options
context:
space:
mode:
authorMohit K. Bhakkad <mohit.bhakkad@gmail.com>2015-04-23 06:36:20 +0000
committerMohit K. Bhakkad <mohit.bhakkad@gmail.com>2015-04-23 06:36:20 +0000
commite8659b5df619b0915ed6d71fe544d8514a11334a (patch)
tree1dd7f16c53f4b75196ea6a8e9f250033dd2425a0 /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
parent5e018f9e29a2b7e67e82dfa17f32662f18a9bdf7 (diff)
downloadbcm5719-llvm-e8659b5df619b0915ed6d71fe544d8514a11334a.tar.gz
bcm5719-llvm-e8659b5df619b0915ed6d71fe544d8514a11334a.zip
[LLDB][MIPS] Add MIPS32 and MIPS64 core revisions
Patch by Jaydeep Patil Added MIPS32 and MIPS64 core revisions. This would be followed by register context and emulate-instruction for MIPS32. DYLDRendezvous.cpp: On Linux link map struct does not contain extra load offset field. Reviewers: clayborg Subscribers: bhushan, mohit.bhakkad, sagar, lldb-commits. Differential Revision: http://reviews.llvm.org/D9190 llvm-svn: 235574
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp19
1 files changed, 12 insertions, 7 deletions
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;
}
OpenPOWER on IntegriCloud