Skip to content

Commit c04e804

Browse files
authored
[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.
1 parent a451fff commit c04e804

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lldb/source/Core/FormatEntity.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,7 @@ static bool DumpAddressAndContent(Stream &s, const SymbolContext *sc,
470470
bool print_file_addr_or_load_addr) {
471471
Target *target = Target::GetTargetFromContexts(exe_ctx, sc);
472472

473-
addr_t vaddr = LLDB_INVALID_ADDRESS;
474-
if (target && target->HasLoadedSections())
475-
vaddr = addr.GetLoadAddress(target);
473+
addr_t vaddr = addr.GetLoadAddress(target);
476474
if (vaddr == LLDB_INVALID_ADDRESS)
477475
vaddr = addr.GetFileAddress();
478476
if (vaddr == LLDB_INVALID_ADDRESS)

0 commit comments

Comments
 (0)