diff options
author | Greg Clayton <gclayton@fb.com> | 2025-01-14 20:12:46 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-14 20:12:46 -0800 |
commit | c4fb7180cbbe977f1ab1ce945a691550f8fdd1fb (patch) | |
tree | 9c9e2c55a12a2935dab5e1e43a59fb0818106adf /lldb/source/Commands/CommandObjectTarget.cpp | |
parent | 9ac6a55ec54fe4cd4a99c69ef1a4ddaea49e6688 (diff) | |
download | llvm-c4fb7180cbbe977f1ab1ce945a691550f8fdd1fb.zip llvm-c4fb7180cbbe977f1ab1ce945a691550f8fdd1fb.tar.gz llvm-c4fb7180cbbe977f1ab1ce945a691550f8fdd1fb.tar.bz2 |
[lldb][NFC] Make the target's SectionLoadList private. (#113278)
Lots of code around LLDB was directly accessing the target's section
load list. This NFC patch makes the section load list private so the
Target class can access it, but everyone else now uses accessor
functions. This allows us to control the resolving of addresses and will
allow for functionality in LLDB which can lazily resolve addresses in
JIT plug-ins with a future patch.
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index 307f4f6..d8265e4 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -1522,8 +1522,8 @@ static bool LookupAddressInModule(CommandInterpreter &interpreter, Stream &strm, Address so_addr; SymbolContext sc; Target *target = interpreter.GetExecutionContext().GetTargetPtr(); - if (target && !target->GetSectionLoadList().IsEmpty()) { - if (!target->GetSectionLoadList().ResolveLoadAddress(addr, so_addr)) + if (target && target->HasLoadedSections()) { + if (!target->ResolveLoadAddress(addr, so_addr)) return false; else if (so_addr.GetModule().get() != module) return false; @@ -2974,8 +2974,8 @@ protected: sect_name); break; } else { - if (target.GetSectionLoadList().SetSectionLoadAddress( - section_sp, load_addr)) + if (target.SetSectionLoadAddress(section_sp, + load_addr)) changed = true; result.AppendMessageWithFormat( "section '%s' loaded at 0x%" PRIx64 "\n", @@ -3329,7 +3329,7 @@ protected: if (objfile) { Address base_addr(objfile->GetBaseAddress()); if (base_addr.IsValid()) { - if (!target.GetSectionLoadList().IsEmpty()) { + if (target.HasLoadedSections()) { lldb::addr_t load_addr = base_addr.GetLoadAddress(&target); if (load_addr == LLDB_INVALID_ADDRESS) { base_addr.Dump(&strm, &target, @@ -3544,8 +3544,7 @@ protected: function_options, sc_list); } else if (m_options.m_type == eLookupTypeAddress && target) { Address addr; - if (target->GetSectionLoadList().ResolveLoadAddress(m_options.m_addr, - addr)) { + if (target->ResolveLoadAddress(m_options.m_addr, addr)) { SymbolContext sc; ModuleSP module_sp(addr.GetModule()); module_sp->ResolveSymbolContextForAddress(addr, @@ -5270,7 +5269,7 @@ public: protected: void DoExecute(Args &command, CommandReturnObject &result) override { Target &target = GetTarget(); - target.GetSectionLoadList().Dump(result.GetOutputStream(), &target); + target.DumpSectionLoadList(result.GetOutputStream()); result.SetStatus(eReturnStatusSuccessFinishResult); } }; |