26void DWARFGdbIndex::dumpCUList(
raw_ostream &OS)
const {
27 OS <<
formatv(
"\n CU list offset = {0:x}, has {1} entries:", CuListOffset,
31 for (
const CompUnitEntry &CU : CuList)
32 OS <<
formatv(
" {0}: Offset = {1:x}, Length = {2:x}\n",
I++, CU.Offset,
36void DWARFGdbIndex::dumpTUList(
raw_ostream &OS)
const {
37 OS <<
formatv(
"\n Types CU list offset = {0:x}, has {1} entries:\n",
38 TuListOffset, TuList.size());
40 for (
const TypeUnitEntry &TU : TuList)
41 OS <<
formatv(
" {0}: offset = {1:x8}, type_offset = {2:x8}, "
42 "type_signature = {3:x16}\n",
43 I++, TU.Offset, TU.TypeOffset, TU.TypeSignature);
46void DWARFGdbIndex::dumpAddressArea(
raw_ostream &OS)
const {
47 OS <<
formatv(
"\n Address area offset = {0:x}, has {1} entries:",
48 AddressAreaOffset, AddressArea.size())
50 for (
const AddressEntry &Addr : AddressArea)
51 OS <<
formatv(
" Low/High address = [{0:x}, {1:x}) (Size: {2:x}), CU "
53 Addr.LowAddress, Addr.HighAddress,
54 Addr.HighAddress - Addr.LowAddress, Addr.CuIndex);
57void DWARFGdbIndex::dumpSymbolTable(
raw_ostream &OS)
const {
58 OS <<
formatv(
"\n Symbol table offset = {0:x}, size = {1}, filled slots:",
59 SymbolTableOffset, SymbolTable.size())
62 const auto FindCuVectorId = [&](uint32_t VecOffset) {
67 [](
const auto &ConstantPoolEntry, uint32_t
Offset) {
68 return ConstantPoolEntry.first <
Offset;
70 assert(It != ConstantPoolVectors.end() && It->first == VecOffset &&
71 "Invalid symbol table");
72 return It - ConstantPoolVectors.begin();
76 for (
const SymTableEntry &
E : SymbolTable) {
78 if (!
E.NameOffset && !
E.VecOffset)
81 OS <<
formatv(
" {0}: Name offset = {1:x}, CU vector offset = {2:x}\n",
I,
82 E.NameOffset,
E.VecOffset);
84 StringRef
Name = ConstantPoolStrings.substr(
85 ConstantPoolOffset - StringPoolOffset +
E.NameOffset);
87 const uint32_t CuVectorId = FindCuVectorId(
E.VecOffset);
88 OS <<
formatv(
" String name: {0}, CU vector index: {1}\n",
Name.data(),
93void DWARFGdbIndex::dumpConstantPool(
raw_ostream &OS)
const {
94 OS <<
formatv(
"\n Constant pool offset = {0:x}, has {1} CU vectors:",
95 ConstantPoolOffset, ConstantPoolVectors.size());
97 for (
const auto &V : ConstantPoolVectors) {
98 OS <<
formatv(
"\n {0}({1:x}): ",
I++,
V.first);
99 for (uint32_t Val :
V.second)
107 OS <<
"\n<error parsing>\n";
112 OS <<
" Version = " << Version <<
'\n';
117 dumpConstantPool(OS);
135 if (
Offset != CuListOffset)
138 uint32_t CuListSize = (TuListOffset - CuListOffset) / 16;
140 for (
uint32_t i = 0; i < CuListSize; ++i) {
148 uint32_t TuListSize = (AddressAreaOffset - TuListOffset) / 24;
149 TuList.resize(TuListSize);
150 for (uint32_t
I = 0;
I < TuListSize; ++
I) {
154 TuList[
I] = {CuOffset, TypeOffset, Signature};
157 uint32_t AddressAreaSize = (SymbolTableOffset - AddressAreaOffset) / 20;
158 AddressArea.reserve(AddressAreaSize);
159 for (uint32_t i = 0; i < AddressAreaSize; ++i) {
163 AddressArea.push_back({LowAddress, HighAddress, CuIndex});
174 uint32_t SymTableSize = (ConstantPoolOffset - SymbolTableOffset) / 8;
175 SymbolTable.reserve(SymTableSize);
176 std::set<uint32_t> CUOffsets;
177 for (uint32_t i = 0; i < SymTableSize; ++i) {
180 SymbolTable.push_back({NameOffset, CuVecOffset});
181 if (NameOffset || CuVecOffset)
182 CUOffsets.insert(CuVecOffset);
188 for (
auto CUOffset : CUOffsets) {
189 Offset = ConstantPoolOffset + CUOffset;
190 ConstantPoolVectors.emplace_back(0, SmallVector<uint32_t, 0>());
191 auto &Vec = ConstantPoolVectors.back();
192 Vec.first =
Offset - ConstantPoolOffset;
195 for (uint32_t J = 0; J < Num; ++J)
199 ConstantPoolStrings =
Data.getData().drop_front(
Offset);
200 StringPoolOffset =
Offset;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file defines the SmallVector class.
void dump(raw_ostream &OS)
void parse(DataExtractor Data)
void reserve(size_type N)
void push_back(const T &Elt)
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
FunctionAddr VTableAddr uintptr_t uintptr_t Version
FunctionAddr VTableAddr uintptr_t uintptr_t Data
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...