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/CommandObjectSource.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/CommandObjectSource.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectSource.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp index c8295fd..9367832 100644 --- a/lldb/source/Commands/CommandObjectSource.cpp +++ b/lldb/source/Commands/CommandObjectSource.cpp @@ -302,7 +302,7 @@ protected: size_t num_matches = 0; assert(module_list.GetSize() > 0); Target &target = GetTarget(); - if (target.GetSectionLoadList().IsEmpty()) { + if (!target.HasLoadedSections()) { // The target isn't loaded yet, we need to lookup the file address in all // modules. Note: the module list option does not apply to addresses. const size_t num_modules = module_list.GetSize(); @@ -328,7 +328,7 @@ protected: } else { // The target has some things loaded, resolve this address to a compile // unit + file + line and display - if (target.GetSectionLoadList().ResolveLoadAddress(addr, so_addr)) { + if (target.ResolveLoadAddress(addr, so_addr)) { ModuleSP module_sp(so_addr.GetModule()); // Check to make sure this module is in our list. if (module_sp && module_list.GetIndexForModule(module_sp.get()) != @@ -959,7 +959,7 @@ protected: StreamString error_strm; SymbolContextList sc_list; - if (target.GetSectionLoadList().IsEmpty()) { + if (!target.HasLoadedSections()) { // The target isn't loaded yet, we need to lookup the file address in // all modules const ModuleList &module_list = target.GetImages(); @@ -987,8 +987,7 @@ protected: } else { // The target has some things loaded, resolve this address to a compile // unit + file + line and display - if (target.GetSectionLoadList().ResolveLoadAddress(m_options.address, - so_addr)) { + if (target.ResolveLoadAddress(m_options.address, so_addr)) { ModuleSP module_sp(so_addr.GetModule()); if (module_sp) { SymbolContext sc; |