From c04e804a3117910d564a6982bed75f369d8a3467 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Tue, 24 Jun 2025 18:24:16 -0500 Subject: [PATCH] [lldb] Eliminate check for HasLoadedSections (NFC) (#145366) We can omit the call to Target::HasLoadedSections as Address::HasLoadedSections already "does the right thing" and returns LLDB_INVALID_ADDRESS if no sections are loaded. --- lldb/source/Core/FormatEntity.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lldb/source/Core/FormatEntity.cpp b/lldb/source/Core/FormatEntity.cpp index 8e3c3c18863f..ca389bc88cf7 100644 --- a/lldb/source/Core/FormatEntity.cpp +++ b/lldb/source/Core/FormatEntity.cpp @@ -470,9 +470,7 @@ static bool DumpAddressAndContent(Stream &s, const SymbolContext *sc, bool print_file_addr_or_load_addr) { Target *target = Target::GetTargetFromContexts(exe_ctx, sc); - addr_t vaddr = LLDB_INVALID_ADDRESS; - if (target && target->HasLoadedSections()) - vaddr = addr.GetLoadAddress(target); + addr_t vaddr = addr.GetLoadAddress(target); if (vaddr == LLDB_INVALID_ADDRESS) vaddr = addr.GetFileAddress(); if (vaddr == LLDB_INVALID_ADDRESS)