Index: include/lldb/Core/RangeMap.h =================================================================== --- include/lldb/Core/RangeMap.h +++ include/lldb/Core/RangeMap.h @@ -1216,6 +1216,25 @@ } return UINT32_MAX; } + + uint32_t + FindEntryIndexesThatContains (B addr, std::vector &indexes) const + { +#ifdef ASSERT_RANGEMAP_ARE_SORTED + assert (IsSorted()); +#endif + + if (!m_entries.empty()) + { + typename Collection::const_iterator pos; + for(pos = m_entries.begin(); pos != m_entries.end(); pos++) + { + if (pos->Contains(addr)) + indexes.push_back (pos->data); + } + } + return indexes.size() ; + } Entry * FindEntryThatContains (B addr) Index: include/lldb/Symbol/Symtab.h =================================================================== --- include/lldb/Symbol/Symtab.h +++ include/lldb/Symbol/Symtab.h @@ -81,6 +81,7 @@ Symbol * FindFirstSymbolWithNameAndType (const ConstString &name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility); Symbol * FindSymbolContainingFileAddress (lldb::addr_t file_addr, const uint32_t* indexes, uint32_t num_indexes); Symbol * FindSymbolContainingFileAddress (lldb::addr_t file_addr); + Symbol * FindValidSymbolContainingFileAddress (lldb::addr_t file_addr); size_t FindFunctionSymbols (const ConstString &name, uint32_t name_type_mask, SymbolContextList& sc_list); void CalculateSymbolSizes (); Index: source/Core/Module.cpp =================================================================== --- source/Core/Module.cpp +++ source/Core/Module.cpp @@ -559,7 +559,7 @@ Symtab *symtab = sym_vendor->GetSymtab(); if (symtab && so_addr.IsSectionOffset()) { - sc.symbol = symtab->FindSymbolContainingFileAddress(so_addr.GetFileAddress()); + sc.symbol = symtab-> FindValidSymbolContainingFileAddress(so_addr.GetFileAddress()); if (!sc.symbol && resolve_scope & eSymbolContextFunction && !(resolved_flags & eSymbolContextFunction)) { Index: source/Symbol/Symtab.cpp =================================================================== --- source/Symbol/Symtab.cpp +++ source/Symbol/Symtab.cpp @@ -1073,6 +1073,29 @@ return nullptr; } +/* Avoid Invalid Signals */ +Symbol * +Symtab::FindValidSymbolContainingFileAddress (addr_t file_addr) +{ + Mutex::Locker locker (m_mutex); + + if (!m_file_addr_to_index_computed) + InitAddressIndexes(); + + std::vector all_addr_indexes; + + // Get all symbols with file_addr + const size_t addr_match_count = m_file_addr_to_index.FindEntryIndexesThatContains(file_addr, all_addr_indexes); + + for (size_t i=0; iGetType() != eSymbolTypeInvalid) + return SymbolAtIndex(all_addr_indexes[i]); + } + return nullptr; +} + void Symtab::SymbolIndicesToSymbolContextList (std::vector &symbol_indexes, SymbolContextList &sc_list) {