#include "FileAnalysis.h"
#include "GraphBuilder.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/DebugInfo/DWARF/DWARFContext.h"
#include "llvm/DebugInfo/Symbolize/SymbolizableModule.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstPrinter.h"
#include "llvm/MC/MCInstrAnalysis.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCObjectFileInfo.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/MCTargetOptions.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Object/Binary.h"
#include "llvm/Object/COFF.h"
#include "llvm/Object/ELFObjectFile.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/raw_ostream.h"
Instr;
LLVMSymbolizer;
namespace llvm {
namespace cfi_verify {
bool IgnoreDWARFFlag;
static cl::opt<bool, true> IgnoreDWARFArg(
"ignore-dwarf",
cl::desc(
"Ignore all DWARF data. This relaxes the requirements for all "
"statically linked libraries to have been compiled with '-g', but "
"will result in false positives for 'CFI unprotected' instructions."),
cl::location(IgnoreDWARFFlag), cl::init(false));
StringRef stringCFIProtectionStatus(CFIProtectionStatus Status) { … }
Expected<FileAnalysis> FileAnalysis::Create(StringRef Filename) { … }
FileAnalysis::FileAnalysis(object::OwningBinary<object::Binary> Binary)
: … { … }
FileAnalysis::FileAnalysis(const Triple &ObjectTriple,
const SubtargetFeatures &Features)
: … { … }
const Instr *
FileAnalysis::getPrevInstructionSequential(const Instr &InstrMeta) const { … }
const Instr *
FileAnalysis::getNextInstructionSequential(const Instr &InstrMeta) const { … }
bool FileAnalysis::usesRegisterOperand(const Instr &InstrMeta) const { … }
const Instr *FileAnalysis::getInstruction(uint64_t Address) const { … }
const Instr &FileAnalysis::getInstructionOrDie(uint64_t Address) const { … }
bool FileAnalysis::isCFITrap(const Instr &InstrMeta) const { … }
bool FileAnalysis::willTrapOnCFIViolation(const Instr &InstrMeta) const { … }
bool FileAnalysis::canFallThrough(const Instr &InstrMeta) const { … }
const Instr *
FileAnalysis::getDefiniteNextInstruction(const Instr &InstrMeta) const { … }
std::set<const Instr *>
FileAnalysis::getDirectControlFlowXRefs(const Instr &InstrMeta) const { … }
const std::set<object::SectionedAddress> &
FileAnalysis::getIndirectInstructions() const { … }
const MCRegisterInfo *FileAnalysis::getRegisterInfo() const { … }
const MCInstrInfo *FileAnalysis::getMCInstrInfo() const { … }
const MCInstrAnalysis *FileAnalysis::getMCInstrAnalysis() const { … }
Expected<DIInliningInfo>
FileAnalysis::symbolizeInlinedCode(object::SectionedAddress Address) { … }
CFIProtectionStatus
FileAnalysis::validateCFIProtection(const GraphResult &Graph) const { … }
uint64_t FileAnalysis::indirectCFOperandClobber(const GraphResult &Graph) const { … }
void FileAnalysis::printInstruction(const Instr &InstrMeta,
raw_ostream &OS) const { … }
Error FileAnalysis::initialiseDisassemblyMembers() { … }
Error FileAnalysis::parseCodeSections() { … }
void FileAnalysis::parseSectionContents(ArrayRef<uint8_t> SectionBytes,
object::SectionedAddress Address) { … }
void FileAnalysis::addInstruction(const Instr &Instruction) { … }
Error FileAnalysis::parseSymbolTable() { … }
UnsupportedDisassembly::UnsupportedDisassembly(StringRef Text)
: … { … }
char UnsupportedDisassembly::ID;
void UnsupportedDisassembly::log(raw_ostream &OS) const { … }
std::error_code UnsupportedDisassembly::convertToErrorCode() const { … }
}
}