#include "llvm/DebugInfo/DWARF/DWARFDebugFrame.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/DebugInfo/DIContext.h"
#include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/DataExtractor.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cinttypes>
#include <cstdint>
#include <optional>
usingnamespacellvm;
usingnamespacedwarf;
static void printRegister(raw_ostream &OS, DIDumpOptions DumpOpts,
unsigned RegNum) { … }
UnwindLocation UnwindLocation::createUnspecified() { … }
UnwindLocation UnwindLocation::createUndefined() { … }
UnwindLocation UnwindLocation::createSame() { … }
UnwindLocation UnwindLocation::createIsConstant(int32_t Value) { … }
UnwindLocation UnwindLocation::createIsCFAPlusOffset(int32_t Offset) { … }
UnwindLocation UnwindLocation::createAtCFAPlusOffset(int32_t Offset) { … }
UnwindLocation
UnwindLocation::createIsRegisterPlusOffset(uint32_t RegNum, int32_t Offset,
std::optional<uint32_t> AddrSpace) { … }
UnwindLocation
UnwindLocation::createAtRegisterPlusOffset(uint32_t RegNum, int32_t Offset,
std::optional<uint32_t> AddrSpace) { … }
UnwindLocation UnwindLocation::createIsDWARFExpression(DWARFExpression Expr) { … }
UnwindLocation UnwindLocation::createAtDWARFExpression(DWARFExpression Expr) { … }
void UnwindLocation::dump(raw_ostream &OS, DIDumpOptions DumpOpts) const { … }
raw_ostream &llvm::dwarf::operator<<(raw_ostream &OS,
const UnwindLocation &UL) { … }
bool UnwindLocation::operator==(const UnwindLocation &RHS) const { … }
void RegisterLocations::dump(raw_ostream &OS, DIDumpOptions DumpOpts) const { … }
raw_ostream &llvm::dwarf::operator<<(raw_ostream &OS,
const RegisterLocations &RL) { … }
void UnwindRow::dump(raw_ostream &OS, DIDumpOptions DumpOpts,
unsigned IndentLevel) const { … }
raw_ostream &llvm::dwarf::operator<<(raw_ostream &OS, const UnwindRow &Row) { … }
void UnwindTable::dump(raw_ostream &OS, DIDumpOptions DumpOpts,
unsigned IndentLevel) const { … }
raw_ostream &llvm::dwarf::operator<<(raw_ostream &OS, const UnwindTable &Rows) { … }
Expected<UnwindTable> UnwindTable::create(const FDE *Fde) { … }
Expected<UnwindTable> UnwindTable::create(const CIE *Cie) { … }
const uint8_t DWARF_CFI_PRIMARY_OPCODE_MASK = …;
const uint8_t DWARF_CFI_PRIMARY_OPERAND_MASK = …;
Error CFIProgram::parse(DWARFDataExtractor Data, uint64_t *Offset,
uint64_t EndOffset) { … }
StringRef CFIProgram::callFrameString(unsigned Opcode) const { … }
const char *CFIProgram::operandTypeString(CFIProgram::OperandType OT) { … }
llvm::Expected<uint64_t>
CFIProgram::Instruction::getOperandAsUnsigned(const CFIProgram &CFIP,
uint32_t OperandIdx) const { … }
llvm::Expected<int64_t>
CFIProgram::Instruction::getOperandAsSigned(const CFIProgram &CFIP,
uint32_t OperandIdx) const { … }
Error UnwindTable::parseRows(const CFIProgram &CFIP, UnwindRow &Row,
const RegisterLocations *InitialLocs) { … }
ArrayRef<CFIProgram::OperandType[CFIProgram::MaxOperands]>
CFIProgram::getOperandTypes() { … }
void CFIProgram::printOperand(raw_ostream &OS, DIDumpOptions DumpOpts,
const Instruction &Instr, unsigned OperandIdx,
uint64_t Operand,
std::optional<uint64_t> &Address) const { … }
void CFIProgram::dump(raw_ostream &OS, DIDumpOptions DumpOpts,
unsigned IndentLevel,
std::optional<uint64_t> Address) const { … }
constexpr uint64_t getCIEId(bool IsDWARF64, bool IsEH) { … }
void CIE::dump(raw_ostream &OS, DIDumpOptions DumpOpts) const { … }
void FDE::dump(raw_ostream &OS, DIDumpOptions DumpOpts) const { … }
DWARFDebugFrame::DWARFDebugFrame(Triple::ArchType Arch,
bool IsEH, uint64_t EHFrameAddress)
: … { … }
DWARFDebugFrame::~DWARFDebugFrame() = default;
static void LLVM_ATTRIBUTE_UNUSED dumpDataAux(DataExtractor Data,
uint64_t Offset, int Length) { … }
Error DWARFDebugFrame::parse(DWARFDataExtractor Data) { … }
FrameEntry *DWARFDebugFrame::getEntryAtOffset(uint64_t Offset) const { … }
void DWARFDebugFrame::dump(raw_ostream &OS, DIDumpOptions DumpOpts,
std::optional<uint64_t> Offset) const { … }