aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/contrib/llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/contrib/llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index bca575b7f884..cad9ce218b10 100644
--- a/contrib/llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -296,9 +296,23 @@ static uint32_t mipsVariantFromElfFlags (const elf::ELFHeader &header) {
return arch_variant;
}
+static uint32_t riscvVariantFromElfFlags(const elf::ELFHeader &header) {
+ uint32_t fileclass = header.e_ident[EI_CLASS];
+ switch (fileclass) {
+ case llvm::ELF::ELFCLASS32:
+ return ArchSpec::eRISCVSubType_riscv32;
+ case llvm::ELF::ELFCLASS64:
+ return ArchSpec::eRISCVSubType_riscv64;
+ default:
+ return ArchSpec::eRISCVSubType_unknown;
+ }
+}
+
static uint32_t subTypeFromElfHeader(const elf::ELFHeader &header) {
if (header.e_machine == llvm::ELF::EM_MIPS)
return mipsVariantFromElfFlags(header);
+ else if (header.e_machine == llvm::ELF::EM_RISCV)
+ return riscvVariantFromElfFlags(header);
return LLDB_INVALID_CPUTYPE;
}
@@ -576,9 +590,7 @@ size_t ObjectFileELF::GetModuleSpecifications(
uint32_t core_notes_crc = 0;
if (!gnu_debuglink_crc) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- lldb_private::Timer scoped_timer(
- func_cat,
+ LLDB_SCOPED_TIMERF(
"Calculating module crc32 %s with size %" PRIu64 " KiB",
file.GetLastPathComponent().AsCString(),
(length - file_offset) / 1024);