#include "ARMWinEHPrinter.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/ARMWinEH.h"
#include "llvm/Support/Format.h"
usingnamespacellvm;
usingnamespacellvm::object;
usingnamespacellvm::support;
namespace llvm {
raw_ostream &operator<<(raw_ostream &OS, const ARM::WinEH::ReturnType &RT) { … }
}
static std::string formatSymbol(StringRef Name, uint64_t Address,
uint64_t Offset = 0) { … }
namespace llvm {
namespace ARM {
namespace WinEH {
const size_t Decoder::PDataEntrySize = …;
const Decoder::RingEntry Decoder::Ring[] = …;
const Decoder::RingEntry Decoder::Ring64[] = …;
static void printRange(raw_ostream &OS, ListSeparator &LS, unsigned First,
unsigned Last, char Letter) { … }
static void printRange(raw_ostream &OS, uint32_t Mask, ListSeparator &LS,
unsigned Start, unsigned End, char Letter) { … }
void Decoder::printGPRMask(uint16_t GPRMask) { … }
void Decoder::printVFPMask(uint32_t VFPMask) { … }
ErrorOr<object::SectionRef>
Decoder::getSectionContaining(const COFFObjectFile &COFF, uint64_t VA) { … }
ErrorOr<object::SymbolRef> Decoder::getSymbol(const COFFObjectFile &COFF,
uint64_t VA, bool FunctionOnly) { … }
ErrorOr<SymbolRef> Decoder::getRelocatedSymbol(const COFFObjectFile &,
const SectionRef &Section,
uint64_t Offset) { … }
SymbolRef Decoder::getPreferredSymbol(const COFFObjectFile &COFF, SymbolRef Sym,
uint64_t &SymbolOffset) { … }
ErrorOr<SymbolRef> Decoder::getSymbolForLocation(
const COFFObjectFile &COFF, const SectionRef &Section,
uint64_t OffsetInSection, uint64_t ImmediateOffset, uint64_t &SymbolAddress,
uint64_t &SymbolOffset, bool FunctionOnly) { … }
bool Decoder::opcode_0xxxxxxx(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_10Lxxxxx(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_1100xxxx(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_11010Lxx(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_11011Lxx(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_11100xxx(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_111010xx(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_1110110L(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_11101110(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_11101111(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_11110101(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_11110110(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_11110111(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_11111000(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_11111001(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_11111010(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_11111011(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_11111100(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_11111101(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_11111110(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_11111111(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_alloc_s(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_save_r19r20_x(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_save_fplr(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_save_fplr_x(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_alloc_m(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_save_regp(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_save_regp_x(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_save_reg(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_save_reg_x(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_save_lrpair(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_save_fregp(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_save_fregp_x(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_save_freg(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_save_freg_x(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_alloc_l(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_setfp(const uint8_t *OC, unsigned &Offset, unsigned Length,
bool Prologue) { … }
bool Decoder::opcode_addfp(const uint8_t *OC, unsigned &Offset, unsigned Length,
bool Prologue) { … }
bool Decoder::opcode_nop(const uint8_t *OC, unsigned &Offset, unsigned Length,
bool Prologue) { … }
bool Decoder::opcode_end(const uint8_t *OC, unsigned &Offset, unsigned Length,
bool Prologue) { … }
bool Decoder::opcode_end_c(const uint8_t *OC, unsigned &Offset, unsigned Length,
bool Prologue) { … }
bool Decoder::opcode_save_next(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_save_any_reg(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_trap_frame(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_machine_frame(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_context(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_ec_context(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_clear_unwound_to_call(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
bool Decoder::opcode_pac_sign_lr(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) { … }
void Decoder::decodeOpcodes(ArrayRef<uint8_t> Opcodes, unsigned Offset,
bool Prologue) { … }
bool Decoder::dumpXDataRecord(const COFFObjectFile &COFF,
const SectionRef &Section,
uint64_t FunctionAddress, uint64_t VA) { … }
bool Decoder::dumpUnpackedEntry(const COFFObjectFile &COFF,
const SectionRef Section, uint64_t Offset,
unsigned Index, const RuntimeFunction &RF) { … }
bool Decoder::dumpPackedEntry(const object::COFFObjectFile &COFF,
const SectionRef Section, uint64_t Offset,
unsigned Index, const RuntimeFunction &RF) { … }
bool Decoder::dumpPackedARM64Entry(const object::COFFObjectFile &COFF,
const SectionRef Section, uint64_t Offset,
unsigned Index,
const RuntimeFunctionARM64 &RF) { … }
bool Decoder::dumpProcedureDataEntry(const COFFObjectFile &COFF,
const SectionRef Section, unsigned Index,
ArrayRef<uint8_t> Contents) { … }
void Decoder::dumpProcedureData(const COFFObjectFile &COFF,
const SectionRef Section) { … }
Error Decoder::dumpProcedureData(const COFFObjectFile &COFF) { … }
}
}
}