mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
Upgrade to VS2019, LLVM 11.0.0
This commit is contained in:
parent
7883d0cafa
commit
b43007a1b6
17 changed files with 166 additions and 135 deletions
|
@ -31,6 +31,7 @@
|
|||
#include "X86/MCTargetDesc/X86BaseInfo.h"
|
||||
#include "X86InstrInfo.h"
|
||||
#include "BeefySysLib/util/HashSet.h"
|
||||
#include "../../llvm/lib/Target/X86/TargetInfo/X86TargetInfo.h"
|
||||
|
||||
#pragma warning(pop)
|
||||
|
||||
|
@ -428,8 +429,9 @@ X86CPU::X86CPU() :
|
|||
if (!mRegisterInfo)
|
||||
return;
|
||||
|
||||
MCTargetOptions options;
|
||||
// Get the assembler info needed to setup the MCContext.
|
||||
mAsmInfo = TheX86_32Target.createMCAsmInfo(*mRegisterInfo, triple);
|
||||
mAsmInfo = TheX86_32Target.createMCAsmInfo(*mRegisterInfo, triple, options);
|
||||
if (!mAsmInfo)
|
||||
return;
|
||||
|
||||
|
@ -486,8 +488,9 @@ bool X86CPU::Decode(uint32 address, DbgModuleMemoryCache* memoryCache, X86Instr*
|
|||
uint8 data[15];
|
||||
memoryCache->Read(address, data, 15);
|
||||
|
||||
mDisAsm->CommentStream = &inst->mAnnotationStream;
|
||||
ArrayRef<uint8_t> dataArrayRef(data, data + 15);
|
||||
MCDisassembler::DecodeStatus S = mDisAsm->getInstruction(inst->mMCInst, size, dataArrayRef, address, nulls(), inst->mAnnotationStream);
|
||||
MCDisassembler::DecodeStatus S = mDisAsm->getInstruction(inst->mMCInst, size, dataArrayRef, address, nulls());
|
||||
inst->mSize = (int)size;
|
||||
|
||||
return S == MCDisassembler::Success;
|
||||
|
@ -508,8 +511,9 @@ bool X86CPU::Decode(uint32 baseAddress, const uint8* dataBase, int dataLength, c
|
|||
//TODO: LLVM3.8
|
||||
//MCDisassembler::DecodeStatus S = mDisAsm->getInstruction(inst->mMCInst, size, region, address, nulls(), inst->mAnnotationStream);
|
||||
|
||||
mDisAsm->CommentStream = &inst->mAnnotationStream;
|
||||
ArrayRef<uint8_t> dataArrayRef(dataPtr, dataLength - (dataPtr - dataBase));
|
||||
MCDisassembler::DecodeStatus S = mDisAsm->getInstruction(inst->mMCInst, size, dataArrayRef, address, nulls(), inst->mAnnotationStream);
|
||||
MCDisassembler::DecodeStatus S = mDisAsm->getInstruction(inst->mMCInst, size, dataArrayRef, address, nulls());
|
||||
inst->mSize = (int)size;
|
||||
|
||||
return S == MCDisassembler::Success;
|
||||
|
@ -523,8 +527,9 @@ void X86CPU::GetNextPC(uint32 baseAddress, const uint8* dataBase, int dataLength
|
|||
uint64 size = 0;
|
||||
MCInst mcInst;
|
||||
//MCDisassembler::DecodeStatus S = mDisAsm->getInstruction(mcInst, size, region, address, nulls(), nulls());
|
||||
mDisAsm->CommentStream = &nulls();
|
||||
ArrayRef<uint8_t> dataArrayRef(dataPtr, dataLength - (dataPtr - dataBase));
|
||||
MCDisassembler::DecodeStatus S = mDisAsm->getInstruction(mcInst, size, dataArrayRef, address, nulls(), nulls());
|
||||
MCDisassembler::DecodeStatus S = mDisAsm->getInstruction(mcInst, size, dataArrayRef, address, nulls());
|
||||
|
||||
}
|
||||
|
||||
|
@ -541,7 +546,7 @@ String X86CPU::InstructionToString(X86Instr* inst, uint32 addr)
|
|||
SmallVector<char, 256> insnStr;
|
||||
raw_svector_ostream OS(insnStr);
|
||||
//mInstPrinter->CurPCRelImmOffset = addr + inst->GetLength();
|
||||
mInstPrinter->printInst(&inst->mMCInst, OS, annotationsStr, *mSubtargetInfo);
|
||||
mInstPrinter->printInst(&inst->mMCInst, addr, annotationsStr, *mSubtargetInfo, OS);
|
||||
//OS.flush();
|
||||
//llvm::StringRef str = OS.str();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue