1//===-- LVCodeViewReader.cpp ----------------------------------------------===// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7//===----------------------------------------------------------------------===// 9// This implements the LVCodeViewReader class. 11//===----------------------------------------------------------------------===// 43#define DEBUG_TYPE "CodeViewReader" 47#define SYMBOL_RECORD(EnumName, EnumVal, Name) \ 50#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def" 59#define RETURN_CASE(Enum, X, Ret) \ 63if (CPU == CPUType::ARMNT) {
65#define CV_REGISTERS_ARM 66#define CV_REGISTER(name, val) RETURN_CASE(RegisterId, name, #name) 67#include "llvm/DebugInfo/CodeView/CodeViewRegisters.def" 69#undef CV_REGISTERS_ARM 74 }
elseif (CPU == CPUType::ARM64) {
76#define CV_REGISTERS_ARM64 77#define CV_REGISTER(name, val) RETURN_CASE(RegisterId, name, #name) 78#include "llvm/DebugInfo/CodeView/CodeViewRegisters.def" 80#undef CV_REGISTERS_ARM64 87#define CV_REGISTERS_X86 88#define CV_REGISTER(name, val) RETURN_CASE(RegisterId, name, #name) 89#include "llvm/DebugInfo/CodeView/CodeViewRegisters.def" 91#undef CV_REGISTERS_X86 97return"formatUnknownEnum(Id)";
106StringRef &Symbol = RelocSym ? *RelocSym : SymStorage;
107if (!resolveSymbolName(CoffSection, RelocOffset, Symbol))
117StringRef &Symbol = RelocSym ? *RelocSym : SymStorage;
118if (resolveSymbolName(CoffSection, RelocOffset, Symbol))
123LVCodeViewReader::getFileNameForFileOffset(
uint32_t FileOffset,
134// The file checksum subsection should precede all references to it. 135if (!CVFileChecksumTable.
valid() || !CVStringTable.
valid())
139 CVFileChecksumTable.
getArray().
at(FileOffset);
141// Check if the file checksum table offset is valid. 142if (Iter == CVFileChecksumTable.
end())
161void LVCodeViewReader::cacheRelocations() {
166RelocMap[CoffSection].push_back(Relocacion);
168// Sort relocations by address. 170returnL.getOffset() <
R.getOffset();
175// Given a section and an offset into this section the function returns the 176// symbol used for the relocation at the offset. 179constauto &Relocations =
RelocMap[CoffSection];
182uint64_t RelocationOffset = Relocation.getOffset();
184if (RelocationOffset ==
Offset) {
185 SymI = Relocation.getSymbol();
189if (SymI == getObj().symbol_end())
195// Given a section and an offset into this section the function returns the 196// name of the symbol used for the relocation at the offset. 200if (
Error E = resolveSymbol(CoffSection,
Offset, Symbol))
209// CodeView and DWARF can have references to compiler generated elements, 210// used for initialization. The MSVC includes in the PDBs, internal compile 211// units, associated with the MS runtime support. We mark them as 'system' 212// and they are printed only if the command line option 'internal=system'. 216auto Starts = [=](
constchar *
Pattern) ->
bool {
219auto CheckExclude = [&]() ->
bool {
220if (Starts(
"__") || Starts(
"_PMD") || Starts(
"_PMFN"))
224if (
Find(
"_CatchableType") ||
Find(
"_TypeDescriptor"))
226if (
Find(
"Intermediate\\vctools"))
228if (
Find(
"$initializer$") ||
Find(
"dynamic initializer"))
230if (
Find(
"`vftable'") ||
Find(
"_GLOBAL__sub"))
234bool Excluded = CheckExclude();
236 Element->setIsSystem();
241Error LVCodeViewReader::collectInlineeInfo(
250if (
Error Err = printFileNameForOffset(
"FileID", FileOffset, SG))
254if (
Lines.hasExtraFiles()) {
257for (
const ulittle32_t &FID :
Line.ExtraFiles)
258if (
Error Err = printFileNameForOffset(
"FileID", FID, SG))
264return NameOrErr.takeError();
271Error LVCodeViewReader::traverseInlineeLines(
StringRef Subsection) {
277return collectInlineeInfo(Lines);
280Error LVCodeViewReader::createLines(
297"{0} {1:x-8}\n", utostr(LI.getStartLine()),
301// The 'processLines()' function will move each created logical line 302// to its enclosing logical scope, using the debug ranges information 303// and they will be released when its scope parent is deleted. 307 LineDebug->setAddress(
Address + Addendum);
309if (LI.isAlwaysStepInto())
310 LineDebug->setIsAlwaysStepInto();
311elseif (LI.isNeverStepInto())
312 LineDebug->setIsNeverStepInto();
314 LineDebug->setLineNumber(LI.getStartLine());
317 LineDebug->setIsNewStatement();
322 LineDebug->setFilename(*NameOrErr);
328Error LVCodeViewReader::initializeFileAndStringTables(
331 (!CVFileChecksumTable.
valid() || !CVStringTable.
valid())) {
332// The section consists of a number of subsection in the following format: 333// |SubSectionType|SubSectionSize|Contents...| 347case DebugSubsectionKind::FileChecksums:
351case DebugSubsectionKind::StringTable:
360if (
Error E = Reader.
skip(PaddedSize - SubSectionSize))
376if (BuffOrErr.getError()) {
377// The server name does not exist. Try in the same directory as the 381if (BuffOrErr.getError()) {
382// For the error message, use the original type server name. 384"File '%s' does not exist.",
388 MemBuffer = std::move(BuffOrErr.get());
390// Check if the buffer corresponds to a PDB file. 398 PdbSession.reset(
static_cast<NativeSession *
>(Session.release()));
401// Just because a file with a matching name was found and it was an actual 402// PDB file doesn't mean it matches. For it to match the InfoStream's GUID 403// must match the GUID specified in the TypeServer2 record. 405if (!expectedInfo || expectedInfo->getGuid() != TS.
getGuid())
408// The reader needs to switch to a type server, to process the types from 409// the server. We need to keep the original input source, as reading other 410// sections will require the input associated with the loaded object file. 411 TypeServer = std::make_shared<InputFile>(&
Pdb);
412 LogicalVisitor.
setInput(TypeServer);
416if (
Error Err = traverseTypes(
Pdb, Types, Ids))
432if (BuffOrErr.getError()) {
433// The server name does not exist. Try in the directory as the input file. 435if (BuffOrErr.getError()) {
436// For the error message, use the original type server name. 438"File '%s' does not exist.",
442 MemBuffer = std::move(BuffOrErr.get());
447"Binary object format in '%s' is not supported.",
455 Builder = std::make_unique<AppendingTypeTableBuilder>(BuilderAllocator);
457// The MSVC precompiled header object file, should contain just a single 458// ".debug$P" section. 462if (!SectionNameOrErr)
464if (*SectionNameOrErr ==
".debug$P") {
474 ReaderPrecomp = std::make_unique<BinaryStreamReader>(
477 ReaderPrecomp->readArray(CVTypesPrecomp, ReaderPrecomp->getLength()));
479// Append all the type records up to the LF_ENDPRECOMP marker and 480// check if the signatures match. 483if (
Type.kind() == LF_ENDPRECOMP) {
485 TypeDeserializer::deserializeAs<EndPrecompRecord>(TypeData));
490 Builder->insertRecordBytes(TypeData);
492// Done processing .debug$P, break out of section loop. 497// Append all the type records, skipping the first record which is the 498// reference to the precompiled header object information. 501if (
Type.kind() != LF_PRECOMP)
502 Builder->insertRecordBytes(TypeData);
505// Set up a type stream that refers to the added type records. 506 Builder->ForEachRecord(
511 ItemStream->setItems(TypeArray);
515 std::make_shared<LazyRandomTypeCollection>(TypeStream, TypeArray.size());
517// Change the original input source to use the collected type records. 518 LogicalVisitor.
setInput(PrecompHeader);
536return DataOrErr.takeError();
543// Get the first type record. It will indicate if this object uses a type 544// server (/Zi) or a PCH file (/Yu). 550// The object was compiled with /Zi. It uses types from a type server PDB. 551if (FirstType->kind() == LF_TYPESERVER2) {
553 TypeDeserializer::deserializeAs<TypeServer2Record>(FirstType->data()));
554return loadTypeServer(TS);
557// The object was compiled with /Yc or /Yu. It uses types from another 558// object file with a matching signature. 559if (FirstType->kind() == LF_PRECOMP) {
561 TypeDeserializer::deserializeAs<PrecompRecord>(FirstType->data()));
562return loadPrecompiledObject(Precomp, CVTypes);
567Types.reset(*DataOrErr, 100);
576// Traverse types (TPI and IPI). 609Error LVCodeViewReader::traverseSymbolsSubsection(
StringRef Subsection,
625 CodeViewContainer::ObjectFile);
626// As we are processing a COFF format, use TPI as IPI, so the generic code 627// to process the CodeView format does not contain any additional checks. 629 &VisitorDelegate, LogicalVisitor.
getShared());
634return Visitor.visitSymbolStream(Symbols);
646return SectionOrErr.takeError();
647StringRef SectionContents = *SectionOrErr;
661if (
Error Err = initializeFileAndStringTables(FSReader))
664while (!
Data.empty()) {
665// The section consists of a number of subsection in the following format: 666// |SubSectionType|SubSectionSize|Contents...| 673// Process the subsection as normal even if the ignore bit is set. 674 SubType &= ~SubsectionIgnoreFlag;
676// Get the contents of the subsection. 677if (SubSectionSize >
Data.size())
681// Add SubSectionSize to the current offset and align that offset 682// to find the next subsection. 685 NextOffset =
alignTo(NextOffset, 4);
686if (NextOffset > SectionContents.
size())
691case DebugSubsectionKind::Symbols:
693 traverseSymbolsSubsection(Contents, Section, SectionContents))
697case DebugSubsectionKind::InlineeLines:
698if (
Error Err = traverseInlineeLines(Contents))
702case DebugSubsectionKind::Lines:
703// Holds a PC to file:line table. Some data to parse this subsection 704// is stored in the other subsections, so just check sanity and store 705// the pointers for deferred processing. 707// Collect function and ranges only if we need to print logical lines. 708if (
options().getGeneralCollectRanges()) {
710if (SubSectionSize < 12) {
711// There should be at least three words to store two function 712// relocations and size of the code. 717if (
Error Err = resolveSymbolName(getObj().getCOFFSection(Section),
723if (FunctionLineTables.
count(SymbolName) != 0) {
724// Saw debug info for this function already? 733// Do nothing for unrecognized subsections. 740// Traverse the line tables now that we've read all the subsections and 741// know all the required information. 742for (
StringRef SymbolName : SymbolNames) {
755// Find the associated symbol table information. 764// The given scope represents the function that contains the line numbers. 765// Collect all generated debug lines associated with the function. 768// For the given scope, collect all scopes ranges. 770 ScopesWithRanges->
clear();
771Function->getRanges(*ScopesWithRanges);
772 ScopesWithRanges->
sort();
778if (
Error Err = createLines(
Block.LineNumbers, Addendum, Segment, Begin,
782// Include lines from any inlined functions within the current function. 800void LVCodeViewReader::mapRangeAddress(
constObjectFile &Obj,
809if (!Section.containsSymbol(
Sym))
819W.
startLine() <<
"Invalid symbol name: " << Symbol.getSectionNumber()
824 SymbolName = *SymNameOrErr;
828 Object->getSection(Symbol.getSectionNumber());
830W.
startLine() <<
"Invalid section number: " << Symbol.getSectionNumber()
840// Record the symbol name (linkage) and its loading address. 847if (
Error Err = loadTargetInfo(Obj))
850// Initialization required when processing a COFF file: 851// Cache the symbols relocations. 852// Create a mapping for virtual addresses. 853// Get the functions entry points. 859if (!SectionNameOrErr)
861// .debug$T is a standard CodeView type section, while .debug$P is the 862// same format but used for MSVC precompiled header object files. 863if (*SectionNameOrErr ==
".debug$T" || *SectionNameOrErr ==
".debug$P")
864if (
Error Err = traverseTypeSection(*SectionNameOrErr, Section))
868// Process collected namespaces. 873if (!SectionNameOrErr)
875if (*SectionNameOrErr ==
".debug$S")
876if (
Error Err = traverseSymbolSection(*SectionNameOrErr, Section))
880// Check if we have to close the Compile Unit scope. 883// Traverse the strings recorded and transform them into filenames. 886// Process collected element lines. 889// Translate composite names into a single component. 898if (!
Pdb.hasPDBTpiStream() || !
Pdb.hasPDBDbiStream())
901// Open the executable associated with the PDB file and get the section 902// addresses used to calculate linear addresses for CodeView Symbols. 903if (!ExePath.empty()) {
908"File '%s' does not exist.", ExePath.c_str());
910 BinaryBuffer = std::move(BuffOrErr.
get());
912// Check if the buffer corresponds to a PECOFF executable. 915"Invalid PECOFF executable file.");
921"Binary object format in '%s' is not supported.",
924 BinaryExecutable = std::move(*BinOrErr);
926 dyn_cast<COFFObjectFile>(BinaryExecutable.get()))
930// In order to generate a full logical view, we have to traverse both 931// streams TPI and IPI if they are present. The following table gives 932// the stream where a specified type is located. If the IPI stream is 933// not present, all the types are located in the TPI stream. 936// LF_POINTER LF_MODIFIER LF_PROCEDURE LF_MFUNCTION 937// LF_LABEL LF_ARGLIST LF_FIELDLIST LF_ARRAY 938// LF_CLASS LF_STRUCTURE LF_INTERFACE LF_UNION 939// LF_ENUM LF_TYPESERVER2 LF_VFTABLE LF_VTSHAPE 940// LF_BITFIELD LF_METHODLIST LF_PRECOMP LF_ENDPRECOMP 943// LF_FUNC_ID LF_MFUNC_ID LF_BUILDINFO 944// LF_SUBSTR_LIST LF_STRING_ID LF_UDT_SRC_LINE 945// LF_UDT_MOD_SRC_LINE 949if (
Error Err = traverseTypes(
Pdb, Types, Ids))
952// Process collected namespaces. 957auto VisitInlineeLines = [&](int32_t Modi,
constSymbolGroup &SG,
959return collectInlineeInfo(Lines, &SG);
965if (
Error Err = iterateModuleSubsections<DebugInlineeLinesSubsectionRef>(
966 Input, HeaderScope, VisitInlineeLines))
969// Traverse global symbols. 971if (
Pdb.hasPDBGlobalsStream()) {
985// As the global symbols do not have an associated Compile Unit, create 986// one, as the container for all global symbols. 990if (
Error Err = Traverser.visitSymbolBegin(Symbol,
Offset))
993// The CodeView compile unit containing the global symbols does not 994// have a name; generate one using its parent name (object filename) 995// follow by the '_global' string. 1004 ExpectedSyms->getSymbolArray().getUnderlyingStream();
1008if (
Error Err = Visitor.visitSymbolRecord(*
Sym, PubSymOff))
1023// Traverse symbols (DBI). 1041 Pipeline.addCallbackToPipeline(Deserializer);
1042 Pipeline.addCallbackToPipeline(Traverser);
1050// If the module stream does not exist, it is not an error condition. 1060// At this stage, the logical view contains all scopes, symbols and types. 1061// For PDBs we can use the module id, to access its specific compile unit. 1062// The line record addresses has been already resolved, so we can apply the 1063// flow as when processing DWARF. 1067// Record all line records for a Compile Unit. 1070auto VisitDebugLines = [
this](int32_t Modi,
constSymbolGroup &SG,
1072if (!
options().getPrintLines())
1081// We have line information for a new module; finish processing the 1082// collected information for the current module. Once it is done, start 1083// recording the line information for the new module. 1084if (CurrentModule != Modi) {
1085if (
Error Err = processModule())
1088 CurrentModule = Modi;
1092if (
Error Err = createLines(
Block.LineNumbers,
/*Addendum=*/0, Segment,
1099if (
Error Err = iterateModuleSubsections<DebugLinesSubsectionRef>(
1100 Input, HeaderScope, VisitDebugLines))
1103// Check if we have to close the Compile Unit scope. 1106// Process collected element lines. 1109// Translate composite names into a single component. 1114Error LVCodeViewReader::processModule() {
1120// For the given compile unit, collect all scopes ranges. 1121// For a complete ranges and lines mapping, the logical view support 1122// needs for the compile unit to have a low and high pc values. We 1123// can traverse the 'Modules' section and get the information for the 1124// specific module. Another option, is from all the ranges collected 1125// to take the first and last values. 1128 ScopesWithRanges->
clear();
1130if (!ScopesWithRanges->
empty())
1133 ScopesWithRanges->
sort();
1138// Include lines from any inlined functions within the current function. 1147// In order to create the scopes, the CodeView Reader will: 1148// = Traverse the TPI/IPI stream (Type visitor): 1149// Collect forward references, scoped names, type indexes that will represent 1150// a logical element, strings, line records, linkage names. 1151// = Traverse the symbols section (Symbol visitor): 1152// Create the scopes tree and creates the required logical elements, by 1153// using the collected indexes from the type visitor. 1179// Detect the architecture from the object file. We usually don't need OS 1180// info to lookup a target and create register info. 1186// Features to be passed to target/subtarget 1193 FeaturesValue = *Features;
1210// Get Compilation Unit CPU Type. 1212// For CodeView the register always is in Operands[0]; bbsections Prepares for basic block sections
dxil pretty DXIL Metadata Pretty Printer
static const T * Find(StringRef S, ArrayRef< T > A)
Find KV in array using binary search.
mir Rename Register Operands
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static unsigned getSectionID(const ObjectFile &O, SectionRef Sec)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Provides read only access to a subclass of BinaryStream.
uint64_t getLength() const
Error readInteger(T &Dest)
Read an integer of the specified endianness into Dest and update the stream's offset.
uint64_t bytesRemaining() const
Error readFixedString(StringRef &Dest, uint32_t Length)
Read a Length byte string into Dest.
Error readArray(ArrayRef< T > &Array, uint32_t NumElements)
Get a reference to a NumElements element array of objects of type T from the underlying stream as if ...
Error skip(uint64_t Amount)
Advance the stream's offset by Amount bytes.
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
Represents either an error or a value T.
std::error_code getError() const
Subclass of Error for the sole purpose of identifying the success path in the type system.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
Error takeError()
Take ownership of the stored error.
reference get()
Returns a reference to the stored T value.
FixedStreamArray is similar to VarStreamArray, except with each record having a fixed-length.
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFileOrSTDIN(const Twine &Filename, bool IsText=false, bool RequiresNullTerminator=true, std::optional< Align > Alignment=std::nullopt)
Open the specified file as a MemoryBuffer, or open stdin if the Filename is "-".
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFile(const Twine &Filename, bool IsText=false, bool RequiresNullTerminator=true, bool IsVolatile=false, std::optional< Align > Alignment=std::nullopt)
Open the specified file as a MemoryBuffer, returning a new MemoryBuffer if successful,...
Wrapper class representing virtual and physical registers.
virtual void printString(StringRef Value)
virtual raw_ostream & getOStream()
virtual raw_ostream & startLine()
virtual void printNumber(StringRef Label, char Value)
void printHex(StringRef Label, T Value)
void printSymbolOffset(StringRef Label, StringRef Symbol, T Value)
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
size_type count(StringRef Key) const
count - Return 1 if the element is in the map, 0 otherwise.
StringRef - Represent a constant reference to a string, i.e.
std::string str() const
str - Get the contents as an std::string.
const unsigned char * bytes_end() const
StringRef drop_front(size_t N=1) const
Return a StringRef equal to 'this' but with the first N elements dropped.
constexpr size_t size() const
size - Get the string size.
constexpr const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
const unsigned char * bytes_begin() const
Manages the enabling and disabling of subtarget specific features.
std::string getString() const
Returns features as a string.
Symbol info for RuntimeDyld.
Triple - Helper class for working with autoconf configuration names.
The instances of the Type class are immutable: once they are created, they are never changed.
VarStreamArray represents an array of variable length records backed by a stream.
void setUnderlyingStream(BinaryStreamRef NewStream, uint32_t NewSkew=0)
Iterator at(uint32_t Offset) const
given an offset into the array's underlying stream, return an iterator to the record at that offset.
Iterator begin(bool *HadError=nullptr) const
Error initialize(BinaryStreamReader Reader)
const FileChecksumArray & getArray() const
Expected< StringRef > getString(uint32_t Offset) const
Error initialize(BinaryStreamRef Contents)
uint32_t getSignature() const
Provides amortized O(1) random access to a CodeView type stream.
uint32_t getSignature() const
StringRef getPrecompFilePath() const
uint32_t getTypesCount() const
void addCallbackToPipeline(SymbolVisitorCallbacks &Callbacks)
StringRef getName() const
const GUID & getGuid() const
Stores all information relating to a compile unit, be it in its original instance in the object file ...
const LVSymbolTableEntry & getSymbolTableEntry(StringRef Name)
void includeInlineeLines(LVSectionIndex SectionIndex, LVScope *Function)
LVAddress linearAddress(uint16_t Segment, uint32_t Offset, LVAddress Addendum=0)
void addToSymbolTable(StringRef Name, LVScope *Function, LVSectionIndex SectionIndex=0)
void processLines(LVLines *DebugLines, LVSectionIndex SectionIndex)
void mapVirtualAddress(const object::ObjectFile &Obj)
LVRange * getSectionRanges(LVSectionIndex SectionIndex)
Error loadGenericTargetInfo(StringRef TheTriple, StringRef TheFeatures)
Error createInstructions()
void getLinkageName(const llvm::object::coff_section *CoffSection, uint32_t RelocOffset, uint32_t Offset, StringRef *RelocSym)
void print(raw_ostream &OS) const
static std::string formatRegisterId(RegisterId Register, CPUType CPU)
std::string getRegisterName(LVSmall Opcode, ArrayRef< uint64_t > Operands) override
LVScope * getScopeForModule(uint32_t Modi)
Error createScopes() override
static StringRef getSymbolKindName(SymbolKind Kind)
bool isSystemEntry(LVElement *Element, StringRef Name) const override
void sortScopes() override
StringRef getName() const override
void addInlineeInfo(TypeIndex TI, uint32_t LineNumber, StringRef Filename)
void printTypeIndex(StringRef FieldName, TypeIndex TI, uint32_t StreamIdx)
void setRoot(LVScope *Root)
void setInput(std::shared_ptr< llvm::pdb::InputFile > TypeServer)
LVAddress getLower() const
LVAddress getUpper() const
std::string FileFormatName
codeview::CPUType getCompileUnitCPUType()
std::string createAlternativePath(StringRef From)
LVSectionIndex DotTextSectionIndex
virtual Error createScopes()
void transformScopedName()
basic_symbol_iterator symbol_end() const override
const coff_section * getCOFFSection(const SectionRef &Section) const
This class is the base class for all object file types.
virtual Expected< SubtargetFeatures > getFeatures() const =0
section_iterator_range sections() const
virtual Triple::ArchType getArch() const =0
This is a value type class that represents a single relocation in the list of relocations in the obje...
This is a value type class that represents a single section in the list of sections in the object fil...
This is a value type class that represents a single symbol in the list of symbols in the object file.
A readonly view of a hash table used in the globals and publics streams.
const GSIHashTable & getGlobalsTable() const
BinarySubstreamRef getSymbolsSubstream() const
const codeview::CVSymbolArray & getSymbolArray() const
Expected< StringRef > getNameFromChecksums(uint32_t Offset) const
uint32_t getNumTypeRecords() const
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char SymbolName[]
Key for Kernel::Metadata::mSymbolName.
@ IMAGE_SYM_DTYPE_FUNCTION
A function that returns a base type.
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn....
Error visitTypeStream(const CVTypeArray &Types, TypeVisitorCallbacks &Callbacks, VisitorDataSource Source=VDS_BytesPresent)
SymbolKind
Duplicate copy of the above enum, but using the official CV names.
@ D
The DMD compiler emits 'D' for the CV source language.
Expected< CVSymbol > readSymbolFromStream(BinaryStreamRef Stream, uint32_t Offset)
Scope
Defines the scope in which this symbol should be visible: Default – Visible in the public interface o...
static const char Magic[]
Expected< std::unique_ptr< Binary > > createBinary(MemoryBufferRef Source, LLVMContext *Context=nullptr, bool InitContent=true)
Create a Binary from Source, autodetecting the file type.
Expected< ModuleDebugStreamRef > getModuleDebugStream(PDBFile &File, StringRef &ModuleName, uint32_t Index)
Error loadDataForPDB(PDB_ReaderType Type, StringRef Path, std::unique_ptr< IPDBSession > &Session)
Error iterateSymbolGroups(InputFile &Input, const PrintScope &HeaderScope, CallbackT Callback)
This is an optimization pass for GlobalISel generic memory operations.
file_magic identify_magic(StringRef magic)
Identify the type of a binary file based on how magical it is.
std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
void sort(IteratorTy Start, IteratorTy End)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
raw_ostream & nulls()
This returns a reference to a raw_ostream which simply discards output.
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
support::detail::AlignAdapter< T > fmt_align(T &&Item, AlignStyle Where, size_t Amount, char Fill=' ')
Error errorCodeToError(std::error_code EC)
Helper for converting an std::error_code to a Error.
std::error_code errorToErrorCode(Error Err)
Helper for converting an ECError to a std::error_code.
void consumeError(Error Err)
Consume a Error without doing anything.
@ pdb
Windows PDB debug info file.
@ pecoff_executable
PECOFF executable file.