LLDB mainline
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
lldb_private::Symtab Class Reference

#include <Symtab.h>

Classes

class  FileRangeToIndexMapCompare
 

Public Types

enum  Debug { eDebugNo , eDebugYes , eDebugAny }
 
enum  Visibility { eVisibilityAny , eVisibilityExtern , eVisibilityPrivate }
 
typedef std::vector< uint32_t > IndexCollection
 
typedef UniqueCStringMap< uint32_t > NameToIndexMap
 

Public Member Functions

 Symtab (ObjectFile *objfile)
 
 ~Symtab ()
 
void PreloadSymbols ()
 
void Reserve (size_t count)
 
SymbolResize (size_t count)
 
uint32_t AddSymbol (const Symbol &symbol)
 
size_t GetNumSymbols () const
 
void SectionFileAddressesChanged ()
 
void Dump (Stream *s, Target *target, SortOrder sort_type, Mangled::NamePreference name_preference=Mangled::ePreferDemangled)
 
void Dump (Stream *s, Target *target, std::vector< uint32_t > &indexes, Mangled::NamePreference name_preference=Mangled::ePreferDemangled) const
 
uint32_t GetIndexForSymbol (const Symbol *symbol) const
 
std::recursive_mutex & GetMutex ()
 
SymbolFindSymbolByID (lldb::user_id_t uid) const
 
SymbolSymbolAtIndex (size_t idx)
 
const SymbolSymbolAtIndex (size_t idx) const
 
SymbolFindSymbolWithType (lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, uint32_t &start_idx)
 
const SymbolGetParent (Symbol *symbol) const
 Get the parent symbol for the given symbol.
 
uint32_t AppendSymbolIndexesWithType (lldb::SymbolType symbol_type, std::vector< uint32_t > &indexes, uint32_t start_idx=0, uint32_t end_index=UINT32_MAX) const
 
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
 
uint32_t AppendSymbolIndexesWithType (lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector< uint32_t > &matches, uint32_t start_idx=0, uint32_t end_index=UINT32_MAX) const
 
uint32_t AppendSymbolIndexesWithName (ConstString symbol_name, std::vector< uint32_t > &matches)
 
uint32_t AppendSymbolIndexesWithName (ConstString symbol_name, Debug symbol_debug_type, Visibility symbol_visibility, std::vector< uint32_t > &matches)
 
uint32_t AppendSymbolIndexesWithNameAndType (ConstString symbol_name, lldb::SymbolType symbol_type, std::vector< uint32_t > &matches)
 
uint32_t AppendSymbolIndexesWithNameAndType (ConstString symbol_name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector< uint32_t > &matches)
 
uint32_t AppendSymbolIndexesMatchingRegExAndType (const RegularExpression &regex, lldb::SymbolType symbol_type, std::vector< uint32_t > &indexes, Mangled::NamePreference name_preference=Mangled::ePreferDemangled)
 
uint32_t AppendSymbolIndexesMatchingRegExAndType (const RegularExpression &regex, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector< uint32_t > &indexes, Mangled::NamePreference name_preference=Mangled::NamePreference::ePreferDemangled)
 
void FindAllSymbolsWithNameAndType (ConstString name, lldb::SymbolType symbol_type, std::vector< uint32_t > &symbol_indexes)
 
void FindAllSymbolsWithNameAndType (ConstString name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector< uint32_t > &symbol_indexes)
 
void FindAllSymbolsMatchingRexExAndType (const RegularExpression &regex, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector< uint32_t > &symbol_indexes, Mangled::NamePreference name_preference=Mangled::ePreferDemangled)
 
SymbolFindFirstSymbolWithNameAndType (ConstString name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility)
 
SymbolFindSymbolAtFileAddress (lldb::addr_t file_addr)
 
SymbolFindSymbolContainingFileAddress (lldb::addr_t file_addr)
 
void ForEachSymbolContainingFileAddress (lldb::addr_t file_addr, std::function< bool(Symbol *)> const &callback)
 
void FindFunctionSymbols (ConstString name, uint32_t name_type_mask, SymbolContextList &sc_list)
 
void SortSymbolIndexesByValue (std::vector< uint32_t > &indexes, bool remove_duplicates) const
 
void Finalize ()
 
void AppendSymbolNamesToMap (const IndexCollection &indexes, bool add_demangled, bool add_mangled, NameToIndexMap &name_to_index_map) const
 
ObjectFileGetObjectFile () const
 
bool Decode (const DataExtractor &data, lldb::offset_t *offset_ptr, bool &uuid_mismatch)
 Decode a serialized version of this object from data.
 
bool Encode (DataEncoder &encoder) const
 Encode this object into a data encoder object.
 
std::string GetCacheKey ()
 Get the cache key string for this symbol table.
 
void SaveToCache ()
 Save the symbol table data out into a cache.
 
bool LoadFromCache ()
 Load the symbol table from the index cache.
 
bool GetWasLoadedFromCache () const
 Accessors for the bool that indicates if the debug info index was loaded from, or saved to the module index cache.
 
void SetWasLoadedFromCache ()
 
bool GetWasSavedToCache () const
 
void SetWasSavedToCache ()
 

Static Public Member Functions

static void DumpSymbolHeader (Stream *s)
 

Protected Types

typedef std::vector< Symbolcollection
 
typedef collection::iterator iterator
 
typedef collection::const_iterator const_iterator
 
typedef RangeDataVector< lldb::addr_t, lldb::addr_t, uint32_t, 0, FileRangeToIndexMapCompareFileRangeToIndexMap
 

Protected Member Functions

void InitNameIndexes ()
 
void InitAddressIndexes ()
 

Protected Attributes

ObjectFilem_objfile
 
collection m_symbols
 
FileRangeToIndexMap m_file_addr_to_index
 
std::map< lldb::FunctionNameType, UniqueCStringMap< uint32_t > > m_name_to_symbol_indices
 Maps function names to symbol indices (grouped by FunctionNameTypes)
 
std::recursive_mutex m_mutex
 
bool m_file_addr_to_index_computed: 1
 
bool m_name_indexes_computed: 1
 
bool m_loaded_from_cache: 1
 
bool m_saved_to_cache: 1
 

Private Member Functions

UniqueCStringMap< uint32_t > & GetNameToSymbolIndexMap (lldb::FunctionNameType type)
 
bool CheckSymbolAtIndex (size_t idx, Debug symbol_debug_type, Visibility symbol_visibility) const
 
uint32_t GetNameIndexes (ConstString symbol_name, std::vector< uint32_t > &indexes)
 A helper function that looks up full function names.
 
void SymbolIndicesToSymbolContextList (std::vector< uint32_t > &symbol_indexes, SymbolContextList &sc_list)
 
void RegisterMangledNameEntry (uint32_t value, std::set< const char * > &class_contexts, std::vector< std::pair< NameToIndexMap::Entry, const char * > > &backlog, RichManglingContext &rmc)
 
void RegisterBacklogEntry (const NameToIndexMap::Entry &entry, const char *decl_context, const std::set< const char * > &class_contexts)
 
 Symtab (const Symtab &)=delete
 
const Symtaboperator= (const Symtab &)=delete
 

Detailed Description

Definition at line 22 of file Symtab.h.

Member Typedef Documentation

◆ collection

typedef std::vector<Symbol> lldb_private::Symtab::collection
protected

Definition at line 243 of file Symtab.h.

◆ const_iterator

typedef collection::const_iterator lldb_private::Symtab::const_iterator
protected

Definition at line 245 of file Symtab.h.

◆ FileRangeToIndexMap

Definition at line 269 of file Symtab.h.

◆ IndexCollection

typedef std::vector<uint32_t> lldb_private::Symtab::IndexCollection

Definition at line 24 of file Symtab.h.

◆ iterator

typedef collection::iterator lldb_private::Symtab::iterator
protected

Definition at line 244 of file Symtab.h.

◆ NameToIndexMap

Definition at line 25 of file Symtab.h.

Member Enumeration Documentation

◆ Debug

Enumerator
eDebugNo 
eDebugYes 
eDebugAny 

Definition at line 27 of file Symtab.h.

◆ Visibility

Enumerator
eVisibilityAny 
eVisibilityExtern 
eVisibilityPrivate 

Definition at line 33 of file Symtab.h.

Constructor & Destructor Documentation

◆ Symtab() [1/2]

Symtab::Symtab ( ObjectFile objfile)

Definition at line 34 of file Symtab.cpp.

References m_name_to_symbol_indices.

◆ ~Symtab()

Symtab::~Symtab ( )
default

◆ Symtab() [2/2]

lldb_private::Symtab::Symtab ( const Symtab )
privatedelete

Member Function Documentation

◆ AddSymbol()

uint32_t Symtab::AddSymbol ( const Symbol symbol)

◆ AppendSymbolIndexesMatchingRegExAndType() [1/2]

uint32_t Symtab::AppendSymbolIndexesMatchingRegExAndType ( const RegularExpression regex,
lldb::SymbolType  symbol_type,
Debug  symbol_debug_type,
Visibility  symbol_visibility,
std::vector< uint32_t > &  indexes,
Mangled::NamePreference  name_preference = Mangled::NamePreference::ePreferDemangled 
)

◆ AppendSymbolIndexesMatchingRegExAndType() [2/2]

uint32_t Symtab::AppendSymbolIndexesMatchingRegExAndType ( const RegularExpression regex,
lldb::SymbolType  symbol_type,
std::vector< uint32_t > &  indexes,
Mangled::NamePreference  name_preference = Mangled::ePreferDemangled 
)

◆ AppendSymbolIndexesWithName() [1/2]

uint32_t Symtab::AppendSymbolIndexesWithName ( ConstString  symbol_name,
Debug  symbol_debug_type,
Visibility  symbol_visibility,
std::vector< uint32_t > &  matches 
)

◆ AppendSymbolIndexesWithName() [2/2]

uint32_t Symtab::AppendSymbolIndexesWithName ( ConstString  symbol_name,
std::vector< uint32_t > &  matches 
)

◆ AppendSymbolIndexesWithNameAndType() [1/2]

uint32_t Symtab::AppendSymbolIndexesWithNameAndType ( ConstString  symbol_name,
lldb::SymbolType  symbol_type,
Debug  symbol_debug_type,
Visibility  symbol_visibility,
std::vector< uint32_t > &  matches 
)

Definition at line 737 of file Symtab.cpp.

References AppendSymbolIndexesWithName(), lldb::eSymbolTypeAny, m_mutex, and m_symbols.

◆ AppendSymbolIndexesWithNameAndType() [2/2]

uint32_t Symtab::AppendSymbolIndexesWithNameAndType ( ConstString  symbol_name,
lldb::SymbolType  symbol_type,
std::vector< uint32_t > &  matches 
)

◆ AppendSymbolIndexesWithType() [1/2]

uint32_t Symtab::AppendSymbolIndexesWithType ( lldb::SymbolType  symbol_type,
Debug  symbol_debug_type,
Visibility  symbol_visibility,
std::vector< uint32_t > &  matches,
uint32_t  start_idx = 0,
uint32_t  end_index = UINT32_MAX 
) const

Definition at line 537 of file Symtab.cpp.

References CheckSymbolAtIndex(), lldb::eSymbolTypeAny, m_mutex, and m_symbols.

◆ AppendSymbolIndexesWithType() [2/2]

uint32_t Symtab::AppendSymbolIndexesWithType ( lldb::SymbolType  symbol_type,
std::vector< uint32_t > &  indexes,
uint32_t  start_idx = 0,
uint32_t  end_index = UINT32_MAX 
) const

◆ AppendSymbolIndexesWithTypeAndFlagsValue()

uint32_t Symtab::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

◆ AppendSymbolNamesToMap()

void Symtab::AppendSymbolNamesToMap ( const IndexCollection indexes,
bool  add_demangled,
bool  add_mangled,
NameToIndexMap name_to_index_map 
) const

◆ CheckSymbolAtIndex()

bool lldb_private::Symtab::CheckSymbolAtIndex ( size_t  idx,
Debug  symbol_debug_type,
Visibility  symbol_visibility 
) const
inlineprivate

◆ Decode()

bool Symtab::Decode ( const DataExtractor data,
lldb::offset_t offset_ptr,
bool &  uuid_mismatch 
)

Decode a serialized version of this object from data.

Parameters
dataThe decoder object that references the serialized data.
offset_ptrA pointer that contains the offset from which the data will be decoded from that gets updated as data gets decoded.
[out]uuid_mismatchSet to true if a cache file exists but the UUID didn't match, false otherwise.
Returns
True if the symbol table is successfully decoded and can be used, false otherwise.

Definition at line 1303 of file Symtab.cpp.

References CURRENT_CACHE_VERSION, lldb_private::CacheSignature::Decode(), lldb_private::StringTableReader::Decode(), Decode(), DecodeCStrMap(), elapsed(), lldb_private::DataExtractor::GetData(), lldb_private::ModuleChild::GetModule(), GetNameToSymbolIndexMap(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU8(), kIdentifierSymbolTable(), m_name_indexes_computed, m_objfile, and m_symbols.

Referenced by Decode(), and LoadFromCache().

◆ Dump() [1/2]

void Symtab::Dump ( Stream s,
Target target,
SortOrder  sort_type,
Mangled::NamePreference  name_preference = Mangled::ePreferDemangled 
)

◆ Dump() [2/2]

void Symtab::Dump ( Stream s,
Target target,
std::vector< uint32_t > &  indexes,
Mangled::NamePreference  name_preference = Mangled::ePreferDemangled 
) const

◆ DumpSymbolHeader()

void Symtab::DumpSymbolHeader ( Stream s)
static

Definition at line 197 of file Symtab.cpp.

References lldb_private::Stream::Indent().

Referenced by Dump().

◆ Encode()

bool Symtab::Encode ( DataEncoder encoder) const

Encode this object into a data encoder object.

The encoding format for the symbol table is as follows:

This allows this object to be serialized to disk. The object file must have a valid Signature in order to be serialized as it is used to make sure the cached information matches when cached data is loaded at a later time. If the object file doesn't have a valid signature false will be returned and it will indicate we should not cache this data.

Parameters
encoderA data encoder object that serialized bytes will be encoded into.
Returns
True if the symbol table's object file can generate a valid signature and all data for the symbol table was encoded, false otherwise.

Signature signature; ConstStringTable strtab; Identifier four character code: 'SYMB' uint32_t version; uint32_t num_symbols; Symbol symbols[num_symbols]; uint8_t num_cstr_maps; UniqueCStringMap<uint32_t> cstr_maps[num_cstr_maps]

Definition at line 1256 of file Symtab.cpp.

References lldb_private::DataEncoder::AppendData(), lldb_private::DataEncoder::AppendU32(), lldb_private::DataEncoder::AppendU8(), CURRENT_CACHE_VERSION, lldb_private::ConstStringTable::Encode(), lldb_private::CacheSignature::Encode(), EncodeCStrMap(), lldb_private::DataEncoder::GetAddressByteSize(), lldb_private::DataEncoder::GetByteOrder(), lldb_private::DataEncoder::GetByteSize(), lldb_private::DataEncoder::GetData(), kIdentifierSymbolTable(), m_name_indexes_computed, m_name_to_symbol_indices, m_objfile, m_symbols, and lldb_private::DataEncoder::PutU8().

Referenced by SaveToCache().

◆ Finalize()

void Symtab::Finalize ( )

◆ FindAllSymbolsMatchingRexExAndType()

void Symtab::FindAllSymbolsMatchingRexExAndType ( const RegularExpression regex,
lldb::SymbolType  symbol_type,
Debug  symbol_debug_type,
Visibility  symbol_visibility,
std::vector< uint32_t > &  symbol_indexes,
Mangled::NamePreference  name_preference = Mangled::ePreferDemangled 
)

Definition at line 861 of file Symtab.cpp.

References AppendSymbolIndexesMatchingRegExAndType(), and m_mutex.

◆ FindAllSymbolsWithNameAndType() [1/2]

void Symtab::FindAllSymbolsWithNameAndType ( ConstString  name,
lldb::SymbolType  symbol_type,
Debug  symbol_debug_type,
Visibility  symbol_visibility,
std::vector< uint32_t > &  symbol_indexes 
)

◆ FindAllSymbolsWithNameAndType() [2/2]

void Symtab::FindAllSymbolsWithNameAndType ( ConstString  name,
lldb::SymbolType  symbol_type,
std::vector< uint32_t > &  symbol_indexes 
)

◆ FindFirstSymbolWithNameAndType()

Symbol * Symtab::FindFirstSymbolWithNameAndType ( ConstString  name,
lldb::SymbolType  symbol_type,
Debug  symbol_debug_type,
Visibility  symbol_visibility 
)

◆ FindFunctionSymbols()

void Symtab::FindFunctionSymbols ( ConstString  name,
uint32_t  name_type_mask,
SymbolContextList sc_list 
)

◆ FindSymbolAtFileAddress()

Symbol * Symtab::FindSymbolAtFileAddress ( lldb::addr_t  file_addr)

◆ FindSymbolByID()

Symbol * Symtab::FindSymbolByID ( lldb::user_id_t  uid) const

◆ FindSymbolContainingFileAddress()

Symbol * Symtab::FindSymbolContainingFileAddress ( lldb::addr_t  file_addr)

◆ FindSymbolWithType()

Symbol * Symtab::FindSymbolWithType ( lldb::SymbolType  symbol_type,
Debug  symbol_debug_type,
Visibility  symbol_visibility,
uint32_t &  start_idx 
)

◆ ForEachSymbolContainingFileAddress()

void Symtab::ForEachSymbolContainingFileAddress ( lldb::addr_t  file_addr,
std::function< bool(Symbol *)> const &  callback 
)

◆ GetCacheKey()

std::string Symtab::GetCacheKey ( )

Get the cache key string for this symbol table.

The cache key must start with the module's cache key and is followed by information that indicates this key is for caching the symbol table contents and should also include the has of the object file. A module can be represented by an ObjectFile object for the main executable, but can also have a symbol file that is from the same or a different object file. This means we might have two symbol tables cached in the index cache, one for the main executable and one for the symbol file.

Returns
The unique cache key used to save and retrieve data from the index cache.

Definition at line 1174 of file Symtab.cpp.

References lldb_private::ObjectFile::GetCacheHash(), lldb_private::ModuleChild::GetModule(), and m_objfile.

Referenced by LoadFromCache(), and SaveToCache().

◆ GetIndexForSymbol()

uint32_t Symtab::GetIndexForSymbol ( const Symbol symbol) const

◆ GetMutex()

std::recursive_mutex & lldb_private::Symtab::GetMutex ( )
inline

Definition at line 51 of file Symtab.h.

References m_mutex.

Referenced by lldb_private::ObjectFile::GetSymtab().

◆ GetNameIndexes()

uint32_t Symtab::GetNameIndexes ( ConstString  symbol_name,
std::vector< uint32_t > &  indexes 
)
private

A helper function that looks up full function names.

We generate unique names for synthetic symbols so that users can look them up by name when needed. But because doing so is uncommon in normal debugger use, we trade off some performance at lookup time for faster symbol table building by detecting these symbols and generating their names lazily, rather than adding them to the normal symbol indexes. This function does the job of first consulting the name indexes, and if that fails it extracts the information it needs from the synthetic name and locates the symbol.

Parameters
[in]symbol_nameThe symbol name to search for.
[out]indexesThe vector if symbol indexes to update with results.
Returns
The number of indexes added to the index vector. Zero if no matches were found.

Definition at line 650 of file Symtab.cpp.

References FindSymbolByID(), GetIndexForSymbol(), GetNameToSymbolIndexMap(), lldb_private::ConstString::GetStringRef(), lldb_private::Symbol::GetSyntheticSymbolPrefix(), and UINT32_MAX.

Referenced by AppendSymbolIndexesWithName().

◆ GetNameToSymbolIndexMap()

UniqueCStringMap< uint32_t > & lldb_private::Symtab::GetNameToSymbolIndexMap ( lldb::FunctionNameType  type)
inlineprivate

◆ GetNumSymbols()

size_t Symtab::GetNumSymbols ( ) const

◆ GetObjectFile()

ObjectFile * lldb_private::Symtab::GetObjectFile ( ) const
inline

◆ GetParent()

const Symbol * Symtab::GetParent ( Symbol symbol) const

Get the parent symbol for the given symbol.

Many symbols in symbol tables are scoped by other symbols that contain one or more symbol. This function will look for such a containing symbol and return it if there is one.

Definition at line 1161 of file Symtab.cpp.

References GetIndexForSymbol(), lldb_private::Symbol::GetSiblingIndex(), SymbolAtIndex(), and UINT32_MAX.

Referenced by lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::FindCompleteObjCDefinitionTypeForDIE().

◆ GetWasLoadedFromCache()

bool lldb_private::Symtab::GetWasLoadedFromCache ( ) const
inline

Accessors for the bool that indicates if the debug info index was loaded from, or saved to the module index cache.

In statistics it is handy to know if a module's debug info was loaded from or saved to the cache. When the debug info index is loaded from the cache startup times can be faster. When the cache is enabled and the debug info index is saved to the cache, debug sessions can be slower. These accessors can be accessed by the statistics and emitted to help track these costs.

Definition at line 228 of file Symtab.h.

References m_loaded_from_cache.

Referenced by lldb_private::DebuggerStats::ReportStatistics().

◆ GetWasSavedToCache()

bool lldb_private::Symtab::GetWasSavedToCache ( ) const
inline

Definition at line 234 of file Symtab.h.

References m_saved_to_cache.

Referenced by lldb_private::DebuggerStats::ReportStatistics().

◆ InitAddressIndexes()

void Symtab::InitAddressIndexes ( )
protected

◆ InitNameIndexes()

void Symtab::InitNameIndexes ( )
protected

◆ LoadFromCache()

bool Symtab::LoadFromCache ( )

Load the symbol table from the index cache.

Quickly load the finalized symbol table from the index cache. This saves time when the debugger starts up. The index cache file for the symbol table has the modification time set to the same time as the main module. If the cache file exists and the modification times match, we will load the symbol table from the serlized cache file.

Returns
True if the symbol table was successfully loaded from the index cache, false if the symbol table wasn't cached or was out of date.

Definition at line 1353 of file Symtab.cpp.

References Decode(), lldb_private::ObjectFile::GetAddressByteSize(), lldb_private::ObjectFile::GetByteOrder(), lldb_private::DataFileCache::GetCachedData(), GetCacheKey(), lldb_private::Module::GetIndexCache(), m_objfile, lldb_private::DataFileCache::RemoveCacheFile(), and SetWasLoadedFromCache().

◆ operator=()

const Symtab & lldb_private::Symtab::operator= ( const Symtab )
privatedelete

◆ PreloadSymbols()

void Symtab::PreloadSymbols ( )

Definition at line 466 of file Symtab.cpp.

References InitNameIndexes(), and m_mutex.

◆ RegisterBacklogEntry()

void Symtab::RegisterBacklogEntry ( const NameToIndexMap::Entry &  entry,
const char *  decl_context,
const std::set< const char * > &  class_contexts 
)
private

Definition at line 448 of file Symtab.cpp.

References GetNameToSymbolIndexMap().

Referenced by InitNameIndexes().

◆ RegisterMangledNameEntry()

void Symtab::RegisterMangledNameEntry ( uint32_t  value,
std::set< const char * > &  class_contexts,
std::vector< std::pair< NameToIndexMap::Entry, const char * > > &  backlog,
RichManglingContext rmc 
)
private

◆ Reserve()

void Symtab::Reserve ( size_t  count)

◆ Resize()

Symbol * Symtab::Resize ( size_t  count)

Definition at line 57 of file Symtab.cpp.

References m_symbols.

Referenced by ObjectFileMachO::ParseSymtab().

◆ SaveToCache()

void Symtab::SaveToCache ( )

Save the symbol table data out into a cache.

The symbol table will only be saved to a cache file if caching is enabled.

We cache the contents of the symbol table since symbol tables in LLDB take some time to initialize. This is due to the many sources for data that are used to create a symbol table:

  • standard symbol table
  • dynamic symbol table (ELF)
  • compressed debug info sections
  • unwind information
  • function pointers found in runtimes for global constructor/destructors
  • other sources. All of the above sources are combined and one symbol table results after all sources have been considered.

Definition at line 1185 of file Symtab.cpp.

References Encode(), GetCacheKey(), lldb_private::DataEncoder::GetData(), lldb_private::Module::GetIndexCache(), InitNameIndexes(), lldb_private::endian::InlHostByteOrder(), lldb_private::DataFileCache::SetCachedData(), and SetWasSavedToCache().

Referenced by Finalize().

◆ SectionFileAddressesChanged()

void Symtab::SectionFileAddressesChanged ( )

◆ SetWasLoadedFromCache()

void lldb_private::Symtab::SetWasLoadedFromCache ( )
inline

Definition at line 231 of file Symtab.h.

References m_loaded_from_cache.

Referenced by LoadFromCache().

◆ SetWasSavedToCache()

void lldb_private::Symtab::SetWasSavedToCache ( )
inline

Definition at line 237 of file Symtab.h.

References m_saved_to_cache.

Referenced by SaveToCache().

◆ SortSymbolIndexesByValue()

void Symtab::SortSymbolIndexesByValue ( std::vector< uint32_t > &  indexes,
bool  remove_duplicates 
) const

◆ SymbolAtIndex() [1/2]

Symbol * Symtab::SymbolAtIndex ( size_t  idx)

◆ SymbolAtIndex() [2/2]

const Symbol * Symtab::SymbolAtIndex ( size_t  idx) const

Definition at line 236 of file Symtab.cpp.

References m_symbols.

◆ SymbolIndicesToSymbolContextList()

void Symtab::SymbolIndicesToSymbolContextList ( std::vector< uint32_t > &  symbol_indexes,
SymbolContextList sc_list 
)
private

Member Data Documentation

◆ m_file_addr_to_index

FileRangeToIndexMap lldb_private::Symtab::m_file_addr_to_index
protected

◆ m_file_addr_to_index_computed

bool lldb_private::Symtab::m_file_addr_to_index_computed
protected

◆ m_loaded_from_cache

bool lldb_private::Symtab::m_loaded_from_cache
protected

Definition at line 283 of file Symtab.h.

Referenced by GetWasLoadedFromCache(), and SetWasLoadedFromCache().

◆ m_mutex

std::recursive_mutex lldb_private::Symtab::m_mutex
mutableprotected

◆ m_name_indexes_computed

bool lldb_private::Symtab::m_name_indexes_computed
protected

◆ m_name_to_symbol_indices

std::map<lldb::FunctionNameType, UniqueCStringMap<uint32_t> > lldb_private::Symtab::m_name_to_symbol_indices
protected

Maps function names to symbol indices (grouped by FunctionNameTypes)

Definition at line 279 of file Symtab.h.

Referenced by Encode(), GetNameToSymbolIndexMap(), and Symtab().

◆ m_objfile

ObjectFile* lldb_private::Symtab::m_objfile
protected

◆ m_saved_to_cache

bool lldb_private::Symtab::m_saved_to_cache
protected

Definition at line 283 of file Symtab.h.

Referenced by GetWasSavedToCache(), and SetWasSavedToCache().

◆ m_symbols

collection lldb_private::Symtab::m_symbols
protected

The documentation for this class was generated from the following files: