9#ifndef LLDB_SYMBOL_SYMTAB_H
10#define LLDB_SYMBOL_SYMTAB_H
100 Debug symbol_debug_type,
101 Visibility symbol_visibility, uint32_t &start_idx);
109 std::vector<uint32_t> &indexes,
110 uint32_t start_idx = 0,
114 std::vector<uint32_t> &indexes, uint32_t start_idx = 0,
117 Debug symbol_debug_type,
119 std::vector<uint32_t> &matches,
120 uint32_t start_idx = 0,
123 std::vector<uint32_t> &matches);
125 Debug symbol_debug_type,
127 std::vector<uint32_t> &matches);
130 std::vector<uint32_t> &matches);
133 Debug symbol_debug_type,
135 std::vector<uint32_t> &matches);
138 std::vector<uint32_t> &indexes,
143 std::vector<uint32_t> &indexes,
148 std::vector<uint32_t> &symbol_indexes);
151 Debug symbol_debug_type,
153 std::vector<uint32_t> &symbol_indexes);
157 std::vector<uint32_t> &symbol_indexes,
161 Debug symbol_debug_type,
171 bool remove_duplicates)
const;
289 bool operator()(
const uint32_t a_data,
const uint32_t b_data)
const {
295 int rank(
const uint32_t data)
const {
322 std::map<lldb::FunctionNameType, UniqueCStringMap<uint32_t>>
335 std::atomic<uint32_t>
m_state = lldb::eSymtabStateNone;
347 switch (symbol_debug_type) {
362 switch (symbol_visibility) {
393 std::vector<uint32_t> &indexes);
400 std::set<const char *> &class_contexts,
401 std::vector<std::pair<NameToIndexMap::Entry, const char *>> &backlog);
404 const char *decl_context,
405 const std::set<const char *> &class_contexts);
A uniqued constant string class.
An binary data encoding class.
A plug-in interface definition class for object file parsers.
A stream class that can stream formatted output to a file.
Defines a list of symbol context objects.
bool operator()(const uint32_t a_data, const uint32_t b_data) const
FileRangeToIndexMapCompare(const Symtab &symtab)
int rank(const uint32_t data) const
Symbol * FindSymbolByID(lldb::user_id_t uid) const
void RegisterMangledNameEntry(uint32_t value, const Mangled::FunctionNameParts &parts, std::set< const char * > &class_contexts, std::vector< std::pair< NameToIndexMap::Entry, const char * > > &backlog)
Symbol * SymbolAtIndex(size_t idx)
Symbol * FindFirstSymbolWithNameAndType(ConstString name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility)
bool m_name_indexes_computed
std::atomic< uint32_t > m_state
A bitmask of lldb::SymtabState flags.
void ForEachSymbolContainingFileAddress(lldb::addr_t file_addr, std::function< bool(Symbol *)> const &callback)
Symbol * Resize(size_t count)
collection::iterator iterator
Symbol * FindSymbolAtFileAddress(lldb::addr_t file_addr)
Symbol * FindSymbolContainingFileAddress(lldb::addr_t file_addr)
FileRangeToIndexMap m_file_addr_to_index
std::recursive_mutex m_mutex
Provide thread safety for this symbol table.
Symbol * FindSymbolWithType(lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, uint32_t &start_idx)
void SortSymbolIndexesByValue(std::vector< uint32_t > &indexes, bool remove_duplicates) const
uint32_t AddSymbol(const Symbol &symbol)
std::optional< bool > m_has_source_files
Set by the object file plug-in, or calculated and cached by HasSourceFiles().
void FindAllSymbolsMatchingRexExAndType(const RegularExpression ®ex, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector< uint32_t > &symbol_indexes, Mangled::NamePreference name_preference=Mangled::ePreferDemangled)
uint32_t GetNameIndexes(ConstString symbol_name, std::vector< uint32_t > &indexes)
A helper function that looks up full function names.
bool HasDebugMap() const
Check if this symbol table has a debug map, see SetHasDebugMap().
void Dump(Stream *s, Target *target, SortOrder sort_type, Mangled::NamePreference name_preference=Mangled::ePreferDemangled)
uint32_t AppendSymbolIndexesWithName(ConstString symbol_name, std::vector< uint32_t > &matches)
void RegisterBacklogEntry(const NameToIndexMap::Entry &entry, const char *decl_context, const std::set< const char * > &class_contexts)
static void DumpSymbolHeader(Stream *s)
uint32_t AppendSymbolIndexesWithType(lldb::SymbolType symbol_type, std::vector< uint32_t > &indexes, uint32_t start_idx=0, uint32_t end_index=UINT32_MAX) const
void SetHasDebugMap(bool has_debug_map)
Set whether this symbol table has a debug map.
void SaveToCache()
Save the symbol table data out into a cache.
std::recursive_mutex & GetMutex()
void SetWasLoadedFromCache()
Accessors for the bool that indicates if the debug info index was loaded from, or saved to the module...
std::vector< uint32_t > IndexCollection
ObjectFile * GetObjectFile() const
bool m_has_debug_map
Set by the object file plug-in, see SetHasDebugMap().
bool Decode(const DataExtractor &data, lldb::offset_t *offset_ptr)
Decode a serialized version of this object from data.
size_t GetNumSymbols() const
const Symtab & operator=(const Symtab &)=delete
uint32_t GetState() const
Returns a bitmask of lldb::SymtabState flags describing the state of this symbol table.
uint32_t GetIndexForSymbol(const Symbol *symbol) const
Symtab(const Symtab &)=delete
void SectionFileAddressesChanged()
bool m_file_addr_to_index_computed
bool CheckSymbolAtIndex(size_t idx, Debug symbol_debug_type, Visibility symbol_visibility) const
Symtab(ObjectFile *objfile)
std::map< lldb::FunctionNameType, UniqueCStringMap< uint32_t > > m_name_to_symbol_indices
Maps function names to symbol indices (grouped by FunctionNameTypes)
void FindAllSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, std::vector< uint32_t > &symbol_indexes)
void SetHasSourceFiles(bool has_source_files)
Set whether this symbol table contains any source file symbols.
bool HasSourceFiles() const
Check if this symbol table contains any source file symbols.
uint32_t AppendSymbolIndexesWithTypeAndFlagsValue(lldb::SymbolType symbol_type, uint32_t flags_value, std::vector< uint32_t > &indexes, uint32_t start_idx=0, uint32_t end_index=UINT32_MAX) const
void InitAddressIndexes()
std::string GetCacheKey()
Get the cache key string for this symbol table.
std::vector< Symbol > collection
void Reserve(size_t count)
const Symbol * GetParent(Symbol *symbol) const
Get the parent symbol for the given symbol.
void SetStateFlags(lldb::SymtabState state)
RangeDataVector< lldb::addr_t, lldb::addr_t, uint32_t, 0, FileRangeToIndexMapCompare > FileRangeToIndexMap
void CalculateHasSourceFiles() const
void SetSymbolFileAddedSymbols()
void SetWasSavedToCache()
bool Encode(DataEncoder &encoder) const
Encode this object into a data encoder object.
collection::const_iterator const_iterator
uint32_t AppendSymbolIndexesWithNameAndType(ConstString symbol_name, lldb::SymbolType symbol_type, std::vector< uint32_t > &matches)
void SymbolIndicesToSymbolContextList(std::vector< uint32_t > &symbol_indexes, SymbolContextList &sc_list)
bool LoadFromCache()
Load the symbol table from the index cache.
void FindFunctionSymbols(ConstString name, uint32_t name_type_mask, SymbolContextList &sc_list)
void SetWasParsedFromObjectFile()
UniqueCStringMap< uint32_t > NameToIndexMap
UniqueCStringMap< uint32_t > & GetNameToSymbolIndexMap(lldb::FunctionNameType type)
uint32_t AppendSymbolIndexesMatchingRegExAndType(const RegularExpression ®ex, lldb::SymbolType symbol_type, std::vector< uint32_t > &indexes, Mangled::NamePreference name_preference=Mangled::ePreferDemangled)
A class that represents a running process on the host machine.
The parts of a mangled function name used in the symbol table's indices.