Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
Show First 20 Lines • Show All 1,521 Lines • ▼ Show 20 Lines | void COFFDumper::printStackMap() const { | ||||
StackMapSection.getContents(StackMapContents); | StackMapSection.getContents(StackMapContents); | ||||
ArrayRef<uint8_t> StackMapContentsArray( | ArrayRef<uint8_t> StackMapContentsArray( | ||||
reinterpret_cast<const uint8_t*>(StackMapContents.data()), | reinterpret_cast<const uint8_t*>(StackMapContents.data()), | ||||
StackMapContents.size()); | StackMapContents.size()); | ||||
if (Obj->isLittleEndian()) | if (Obj->isLittleEndian()) | ||||
prettyPrintStackMap( | prettyPrintStackMap( | ||||
llvm::outs(), | llvm::outs(), | ||||
StackMapV1Parser<support::little>(StackMapContentsArray)); | StackMapV2Parser<support::little>(StackMapContentsArray)); | ||||
else | else | ||||
prettyPrintStackMap(llvm::outs(), | prettyPrintStackMap(llvm::outs(), | ||||
StackMapV1Parser<support::big>(StackMapContentsArray)); | StackMapV2Parser<support::big>(StackMapContentsArray)); | ||||
} | } | ||||
void llvm::dumpCodeViewMergedTypes( | void llvm::dumpCodeViewMergedTypes( | ||||
ScopedPrinter &Writer, llvm::codeview::MemoryTypeTableBuilder &CVTypes) { | ScopedPrinter &Writer, llvm::codeview::MemoryTypeTableBuilder &CVTypes) { | ||||
// Flatten it first, then run our dumper on it. | // Flatten it first, then run our dumper on it. | ||||
ListScope S(Writer, "MergedTypeStream"); | ListScope S(Writer, "MergedTypeStream"); | ||||
SmallString<0> Buf; | SmallString<0> Buf; | ||||
CVTypes.ForEachRecord([&](TypeIndex TI, StringRef Record) { | CVTypes.ForEachRecord([&](TypeIndex TI, StringRef Record) { | ||||
Buf.append(Record.begin(), Record.end()); | Buf.append(Record.begin(), Record.end()); | ||||
}); | }); | ||||
CVTypeDumper CVTD(&Writer, opts::CodeViewSubsectionBytes); | CVTypeDumper CVTD(&Writer, opts::CodeViewSubsectionBytes); | ||||
if (auto EC = CVTD.dump({Buf.str().bytes_begin(), Buf.str().bytes_end()})) { | if (auto EC = CVTD.dump({Buf.str().bytes_begin(), Buf.str().bytes_end()})) { | ||||
Writer.flush(); | Writer.flush(); | ||||
error(llvm::errorToErrorCode(std::move(EC))); | error(llvm::errorToErrorCode(std::move(EC))); | ||||
} | } | ||||
} | } |