22 kDataIDFunctionBasenames = 1u,
23 kDataIDFunctionFullnames,
24 kDataIDFunctionMethods,
25 kDataIDFunctionSelectors,
26 kDataIDFunctionObjcClassSelectors,
40std::optional<IndexSet<NameToDIE>>
45 if (!strtab.
Decode(data, offset_ptr))
48 llvm::StringRef identifier((
const char *)data.
GetData(offset_ptr, 4), 4);
51 const uint32_t version = data.
GetU32(offset_ptr);
57 switch (data.
GetU8(offset_ptr)) {
62 case kDataIDFunctionBasenames:
66 case kDataIDFunctionFullnames:
70 case kDataIDFunctionMethods:
74 case kDataIDFunctionSelectors:
78 case kDataIDFunctionObjcClassSelectors:
83 if (!result.
globals.Decode(data, offset_ptr, strtab))
87 if (!result.
types.Decode(data, offset_ptr, strtab))
90 case kDataIDNamespaces:
91 if (!result.
namespaces.Decode(data, offset_ptr, strtab))
96 return std::move(result);
117 index_encoder.
AppendU8(kDataIDFunctionBasenames);
121 index_encoder.
AppendU8(kDataIDFunctionFullnames);
125 index_encoder.
AppendU8(kDataIDFunctionMethods);
129 index_encoder.
AppendU8(kDataIDFunctionSelectors);
133 index_encoder.
AppendU8(kDataIDFunctionObjcClassSelectors);
137 index_encoder.
AppendU8(kDataIDGlobals);
138 set.
globals.Encode(index_encoder, strtab);
140 if (!set.
types.IsEmpty()) {
141 index_encoder.
AppendU8(kDataIDTypes);
142 set.
types.Encode(index_encoder, strtab);
145 index_encoder.
AppendU8(kDataIDNamespaces);
static constexpr uint32_t CURRENT_CACHE_VERSION
static constexpr llvm::StringLiteral kIdentifierManualDWARFIndex("DIDX")
Many cache files require string tables to store data efficiently.
bool Encode(DataEncoder &encoder)
An binary data encoding class.
lldb::ByteOrder GetByteOrder() const
llvm::ArrayRef< uint8_t > GetData() const
Get a access to the bytes that this references.
void AppendU32(uint32_t value)
void AppendU8(uint8_t value)
Append a unsigned integer to the end of the owned data.
void AppendData(llvm::StringRef data)
Append a bytes to the end of the owned data.
uint8_t GetAddressByteSize() const
The address size to use when encoding pointers or addresses.
Many cache files require string tables to store data efficiently.
bool Decode(const DataExtractor &data, lldb::offset_t *offset_ptr)
std::optional< IndexSet< NameToDIE > > DecodeIndexSet(const DataExtractor &data, lldb::offset_t *offset_ptr)
void EncodeIndexSet(const IndexSet< NameToDIE > &set, DataEncoder &encoder)
A class that represents a running process on the host machine.