[LLDB][RISCV] Add RISC-V ArchSpec and rv32/rv64 variant detection
authorLuís Marques <luismarques@lowrisc.org>
Thu, 7 Jan 2021 23:01:27 +0000 (23:01 +0000)
committerLuís Marques <luismarques@lowrisc.org>
Thu, 7 Jan 2021 23:02:55 +0000 (23:02 +0000)
commit15f5971150684b656005cfd5b744c1a34477ff60
treed38f1595f0bfa6e9ee614ae68c83e5b21040d577
parent2ce16810f28379b0a56f7036895a04e18d6b4506
[LLDB][RISCV] Add RISC-V ArchSpec and rv32/rv64 variant detection

Adds the RISC-V ArchSpec bits contributed by @simoncook as part of D62732,
plus logic to distinguish between riscv32 and riscv64 based on ELF class.

The patch follows the implementation approach previously used for MIPS.
It defines RISC-V architecture subtypes and inspects the ELF header,
namely the ELF class, to detect the right subtype.

Differential Revision: https://reviews.llvm.org/D86292
lldb/include/lldb/Utility/ArchSpec.h
lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/source/Utility/ArchSpec.cpp
lldb/test/Shell/ObjectFile/ELF/riscv-arch.yaml [new file with mode: 0644]