diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-11-25 19:15:31 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-11-25 19:15:31 +0000 |
commit | 4ee8c119c71a06dcad1e0fecc8c675e480e59337 (patch) | |
tree | d0b329e28aa1f4a0fc00c9763bcb3b2f5bf505ea /source/Core | |
parent | 3b6b9a026ed26abe3a3f1470da00ae1f478c4aca (diff) | |
download | src-vendor/lldb/lldb-release_39-r288513.tar.gz src-vendor/lldb/lldb-release_39-r288513.zip |
Vendor import of lldb release_39 branch r287912:vendor/lldb/lldb-release_391-r289601vendor/lldb/lldb-release_39-r288847vendor/lldb/lldb-release_39-r288513vendor/lldb/lldb-release_39-r287912
Diffstat (limited to 'source/Core')
-rw-r--r-- | source/Core/ArchSpec.cpp | 45 | ||||
-rw-r--r-- | source/Core/RegisterValue.cpp | 57 |
2 files changed, 70 insertions, 32 deletions
diff --git a/source/Core/ArchSpec.cpp b/source/Core/ArchSpec.cpp index 24aba81350a6..efdbf11d93e3 100644 --- a/source/Core/ArchSpec.cpp +++ b/source/Core/ArchSpec.cpp @@ -519,11 +519,46 @@ ArchSpec::IsMIPS() const return false; } -std::string -ArchSpec::GetClangTargetCPU () -{ - std::string cpu; - const llvm::Triple::ArchType machine = GetMachine(); + +std::string ArchSpec::GetTargetABI() const { + + std::string abi; + + if (IsMIPS()) { + switch (GetFlags() & ArchSpec::eMIPSABI_mask) { + case ArchSpec::eMIPSABI_N64: + abi = "n64"; + return abi; + case ArchSpec::eMIPSABI_N32: + abi = "n32"; + return abi; + case ArchSpec::eMIPSABI_O32: + abi = "o32"; + return abi; + default: + return abi; + } + } + return abi; +} + +void ArchSpec::SetFlags(std::string elf_abi) { + + uint32_t flag = GetFlags(); + if (IsMIPS()) { + if (elf_abi == "n64") + flag |= ArchSpec::eMIPSABI_N64; + else if (elf_abi == "n32") + flag |= ArchSpec::eMIPSABI_N32; + else if (elf_abi == "o32") + flag |= ArchSpec::eMIPSABI_O32; + } + SetFlags(flag); +} + +std::string ArchSpec::GetClangTargetCPU() { + std::string cpu; + const llvm::Triple::ArchType machine = GetMachine(); if (machine == llvm::Triple::mips || machine == llvm::Triple::mipsel || diff --git a/source/Core/RegisterValue.cpp b/source/Core/RegisterValue.cpp index d9085d7f0bae..d739dd6b5902 100644 --- a/source/Core/RegisterValue.cpp +++ b/source/Core/RegisterValue.cpp @@ -652,34 +652,37 @@ RegisterValue::GetAsUInt32 (uint32_t fail_value, bool *success_ptr) const uint64_t RegisterValue::GetAsUInt64 (uint64_t fail_value, bool *success_ptr) const { - if (success_ptr) - *success_ptr = true; - switch (m_type) - { - default: break; - case eTypeUInt8: - case eTypeUInt16: - case eTypeUInt32: - case eTypeUInt64: - case eTypeFloat: - case eTypeDouble: - case eTypeLongDouble: return m_scalar.ULongLong(fail_value); - case eTypeBytes: - { - switch (buffer.length) - { - default: break; - case 1: - case 2: - case 4: - case 8: return *(const uint64_t *)buffer.bytes; - } - } - break; + if (success_ptr) + *success_ptr = true; + switch (m_type) { + default: + break; + case eTypeUInt8: + case eTypeUInt16: + case eTypeUInt32: + case eTypeUInt64: + case eTypeFloat: + case eTypeDouble: + case eTypeLongDouble: + return m_scalar.ULongLong(fail_value); + case eTypeBytes: { + switch (buffer.length) { + default: + break; + case 1: + return *(const uint8_t *)buffer.bytes; + case 2: + return *(const uint16_t *)buffer.bytes; + case 4: + return *(const uint32_t *)buffer.bytes; + case 8: + return *(const uint64_t *)buffer.bytes; } - if (success_ptr) - *success_ptr = false; - return fail_value; + } break; + } + if (success_ptr) + *success_ptr = false; + return fail_value; } llvm::APInt |