From 66a88f62cd56e55b5fa0ddb1bdffa549f7565f8f Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Fri, 10 Jan 2025 09:56:55 +0100 Subject: [lldb] Add Function::GetAddress and redirect some uses (#115836) Many calls to Function::GetAddressRange() were not interested in the range itself. Instead they wanted to find the address of the function (its entry point) or the base address for relocation of function-scoped entities (technically, the two don't need to be the same, but there's isn't good reason for them not to be). This PR creates a separate function for retrieving this, and changes the existing (non-controversial) uses to call that instead. --- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp') diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index cbe077bfbaef..0ecf47a3c786 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -1061,8 +1061,7 @@ static void RemoveFunctionsWithModuleNotEqualTo(const ModuleSP &module_sp, SymbolContext sc; sc_list.GetContextAtIndex(i, sc); if (sc.function) { - const SectionSP section_sp( - sc.function->GetAddressRange().GetBaseAddress().GetSection()); + const SectionSP section_sp = sc.function->GetAddress().GetSection(); if (section_sp->GetModule() != module_sp) { sc_list.RemoveContextAtIndex(i); continue; -- cgit v1.2.3