34 llvm::function_ref<
bool(
DIERef ref)> callback)
const {
36 if (!callback(entry.value))
42 llvm::function_ref<
bool(
DIERef ref)> callback)
const {
43 for (
const auto &entry :
m_map)
44 if (regex.
Execute(entry.cstring.GetCString())) {
45 if (!callback(entry.value))
52 DWARFUnit &s_unit, llvm::function_ref<
bool(
DIERef ref)> callback)
const {
55 for (
uint32_t i = 0; i < size; ++i) {
61 if (!callback(die_ref))
69 for (
uint32_t i = 0; i < size; ++i) {
79 for (
uint32_t i = 0; i < size; ++i) {
88 for (
uint32_t i = 0; i < size; ++i) {
99 llvm::StringRef identifier((
const char *)data.
GetData(offset_ptr, 4), 4);
104 for (
uint32_t i = 0; i < count; ++i) {
105 llvm::StringRef str(strtab.
Get(data.
GetU32(offset_ptr)));
109 if (std::optional<DIERef> die_ref =
DIERef::Decode(data, offset_ptr))
130 for (
const auto &entry :
m_map) {
132 assert((
bool)entry.cstring);
133 encoder.AppendU32(strtab.
Add(entry.cstring));
134 entry.value.Encode(encoder);
142 for (
size_t i = 0; i < size; ++i) {
constexpr llvm::StringLiteral kIdentifierNameToDIE("N2DI")
Identifies a DWARF debug info entry within a given Module.
std::optional< uint32_t > file_index() const
static std::optional< DIERef > Decode(const lldb_private::DataExtractor &data, lldb::offset_t *offset_ptr)
Decode a serialized version of this object from data.
dw_offset_t die_offset() const
DIERef::Section GetDebugSection() const
SymbolFileDWARF & GetSymbolFileDWARF() const
dw_offset_t GetNextUnitOffset() const
DWARFUnit & GetNonSkeletonUnit()
dw_offset_t GetOffset() const
lldb_private::UniqueCStringMap< DIERef > m_map
void Append(const NameToDIE &other)
bool Find(lldb_private::ConstString name, llvm::function_ref< bool(DIERef ref)> callback) const
bool Decode(const lldb_private::DataExtractor &data, lldb::offset_t *offset_ptr, const lldb_private::StringTableReader &strtab)
Decode a serialized version of this object from data.
void Insert(lldb_private::ConstString name, const DIERef &die_ref)
void FindAllEntriesForUnit(DWARFUnit &unit, llvm::function_ref< bool(DIERef ref)> callback) const
unit must be the skeleton unit if possible, not GetNonSkeletonUnit().
void Encode(lldb_private::DataEncoder &encoder, lldb_private::ConstStringTable &strtab) const
Encode this object into a data encoder object.
void Dump(lldb_private::Stream *s)
bool operator==(const NameToDIE &rhs) const
Used for unit testing the encoding and decoding.
void ForEach(std::function< bool(lldb_private::ConstString name, const DIERef &die_ref)> const &callback) const
std::optional< uint64_t > GetFileIndex() const
Many cache files require string tables to store data efficiently.
uint32_t Add(ConstString s)
Add a string into the string table.
A uniqued constant string class.
bool Execute(llvm::StringRef string, llvm::SmallVectorImpl< llvm::StringRef > *matches=nullptr) const
Execute a regular expression match using the compiled regular expression that is already in this obje...
A stream class that can stream formatted output to a file.
void Format(const char *format, Args &&... args)
Many cache files require string tables to store data efficiently.
llvm::StringRef Get(uint32_t offset) const
ConstString GetCStringAtIndexUnchecked(uint32_t idx) const
llvm::iterator_range< const_iterator > equal_range(ConstString unique_cstr) const
const T & GetValueRefAtIndexUnchecked(uint32_t idx) const
ConstString GetCStringAtIndex(uint32_t idx) const
T GetValueAtIndexUnchecked(uint32_t idx) const
void Append(ConstString unique_cstr, const T &value)
A class that represents a running process on the host machine.