aboutsummaryrefslogtreecommitdiffstats
path: root/source/Utility/ArchSpec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Utility/ArchSpec.cpp')
-rw-r--r--source/Utility/ArchSpec.cpp44
1 files changed, 28 insertions, 16 deletions
diff --git a/source/Utility/ArchSpec.cpp b/source/Utility/ArchSpec.cpp
index 81b87fff88d4..40cc4a092b0d 100644
--- a/source/Utility/ArchSpec.cpp
+++ b/source/Utility/ArchSpec.cpp
@@ -101,6 +101,8 @@ static const CoreDefinition g_core_definitions[] = {
ArchSpec::eCore_arm_arm64, "arm64"},
{eByteOrderLittle, 8, 4, 4, llvm::Triple::aarch64,
ArchSpec::eCore_arm_armv8, "armv8"},
+ {eByteOrderLittle, 4, 4, 4, llvm::Triple::aarch64_32,
+ ArchSpec::eCore_arm_arm64_32, "arm64_32"},
{eByteOrderLittle, 8, 4, 4, llvm::Triple::aarch64,
ArchSpec::eCore_arm_aarch64, "aarch64"},
@@ -214,6 +216,7 @@ static const CoreDefinition g_core_definitions[] = {
ArchSpec::eCore_uknownMach32, "unknown-mach-32"},
{eByteOrderLittle, 8, 4, 4, llvm::Triple::UnknownArch,
ArchSpec::eCore_uknownMach64, "unknown-mach-64"},
+ {eByteOrderLittle, 4, 2, 4, llvm::Triple::arc, ArchSpec::eCore_arc, "arc"}
};
// Ensure that we have an entry in the g_core_definitions for each core. If you
@@ -243,19 +246,9 @@ void ArchSpec::ListSupportedArchNames(StringList &list) {
list.AppendString(g_core_definitions[i].name);
}
-size_t ArchSpec::AutoComplete(CompletionRequest &request) {
- if (!request.GetCursorArgumentPrefix().empty()) {
- for (uint32_t i = 0; i < llvm::array_lengthof(g_core_definitions); ++i) {
- if (NameMatches(g_core_definitions[i].name, NameMatch::StartsWith,
- request.GetCursorArgumentPrefix()))
- request.AddCompletion(g_core_definitions[i].name);
- }
- } else {
- StringList matches;
- ListSupportedArchNames(matches);
- request.AddCompletions(matches);
- }
- return request.GetNumberOfMatches();
+void ArchSpec::AutoComplete(CompletionRequest &request) {
+ for (uint32_t i = 0; i < llvm::array_lengthof(g_core_definitions); ++i)
+ request.TryCompleteCurrentArg(g_core_definitions[i].name);
}
#define CPU_ANY (UINT32_MAX)
@@ -306,6 +299,10 @@ static const ArchDefinitionEntry g_macho_arch_entries[] = {
SUBTYPE_MASK},
{ArchSpec::eCore_arm_arm64, llvm::MachO::CPU_TYPE_ARM64, 13, UINT32_MAX,
SUBTYPE_MASK},
+ {ArchSpec::eCore_arm_arm64_32, llvm::MachO::CPU_TYPE_ARM64_32, 0,
+ UINT32_MAX, SUBTYPE_MASK},
+ {ArchSpec::eCore_arm_arm64_32, llvm::MachO::CPU_TYPE_ARM64_32, 1,
+ UINT32_MAX, SUBTYPE_MASK},
{ArchSpec::eCore_arm_arm64, llvm::MachO::CPU_TYPE_ARM64, CPU_ANY,
UINT32_MAX, SUBTYPE_MASK},
{ArchSpec::eCore_thumb, llvm::MachO::CPU_TYPE_ARM, 0, UINT32_MAX,
@@ -446,6 +443,8 @@ static const ArchDefinitionEntry g_elf_arch_entries[] = {
ArchSpec::eMIPSSubType_mips64r6el, 0xFFFFFFFFu, 0xFFFFFFFFu}, // mips64r6el
{ArchSpec::eCore_hexagon_generic, llvm::ELF::EM_HEXAGON,
LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu}, // HEXAGON
+ {ArchSpec::eCore_arc, llvm::ELF::EM_ARC_COMPACT2, LLDB_INVALID_CPUTYPE,
+ 0xFFFFFFFFu, 0xFFFFFFFFu }, // ARC
};
static const ArchDefinition g_elf_arch_def = {
@@ -469,7 +468,9 @@ static const ArchDefinitionEntry g_coff_arch_entries[] = {
{ArchSpec::eCore_thumb, llvm::COFF::IMAGE_FILE_MACHINE_THUMB,
LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu}, // ARMv7
{ArchSpec::eCore_x86_64_x86_64, llvm::COFF::IMAGE_FILE_MACHINE_AMD64,
- LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu} // AMD64
+ LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu}, // AMD64
+ {ArchSpec::eCore_arm_arm64, llvm::COFF::IMAGE_FILE_MACHINE_ARM64,
+ LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu} // ARM64
};
static const ArchDefinition g_coff_arch_def = {
@@ -760,6 +761,7 @@ bool ArchSpec::CharIsSignedByDefault() const {
return true;
case llvm::Triple::aarch64:
+ case llvm::Triple::aarch64_32:
case llvm::Triple::aarch64_be:
case llvm::Triple::arm:
case llvm::Triple::armeb:
@@ -946,8 +948,10 @@ bool ArchSpec::SetArchitecture(ArchitectureType arch_type, uint32_t cpu,
}
} else {
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_TARGET | LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_PLATFORM));
- if (log)
- log->Printf("Unable to find a core definition for cpu 0x%" PRIx32 " sub %" PRId32, cpu, sub);
+ LLDB_LOGF(log,
+ "Unable to find a core definition for cpu 0x%" PRIx32
+ " sub %" PRId32,
+ cpu, sub);
}
}
CoreUpdated(update_triple);
@@ -1245,6 +1249,14 @@ static bool cores_match(const ArchSpec::Core core1, const ArchSpec::Core core2,
}
break;
+ case ArchSpec::eCore_arm_arm64_32:
+ if (!enforce_exact_match) {
+ if (core2 == ArchSpec::eCore_arm_generic)
+ return true;
+ try_inverse = false;
+ }
+ break;
+
case ArchSpec::eCore_mips32:
if (!enforce_exact_match) {
if (core2 >= ArchSpec::kCore_mips32_first &&