#include "llvm/Object/ObjectFile.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/SourceMgr.h"
+#include "llvm/Support/Win64EH.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/system_error.h"
-#include "llvm/Support/Win64EH.h"
#include <algorithm>
#include <cstring>
uint64_t Ofs;
if (error_code ec = I->getOffset(Ofs)) return ec;
if (Ofs == Offset) {
- if (error_code ec = I->getSymbol(Sym)) return ec;
+ Sym = *I->getSymbol();
break;
}
}
void llvm::printCOFFUnwindInfo(const COFFObjectFile *Obj) {
const coff_file_header *Header;
- if (error(Obj->getHeader(Header))) return;
+ if (error(Obj->getCOFFHeader(Header))) return;
if (Header->Machine != COFF::IMAGE_FILE_MACHINE_AMD64) {
errs() << "Unsupported image machine type "
outs() << " Start Address: ";
printCOFFSymbolAddress(outs(), Rels, SectionOffset +
- offsetof(RuntimeFunction, StartAddress),
+ /*offsetof(RuntimeFunction, StartAddress)*/ 0,
I->StartAddress);
outs() << "\n";
outs() << " End Address: ";
printCOFFSymbolAddress(outs(), Rels, SectionOffset +
- offsetof(RuntimeFunction, EndAddress),
+ /*offsetof(RuntimeFunction, EndAddress)*/ 4,
I->EndAddress);
outs() << "\n";
outs() << " Unwind Info Address: ";
printCOFFSymbolAddress(outs(), Rels, SectionOffset +
- offsetof(RuntimeFunction, UnwindInfoOffset),
+ /*offsetof(RuntimeFunction, UnwindInfoOffset)*/ 8,
I->UnwindInfoOffset);
outs() << "\n";
ArrayRef<uint8_t> XContents;
uint64_t UnwindInfoOffset = 0;
if (error(getSectionContents(Obj, Rels, SectionOffset +
- offsetof(RuntimeFunction, UnwindInfoOffset),
+ /*offsetof(RuntimeFunction, UnwindInfoOffset)*/ 8,
XContents, UnwindInfoOffset))) continue;
if (XContents.empty()) continue;