diff options
Diffstat (limited to 'source/Symbol/Symtab.cpp')
-rw-r--r-- | source/Symbol/Symtab.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/Symbol/Symtab.cpp b/source/Symbol/Symtab.cpp index b20504addec9..709d899075a4 100644 --- a/source/Symbol/Symtab.cpp +++ b/source/Symbol/Symtab.cpp @@ -1071,6 +1071,26 @@ Symtab::FindSymbolContainingFileAddress (addr_t file_addr) } void +Symtab::ForEachSymbolContainingFileAddress(addr_t file_addr, std::function<bool(Symbol *)> const &callback) +{ + Mutex::Locker locker (m_mutex); + + if (!m_file_addr_to_index_computed) + InitAddressIndexes(); + + std::vector<uint32_t> all_addr_indexes; + + // Get all symbols with file_addr + const size_t addr_match_count = m_file_addr_to_index.FindEntryIndexesThatContain(file_addr, all_addr_indexes); + + for (size_t i = 0; i < addr_match_count; ++i) + { + if (!callback(SymbolAtIndex(all_addr_indexes[i]))) + break; + } +} + +void Symtab::SymbolIndicesToSymbolContextList (std::vector<uint32_t> &symbol_indexes, SymbolContextList &sc_list) { // No need to protect this call using m_mutex all other method calls are |