14#ifndef LLVM_DEBUGINFO_LOGICALVIEW_READERS_LVBINARYREADER_H
15#define LLVM_DEBUGINFO_LOGICALVIEW_READERS_LVBINARYREADER_H
31namespace logicalview {
50 using LVSymbolNames = std::map<std::string, LVSymbolTableEntry>;
51 LVSymbolNames SymbolNames;
76 using LVInlineeLine = std::map<LVScope *, std::unique_ptr<LVLines>>;
77 LVInlineeLine CUInlineeLines;
88 using LVSectionAddresses = std::map<LVSectionIndex, object::SectionRef>;
89 LVSectionAddresses SectionAddresses;
92 if (SectionAddresses.find(Section.getAddress()) == SectionAddresses.end())
93 SectionAddresses.emplace(Section.getAddress(), Section);
99 using LVSectionRanges = std::map<LVSectionIndex, std::unique_ptr<LVRange>>;
100 LVSectionRanges SectionRanges;
107 using LVSections = std::map<LVSectionIndex, object::SectionRef>;
110 std::vector<std::unique_ptr<LVLines>> DiscoveredLines;
117 std::unique_ptr<const MCRegisterInfo>
MRI;
118 std::unique_ptr<const MCAsmInfo>
MAI;
119 std::unique_ptr<const MCSubtargetInfo>
STI;
120 std::unique_ptr<const MCInstrInfo>
MII;
121 std::unique_ptr<const MCDisassembler>
MD;
122 std::unique_ptr<MCContext>
MC;
123 std::unique_ptr<MCInstPrinter>
MIP;
208 CUInlineeLines.emplace(Scope, std::make_unique<LVLines>(std::move(
Lines)));
214 return ImageBaseAddress + (Segment * VirtualAddress) +
Offset + Addendum;
235#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.
StringRef - Represent a constant reference to a string, i.e.
const LVSymbolTableEntry & getSymbolTableEntry(StringRef Name)
LVSectionIndex updateSymbolTable(LVScope *Function)
Expected< std::pair< LVSectionIndex, object::SectionRef > > getSection(LVScope *Scope, LVAddress Address, LVSectionIndex SectionIndex)
LVSectionIndex getSectionIndex(LVScope *Scope) override
std::unique_ptr< MCContext > MC
virtual ~LVBinaryReader()=default
void includeInlineeLines(LVSectionIndex SectionIndex, LVScope *Function)
std::unique_ptr< const MCInstrInfo > MII
void addInlineeLines(LVScope *Scope, LVLines &Lines)
LVBinaryReader(const LVBinaryReader &)=delete
LVAddress getSymbolTableAddress(StringRef Name)
void print(raw_ostream &OS) const
std::unique_ptr< const MCSubtargetInfo > STI
LVAddress linearAddress(uint16_t Segment, uint32_t Offset, LVAddress Addendum=0)
void addToSymbolTable(StringRef Name, LVScope *Function, LVSectionIndex SectionIndex=0)
virtual void mapRangeAddress(const object::ObjectFile &Obj)
void processLines(LVLines *DebugLines, LVSectionIndex SectionIndex)
void mapVirtualAddress(const object::ObjectFile &Obj)
std::unique_ptr< const MCAsmInfo > MAI
LVSectionIndex getSymbolTableIndex(StringRef Name)
LVBinaryReader & operator=(const LVBinaryReader &)=delete
virtual void mapRangeAddress(const object::ObjectFile &Obj, const object::SectionRef &Section, bool IsComdat)
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
LVRange * getSectionRanges(LVSectionIndex SectionIndex)
Error loadGenericTargetInfo(StringRef TheTriple, StringRef TheFeatures)
void addSectionRange(LVSectionIndex SectionIndex, LVScope *Scope)
Error createInstructions()
std::unique_ptr< MCInstPrinter > MIP
LVAddress WasmCodeSectionOffset
The logical reader owns of all the logical elements created during the debug information parsing.
std::string FileFormatName
LVSectionIndex DotTextSectionIndex
LVSectionIndex getIndex(StringRef Name)
bool getIsComdat(StringRef Name)
void print(raw_ostream &OS)
LVAddress getAddress(StringRef Name)
void add(StringRef Name, LVScope *Function, LVSectionIndex SectionIndex=0)
LVSectionIndex update(LVScope *Function)
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
This is an optimization pass for GlobalISel generic memory operations.
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)