14#ifndef LLVM_DEBUGINFO_LOGICALVIEW_READERS_LVBINARYREADER_H
15#define LLVM_DEBUGINFO_LOGICALVIEW_READERS_LVBINARYREADER_H
51 using LVSymbolNames = std::map<std::string, LVSymbolTableEntry, std::less<>>;
52 LVSymbolNames SymbolNames;
78 using LVInlineeLine = std::map<LVScope *, std::unique_ptr<LVLines>>;
79 LVInlineeLine CUInlineeLines;
90 using LVSectionAddresses = std::map<LVSectionIndex, object::SectionRef>;
91 LVSectionAddresses SectionAddresses;
94 if (SectionAddresses.find(Section.getAddress()) == SectionAddresses.end())
95 SectionAddresses.emplace(Section.getAddress(), Section);
103 using LVSections = std::map<LVSectionIndex, object::SectionRef>;
106 std::vector<std::unique_ptr<LVLines>> DiscoveredLines;
113 std::unique_ptr<const MCRegisterInfo>
MRI;
115 std::unique_ptr<const MCAsmInfo>
MAI;
116 std::unique_ptr<const MCSubtargetInfo>
STI;
117 std::unique_ptr<const MCInstrInfo>
MII;
118 std::unique_ptr<const MCDisassembler>
MD;
119 std::unique_ptr<MCContext>
MC;
120 std::unique_ptr<MCInstPrinter>
MIP;
204 CUInlineeLines.emplace(Scope, std::make_unique<LVLines>(std::move(Lines)));
210 return ImageBaseAddress + (Segment * VirtualAddress) +
Offset + Addendum;
231#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
Represent a constant reference to a string, i.e.
LLVM_ABI const LVSymbolTableEntry & getSymbolTableEntry(StringRef Name)
LLVM_ABI LVSectionIndex updateSymbolTable(LVScope *Function)
LLVM_ABI Expected< std::pair< LVSectionIndex, object::SectionRef > > getSection(LVScope *Scope, LVAddress Address, LVSectionIndex SectionIndex)
~LVBinaryReader() override=default
LVSectionIndex getSectionIndex(LVScope *Scope) override
std::unique_ptr< MCContext > MC
LLVM_ABI void includeInlineeLines(LVSectionIndex SectionIndex, LVScope *Function)
std::unique_ptr< const MCInstrInfo > MII
LLVM_ABI Error loadGenericTargetInfo(StringRef TheTriple, StringRef TheFeatures, StringRef TheCPU)
void addInlineeLines(LVScope *Scope, LVLines &Lines)
LVBinaryReader(const LVBinaryReader &)=delete
LLVM_ABI LVAddress getSymbolTableAddress(StringRef Name)
LLVM_ABI void print(raw_ostream &OS) const
std::unique_ptr< const MCSubtargetInfo > STI
LVAddress linearAddress(uint16_t Segment, uint32_t Offset, LVAddress Addendum=0)
LLVM_ABI void addToSymbolTable(StringRef Name, LVScope *Function, LVSectionIndex SectionIndex=0)
virtual void mapRangeAddress(const object::ObjectFile &Obj)
LLVM_ABI void processLines(LVLines *DebugLines, LVSectionIndex SectionIndex)
LLVM_ABI void mapVirtualAddress(const object::ObjectFile &Obj)
std::unique_ptr< const MCAsmInfo > MAI
LLVM_ABI LVSectionIndex getSymbolTableIndex(StringRef Name)
LVBinaryReader & operator=(const LVBinaryReader &)=delete
virtual void mapRangeAddress(const object::ObjectFile &Obj, const object::SectionRef &Section, bool IsComdat)
LLVM_ABI bool getSymbolTableIsComdat(StringRef Name)
std::unique_ptr< const MCRegisterInfo > MRI
LVBinaryReader(StringRef Filename, StringRef FileFormatName, ScopedPrinter &W, LVBinaryType BinaryType)
std::unique_ptr< const MCDisassembler > MD
LLVM_ABI Error createInstructions()
std::unique_ptr< MCInstPrinter > MIP
LVAddress WasmCodeSectionOffset
MCTargetOptions MCOptions
std::string FileFormatName
LVSectionIndex DotTextSectionIndex
LLVM_ABI LVSectionIndex getIndex(StringRef Name)
LLVM_ABI bool getIsComdat(StringRef Name)
LLVM_ABI void print(raw_ostream &OS)
LLVM_ABI LVAddress getAddress(StringRef Name)
LLVM_ABI void add(StringRef Name, LVScope *Function, LVSectionIndex SectionIndex=0)
LLVM_ABI LVSectionIndex update(LVScope *Function)
LLVM_ABI const LVSymbolTableEntry & getEntry(StringRef Name)
This class is the base class for all object file types.
This is a value type class that represents a single section in the list of sections in the object fil...
This class implements an extremely fast bulk output stream that can only output to a stream.
std::pair< LVAddress, uint64_t > LVNameInfo
constexpr bool UpdateHighAddress
SmallVector< LVLine *, 8 > LVLines
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
LVSectionIndex SectionIndex
LVSymbolTableEntry()=default
LVSymbolTableEntry(LVScope *Scope, LVAddress Address, LVSectionIndex SectionIndex, bool IsComdat)