[Lldb-commits] [lldb] [lldb] Don't cache symtabs for memory modules w/ corefile (PR #237050)

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 2 20:05:25 PST 2026


https://github.com/jasonmolenda updated https://github.com/llvm/llvm-project/pull/237050

>From 464ace5c07e0e8f347a533137b447331e01f1d5c Mon Sep 17 00:00:00 2001
From: Jason Molenda <jmolenda at apple.com>
Date: Thu, 29 Oct 2026 18:47:41 -0700
Subject: [PATCH 1/7] [lldb] Don't cache symtabs for memory modules w/ corefile

In https://github.com/llvm/llvm-project/pull/229305 I added
a new setting, `symbols.enable-lldb-index-cache-memory-modules`
which creates a DataFileCache symtab file for memory-read modules.
Reading the symbol table out of memory is a serious performance
issue, and caching those tables on the debug host is worth doing
by default.

This is not the correct tradeoff if we are doing corefile debugging,
where reading memory is cheap.  In that case we need to ignore the
`symbols.enable-lldb-index-cache-memory-modules` setting and not
create the symtabs, unless the user has set
`symbols.enable-lldb-index-cache` themselves.

This patchset is a little tricky because the layers where we can make
this judgement (DynamicLoader or Process) is pretty far away from
the place where we create the Symtab, `ObjectFile::GetSymtab` and
there is another scenario I want to override the default for in the
future that is only knowable to the DynamicLoader (if the DynamicLoader
believes ALL binaries are being read from memory, which indicates an
error of the target device setup, then we will avoid creating symtab
caches for all binaries, expecting the user to set up the target device
properly.  A future PR).

The DynamicLoader methods that call `Process::ReadModuleFromMemory`
are the place where this decision is made.  This argument is passed
through `Module::GetMemoryObjectFile`, then through
`ObjectFile::FindPlugin`.  All ObjectFile memory-module subclass
methods receive the new override parameter, and set an ObjectFile
ivar.  When ObjectFile creates a Symtab in ObjectFile::GetSymtab,
it passes that setting through Symtab.  Which is, in turn, passed
to `Module::GetIndexCache()` which has the logic that decides whether
to use the DataFileCache or not, based on whether this is a memory
module, whether we are (now) overriding memory-module caching, and
the user lldb-index settings.

The PR is 95% all mechanical passing around of the new argument;
the DynamicLoader methods calling `Process::ReadModuleFromMemory`
and `Module::GetIndexCache` have the logic of interest, everything
else is trivial and obvious.

There is a new test case that creates a corefile with a binary,
clears lldb's global module cache store, removes the binary from
disk (so lldb must read it from corefile memory), then loads the
corefile and confirms that a DataFileCache symtab was not created
for the binary.

rdar://190698277

Assisted-by: Claude
---
 lldb/include/lldb/Core/Module.h               | 12 ++-
 lldb/include/lldb/Expression/ObjectFileJIT.h  |  3 +-
 lldb/include/lldb/Symbol/ObjectFile.h         | 22 ++++-
 lldb/include/lldb/Symbol/Symtab.h             |  3 +-
 lldb/include/lldb/Target/Process.h            |  5 ++
 lldb/include/lldb/lldb-private-interfaces.h   |  3 +-
 lldb/source/API/SBModule.cpp                  |  6 +-
 lldb/source/Core/DynamicLoader.cpp            | 13 ++-
 lldb/source/Core/Module.cpp                   | 14 +--
 lldb/source/Expression/ObjectFileJIT.cpp      |  8 +-
 .../DynamicLoaderDarwinKernel.cpp             | 13 ++-
 .../DynamicLoaderFreeBSDKernel.cpp            | 13 ++-
 .../MacOSX-DYLD/DynamicLoaderDarwin.cpp       | 12 ++-
 .../POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp     |  6 +-
 .../wasm-DYLD/DynamicLoaderWasmDYLD.cpp       |  7 +-
 .../Plugins/JITLoader/GDB/JITLoaderGDB.cpp    |  4 +
 .../Breakpad/ObjectFileBreakpad.cpp           |  3 +-
 .../ObjectFile/Breakpad/ObjectFileBreakpad.h  |  3 +-
 .../ObjectFile/COFF/ObjectFileCOFF.cpp        |  8 +-
 .../Plugins/ObjectFile/COFF/ObjectFileCOFF.h  |  3 +-
 .../Plugins/ObjectFile/ELF/ObjectFileELF.cpp  |  4 +-
 .../Plugins/ObjectFile/ELF/ObjectFileELF.h    |  3 +-
 .../ObjectFile/JSON/ObjectFileJSON.cpp        |  8 +-
 .../Plugins/ObjectFile/JSON/ObjectFileJSON.h  |  3 +-
 .../ObjectFile/Mach-O/ObjectFileMachO.cpp     |  4 +-
 .../ObjectFile/Mach-O/ObjectFileMachO.h       |  3 +-
 .../Minidump/ObjectFileMinidump.cpp           |  3 +-
 .../ObjectFile/Minidump/ObjectFileMinidump.h  |  3 +-
 .../Plugins/ObjectFile/PDB/ObjectFilePDB.cpp  |  8 +-
 .../Plugins/ObjectFile/PDB/ObjectFilePDB.h    |  3 +-
 .../ObjectFile/PECOFF/ObjectFilePECOFF.cpp    |  4 +-
 .../ObjectFile/PECOFF/ObjectFilePECOFF.h      |  3 +-
 .../Placeholder/ObjectFilePlaceholder.cpp     |  3 +-
 .../ObjectFile/XCOFF/ObjectFileXCOFF.cpp      |  3 +-
 .../ObjectFile/XCOFF/ObjectFileXCOFF.h        |  3 +-
 .../ObjectFile/wasm/ObjectFileWasm.cpp        |  9 +-
 .../Plugins/ObjectFile/wasm/ObjectFileWasm.h  |  3 +-
 .../Process/elf-core/ProcessElfCore.cpp       |  4 +
 lldb/source/Symbol/ObjectFile.cpp             | 17 ++--
 lldb/source/Symbol/Symtab.cpp                 | 11 ++-
 lldb/source/Target/Process.cpp                |  7 +-
 .../corefile_memory_module/Makefile           |  3 +
 .../TestModuleCacheCorefileMemoryModule.py    | 86 +++++++++++++++++++
 .../corefile_memory_module/main.cpp           | 19 ++++
 .../ObjectFile/MachO/TestObjectFileMachO.cpp  |  6 +-
 lldb/unittests/Symbol/SymtabTest.cpp          |  7 +-
 46 files changed, 311 insertions(+), 80 deletions(-)
 create mode 100644 lldb/test/API/functionalities/module_cache/corefile_memory_module/Makefile
 create mode 100644 lldb/test/API/functionalities/module_cache/corefile_memory_module/TestModuleCacheCorefileMemoryModule.py
 create mode 100644 lldb/test/API/functionalities/module_cache/corefile_memory_module/main.cpp

diff --git a/lldb/include/lldb/Core/Module.h b/lldb/include/lldb/Core/Module.h
index 04aee9c101b444..5c4fe9fd2beb0a 100644
--- a/lldb/include/lldb/Core/Module.h
+++ b/lldb/include/lldb/Core/Module.h
@@ -596,11 +596,16 @@ class Module : public std::enable_shared_from_this<Module>,
   /// enable the ObjectFile plugins to read the header of the object file
   /// without going back to the process.
   ///
+  /// If \a disable_memory_symtab_caching is true, the symbol table for the
+  /// object file will not be loaded from or saved to the index cache, even if
+  /// caching of memory modules is enabled.
+  ///
   /// \return
   ///     The object file loaded from memory or nullptr, if the operation
   ///     failed (see the `error` for more information in that case).
   ObjectFile *GetMemoryObjectFile(const lldb::ProcessSP &process_sp,
                                   lldb::addr_t header_addr, Status &error,
+                                  bool disable_memory_symtab_caching,
                                   size_t size_to_read = 512);
 
   /// Get the module's symbol file
@@ -1047,10 +1052,15 @@ class Module : public std::enable_shared_from_this<Module>,
   /// \param[in] memory_module
   ///     True if this binary exists only in memory.
   ///
+  /// \param[in] disable_memory_symtab_caching
+  ///     If true, ignore the setting that enables the index cache for memory
+  ///     modules.
+  ///
   /// \returns
   ///   If caching is enabled in the lldb settings, return a pointer to the data
   ///   file cache. If caching is not enabled, return NULL.
-  static DataFileCache *GetIndexCache(bool memory_module);
+  static DataFileCache *
+  GetIndexCache(bool memory_module, bool disable_memory_symtab_caching = false);
 
 protected:
   // Member Variables
diff --git a/lldb/include/lldb/Expression/ObjectFileJIT.h b/lldb/include/lldb/Expression/ObjectFileJIT.h
index 61e364fda4240d..d86c1d3051c4a5 100644
--- a/lldb/include/lldb/Expression/ObjectFileJIT.h
+++ b/lldb/include/lldb/Expression/ObjectFileJIT.h
@@ -59,7 +59,8 @@ class ObjectFileJIT : public ObjectFile {
 
   static lldb_private::ObjectFile *CreateMemoryInstance(
       const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp,
-      const lldb::ProcessSP &process_sp, lldb::addr_t header_addr);
+      const lldb::ProcessSP &process_sp, lldb::addr_t header_addr,
+      bool disable_memory_symtab_caching);
 
   static ModuleSpecList
   GetModuleSpecifications(const lldb_private::FileSpec &file,
diff --git a/lldb/include/lldb/Symbol/ObjectFile.h b/lldb/include/lldb/Symbol/ObjectFile.h
index f626d0395ecf6a..a9e8b1a0c9d3c5 100644
--- a/lldb/include/lldb/Symbol/ObjectFile.h
+++ b/lldb/include/lldb/Symbol/ObjectFile.h
@@ -169,10 +169,16 @@ class ObjectFile : public std::enable_shared_from_this<ObjectFile>,
   ///
   /// \param[in] header_addr
   ///     The address of the header for the object file in memory.
+  ///
+  /// \param[in] disable_memory_symtab_caching
+  ///     If true, the symbol table for this object file will not be loaded
+  ///     from or saved to the index cache, even if caching of memory modules
+  ///     is enabled. This is used for binaries read out of a corefile.
   static lldb::ObjectFileSP FindPlugin(const lldb::ModuleSP &module_sp,
                                        const lldb::ProcessSP &process_sp,
                                        lldb::addr_t header_addr,
-                                       lldb::WritableDataBufferSP file_data_sp);
+                                       lldb::WritableDataBufferSP file_data_sp,
+                                       bool disable_memory_symtab_caching);
 
   static ModuleSpecList
   GetModuleSpecifications(const FileSpec &file, lldb::offset_t file_offset,
@@ -691,6 +697,17 @@ class ObjectFile : public std::enable_shared_from_this<ObjectFile>,
   /// Returns true if the object file exists only in memory.
   bool IsInMemory() const { return m_memory_addr != LLDB_INVALID_ADDRESS; }
 
+  /// Returns true if the symbol table for this in-memory object file should
+  /// not be loaded from the index cache, even if caching of memory modules is
+  /// enabled.
+  bool GetDisableMemorySymtabCaching() const {
+    return m_disable_memory_symtab_caching;
+  }
+
+  void SetDisableMemorySymtabCaching(bool disable) {
+    m_disable_memory_symtab_caching = disable;
+  }
+
   // Strip linker annotations (such as @@VERSION) from symbol names.
   virtual llvm::StringRef
   StripLinkerSymbolAnnotations(llvm::StringRef symbol_name) const {
@@ -782,6 +799,9 @@ class ObjectFile : public std::enable_shared_from_this<ObjectFile>,
   lldb::ProcessWP m_process_wp;
   /// Set if the object file only exists in memory.
   const lldb::addr_t m_memory_addr;
+  /// Set if the symbol table for an in-memory object file should not be
+  /// loaded from the index cache.
+  bool m_disable_memory_symtab_caching;
 
   std::unique_ptr<lldb_private::SectionList> m_sections_up;
   std::recursive_mutex m_sections_mutex;
diff --git a/lldb/include/lldb/Symbol/Symtab.h b/lldb/include/lldb/Symbol/Symtab.h
index ea5e2d8044402b..99b6585ff5d568 100644
--- a/lldb/include/lldb/Symbol/Symtab.h
+++ b/lldb/include/lldb/Symbol/Symtab.h
@@ -32,7 +32,7 @@ class Symtab {
 
   enum Visibility { eVisibilityAny, eVisibilityExtern, eVisibilityPrivate };
 
-  Symtab(ObjectFile *objfile);
+  Symtab(ObjectFile *objfile, bool disable_memory_symtab_caching);
   ~Symtab();
 
   void PreloadSymbols();
@@ -284,6 +284,7 @@ class Symtab {
   bool m_name_indexes_computed = false;
   bool m_loaded_from_cache = false;
   bool m_saved_to_cache = false;
+  bool m_disable_memory_symtab_caching = false;
 
 private:
   UniqueCStringMap<uint32_t> &
diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h
index 226c58034dd655..95bac144c93c9c 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -2072,11 +2072,16 @@ class Process : public std::enable_shared_from_this<Process>,
   /// \param[in] header_addr
   ///   The address pointing to the beginning of the object file's header.
   ///
+  /// \param[in] disable_memory_symtab_caching
+  ///   If true, the symbol table for this module will not be loaded from or
+  ///   saved to the index cache, even if caching of memory modules is enabled.
+  ///
   /// \param[in] size_to_read
   ///   The number of bytes to read from memory. This should be large enough to
   ///   identify the object file format. Defaults to 512.
   llvm::Expected<lldb::ModuleSP>
   ReadModuleFromMemory(const FileSpec &file_spec, lldb::addr_t header_addr,
+                       bool disable_memory_symtab_caching,
                        size_t size_to_read = 512);
 
   /// Attempt to get the attributes for a region of memory in the process.
diff --git a/lldb/include/lldb/lldb-private-interfaces.h b/lldb/include/lldb/lldb-private-interfaces.h
index 276774a2ec3fde..16769e9367bb42 100644
--- a/lldb/include/lldb/lldb-private-interfaces.h
+++ b/lldb/include/lldb/lldb-private-interfaces.h
@@ -56,7 +56,8 @@ typedef ObjectFile *(*ObjectFileCreateInstance)(
     lldb::offset_t file_offset, lldb::offset_t length);
 typedef ObjectFile *(*ObjectFileCreateMemoryInstance)(
     const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp,
-    const lldb::ProcessSP &process_sp, lldb::addr_t offset);
+    const lldb::ProcessSP &process_sp, lldb::addr_t offset,
+    bool disable_memory_symtab_caching);
 typedef bool (*ObjectFileSaveCore)(const lldb::ProcessSP &process_sp,
                                    lldb_private::SaveCoreOptions &options,
                                    Status &error);
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp
index 4bc3df9992a72e..0ae426775d39ff 100644
--- a/lldb/source/API/SBModule.cpp
+++ b/lldb/source/API/SBModule.cpp
@@ -53,8 +53,12 @@ SBModule::SBModule(lldb::SBProcess &process, lldb::addr_t header_addr) {
 
   ProcessSP process_sp(process.GetSP());
   if (process_sp) {
+    // Don't use the index cache for symbol tables of binaries read out of a
+    // corefile.
+    const bool disable_memory_symtab_caching = (bool)process_sp->GetCoreFile();
     llvm::Expected<ModuleSP> module_sp_or_err =
-        process_sp->ReadModuleFromMemory(FileSpec(), header_addr);
+        process_sp->ReadModuleFromMemory(FileSpec(), header_addr,
+                                         disable_memory_symtab_caching);
     if (auto err = module_sp_or_err.takeError()) {
       llvm::consumeError(std::move(err));
       return;
diff --git a/lldb/source/Core/DynamicLoader.cpp b/lldb/source/Core/DynamicLoader.cpp
index 18226fb2be887a..94ab706300dce5 100644
--- a/lldb/source/Core/DynamicLoader.cpp
+++ b/lldb/source/Core/DynamicLoader.cpp
@@ -183,8 +183,12 @@ ModuleSP DynamicLoader::LoadModuleAtAddress(const FileSpec &file,
   // We have a core file, try to load the image from memory if we didn't find
   // the module.
   if (!module_sp && !m_process->IsLiveDebugSession()) {
+    // Don't use the index cache for symbol tables of binaries read out of a
+    // corefile.
+    const bool disable_memory_symtab_caching = (bool)m_process->GetCoreFile();
     llvm::Expected<ModuleSP> memory_module_sp_or_err =
-        m_process->ReadModuleFromMemory(file, base_addr);
+        m_process->ReadModuleFromMemory(file, base_addr,
+                                        disable_memory_symtab_caching);
     if (auto err = memory_module_sp_or_err.takeError())
       LLDB_LOG_ERROR(GetLog(LLDBLog::DynamicLoader), std::move(err),
                      "Failed to read module from memory: {0}");
@@ -206,8 +210,11 @@ static ModuleSP ReadUnnamedMemoryModule(Process *process, addr_t addr,
     snprintf(namebuf, sizeof(namebuf), "memory-image-0x%" PRIx64, addr);
     name = namebuf;
   }
-  llvm::Expected<ModuleSP> module_sp_or_err =
-      process->ReadModuleFromMemory(FileSpec(name), addr);
+  // Don't use the index cache for symbol tables of binaries read out of a
+  // corefile.
+  const bool disable_memory_symtab_caching = (bool)process->GetCoreFile();
+  llvm::Expected<ModuleSP> module_sp_or_err = process->ReadModuleFromMemory(
+      FileSpec(name), addr, disable_memory_symtab_caching);
   if (auto err = module_sp_or_err.takeError()) {
     LLDB_LOG_ERROR(GetLog(LLDBLog::DynamicLoader), std::move(err),
                    "Failed to read module from memory: {0}");
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index d59c0fbaca97cd..4b0e80bfcca5de 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -288,6 +288,7 @@ Module::~Module() {
 
 ObjectFile *Module::GetMemoryObjectFile(const lldb::ProcessSP &process_sp,
                                         lldb::addr_t header_addr, Status &error,
+                                        bool disable_memory_symtab_caching,
                                         size_t size_to_read) {
   if (m_objfile_sp) {
     error = Status::FromErrorString("object file already exists");
@@ -304,8 +305,9 @@ ObjectFile *Module::GetMemoryObjectFile(const lldb::ProcessSP &process_sp,
       if (bytes_read < size_to_read)
         data_sp->SetByteSize(bytes_read);
       if (data_sp->GetByteSize() > 0) {
-        m_objfile_sp = ObjectFile::FindPlugin(shared_from_this(), process_sp,
-                                              header_addr, data_sp);
+        m_objfile_sp =
+            ObjectFile::FindPlugin(shared_from_this(), process_sp, header_addr,
+                                   data_sp, disable_memory_symtab_caching);
         if (m_objfile_sp) {
           m_memory_module_addr = header_addr;
 
@@ -1666,12 +1668,14 @@ std::string Module::GetCacheKey() {
   return key;
 }
 
-DataFileCache *Module::GetIndexCache(bool memory_module) {
+DataFileCache *Module::GetIndexCache(bool memory_module,
+                                     bool disable_memory_symtab_caching) {
   bool lldb_index_enabled = false;
   if (ModuleList::GetGlobalModuleListProperties().GetEnableLLDBIndexCache())
     lldb_index_enabled = true;
-  if (memory_module && ModuleList::GetGlobalModuleListProperties()
-                           .GetEnableLLDBIndexCacheMemoryModules())
+  if (memory_module && !disable_memory_symtab_caching &&
+      ModuleList::GetGlobalModuleListProperties()
+          .GetEnableLLDBIndexCacheMemoryModules())
     lldb_index_enabled = true;
   if (!lldb_index_enabled)
     return nullptr;
diff --git a/lldb/source/Expression/ObjectFileJIT.cpp b/lldb/source/Expression/ObjectFileJIT.cpp
index b4fe84e868e766..022768236ad0dd 100644
--- a/lldb/source/Expression/ObjectFileJIT.cpp
+++ b/lldb/source/Expression/ObjectFileJIT.cpp
@@ -51,10 +51,10 @@ ObjectFile *ObjectFileJIT::CreateInstance(const lldb::ModuleSP &module_sp,
   return nullptr;
 }
 
-ObjectFile *ObjectFileJIT::CreateMemoryInstance(const lldb::ModuleSP &module_sp,
-                                                WritableDataBufferSP data_sp,
-                                                const ProcessSP &process_sp,
-                                                lldb::addr_t header_addr) {
+ObjectFile *ObjectFileJIT::CreateMemoryInstance(
+    const lldb::ModuleSP &module_sp, WritableDataBufferSP data_sp,
+    const ProcessSP &process_sp, lldb::addr_t header_addr,
+    bool disable_memory_symtab_caching) {
   // JIT'ed object file is backed by the ObjectFileJITDelegate, never read from
   // memory
   return nullptr;
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 7428523ae763b4..85c9ac0d65eccd 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -468,8 +468,12 @@ DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(lldb::addr_t addr,
   if (header.filetype == llvm::MachO::MH_EXECUTE &&
       (header.flags & llvm::MachO::MH_DYLDLINK) == 0) {
     // Create a full module to get the UUID
+    // Don't use the index cache for symbol tables of binaries read out of a
+    // corefile.
+    const bool disable_memory_symtab_caching = (bool)process->GetCoreFile();
     llvm::Expected<ModuleSP> memory_module_sp_or_err =
-        process->ReadModuleFromMemory(FileSpec("temp_mach_kernel"), addr);
+        process->ReadModuleFromMemory(FileSpec("temp_mach_kernel"), addr,
+                                      disable_memory_symtab_caching);
     if (auto err = memory_module_sp_or_err.takeError()) {
       LLDB_LOG_ERROR(log, std::move(err),
                      "DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress: "
@@ -673,8 +677,13 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::ReadMemoryModule(
       size_to_read = sizeof(llvm::MachO::mach_header_64) + mh.sizeofcmds;
   }
 
+  // Don't use the index cache for symbol tables of binaries read out of a
+  // corefile.
+  const bool disable_memory_symtab_caching = (bool)process->GetCoreFile();
   llvm::Expected<ModuleSP> memory_module_sp_or_err =
-      process->ReadModuleFromMemory(file_spec, m_load_address, size_to_read);
+      process->ReadModuleFromMemory(file_spec, m_load_address,
+                                    disable_memory_symtab_caching,
+                                    size_to_read);
   if (auto err = memory_module_sp_or_err.takeError()) {
     LLDB_LOG_ERROR(log, std::move(err),
                    "KextImageInfo::ReadMemoryModule failed to read module from "
diff --git a/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp b/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
index eb08683f4f1e67..f2520266c3d1c0 100644
--- a/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
@@ -296,8 +296,12 @@ lldb_private::UUID DynamicLoaderFreeBSDKernel::CheckForKernelImageAtAddress(
   if (header.e_type != expected_type)
     return UUID();
 
+  // Don't use the index cache for symbol tables of binaries read out of a
+  // corefile.
+  const bool disable_memory_symtab_caching = (bool)process->GetCoreFile();
   llvm::Expected<ModuleSP> memory_module_sp_or_err =
-      process->ReadModuleFromMemory(FileSpec("temp_freebsd_kernel"), addr);
+      process->ReadModuleFromMemory(FileSpec("temp_freebsd_kernel"), addr,
+                                    disable_memory_symtab_caching);
   if (auto err = memory_module_sp_or_err.takeError()) {
     LLDB_LOG_ERROR(log, std::move(err),
                    "DynamicLoaderFreeBSDKernel::CheckForKernelImageAtAddress: "
@@ -394,8 +398,13 @@ bool DynamicLoaderFreeBSDKernel::KModImageInfo::ReadMemoryModule(
     }
   }
 
+  // Don't use the index cache for symbol tables of binaries read out of a
+  // corefile.
+  const bool disable_memory_symtab_caching = (bool)process->GetCoreFile();
   llvm::Expected<ModuleSP> memory_module_sp_or_err =
-      process->ReadModuleFromMemory(file_spec, m_load_address, size_to_read);
+      process->ReadModuleFromMemory(file_spec, m_load_address,
+                                    disable_memory_symtab_caching,
+                                    size_to_read);
   if (auto err = memory_module_sp_or_err.takeError()) {
     LLDB_LOG_ERROR(log, std::move(err),
                    "KextImageInfo::ReadMemoryModule: Failed to read module "
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
index 6afda72dbbfff2..de94de7d6a75cd 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
@@ -179,8 +179,11 @@ ModuleSP DynamicLoaderDarwin::FindTargetModuleForImageInfo(
   // We'll call Target::ModulesDidLoad after all the modules have been
   // added to the target, don't let it be called for every one.
   if (!module_sp || module_sp->GetObjectFile() == nullptr) {
+    // Don't use the index cache for symbol tables of binaries read out of a
+    // corefile.
+    const bool disable_memory_symtab_caching = (bool)m_process->GetCoreFile();
     llvm::Expected<ModuleSP> module_sp_or_err = m_process->ReadModuleFromMemory(
-        image_info.file_spec, image_info.address,
+        image_info.file_spec, image_info.address, disable_memory_symtab_caching,
         image_info.mh_and_load_cmd_size);
     if (auto err = module_sp_or_err.takeError()) {
       LLDB_LOG_ERROR(GetLog(LLDBLog::DynamicLoader), std::move(err),
@@ -785,9 +788,12 @@ bool DynamicLoaderDarwin::AddModulesUsingPreloadedModules(
                                                                true /* notify */);
               if (!commpage_image_module_sp ||
                   commpage_image_module_sp->GetObjectFile() == nullptr) {
+                const bool disable_memory_symtab_caching =
+                    (bool)m_process->GetCoreFile();
                 llvm::Expected<ModuleSP> module_sp_or_err =
-                    m_process->ReadModuleFromMemory(image_info.file_spec,
-                                                    image_info.address);
+                    m_process->ReadModuleFromMemory(
+                        image_info.file_spec, image_info.address,
+                        disable_memory_symtab_caching);
                 if (auto err = module_sp_or_err.takeError()) {
                   LLDB_LOG_ERROR(log, std::move(err),
                                  "Failed to read module from memory: {0}");
diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
index 0ecb4528771a7f..a04496d4959e04 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
@@ -609,8 +609,12 @@ void DynamicLoaderPOSIXDYLD::LoadVDSO() {
     return;
   }
 
+  // Don't use the index cache for symbol tables of binaries read out of a
+  // corefile.
+  const bool disable_memory_symtab_caching = (bool)m_process->GetCoreFile();
   llvm::Expected<ModuleSP> module_sp_or_err = m_process->ReadModuleFromMemory(
-      file, m_vdso_base, info.GetRange().GetByteSize());
+      file, m_vdso_base, disable_memory_symtab_caching,
+      info.GetRange().GetByteSize());
   if (auto err = module_sp_or_err.takeError()) {
     LLDB_LOG_ERROR(log, std::move(err),
                    "Failed to read module from memory: {0}");
diff --git a/lldb/source/Plugins/DynamicLoader/wasm-DYLD/DynamicLoaderWasmDYLD.cpp b/lldb/source/Plugins/DynamicLoader/wasm-DYLD/DynamicLoaderWasmDYLD.cpp
index 69e41ac5ebd12b..5fbc609497644c 100644
--- a/lldb/source/Plugins/DynamicLoader/wasm-DYLD/DynamicLoaderWasmDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/wasm-DYLD/DynamicLoaderWasmDYLD.cpp
@@ -76,8 +76,11 @@ lldb::ModuleSP DynamicLoaderWasmDYLD::LoadModuleAtAddress(
           file, link_map_addr, base_addr, base_addr_is_offset))
     return module_sp;
 
-  llvm::Expected<ModuleSP> module_sp_or_err =
-      m_process->ReadModuleFromMemory(file, base_addr);
+  // Don't use the index cache for symbol tables of binaries read out of a
+  // corefile.
+  const bool disable_memory_symtab_caching = (bool)m_process->GetCoreFile();
+  llvm::Expected<ModuleSP> module_sp_or_err = m_process->ReadModuleFromMemory(
+      file, base_addr, disable_memory_symtab_caching);
   if (auto err = module_sp_or_err.takeError()) {
     LLDB_LOG_ERROR(GetLog(LLDBLog::DynamicLoader), std::move(err),
                    "Failed to read module from memory: {0}");
diff --git a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
index b336a605b747af..b5e3e57d044848 100644
--- a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
+++ b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
@@ -323,8 +323,12 @@ bool JITLoaderGDB::ReadJITDescriptorImpl(bool all_entries) {
 
       char jit_name[64];
       snprintf(jit_name, 64, "JIT(0x%" PRIx64 ")", symbolfile_addr);
+      // Don't use the index cache for symbol tables of binaries read out of a
+      // corefile.
+      const bool disable_memory_symtab_caching = (bool)m_process->GetCoreFile();
       llvm::Expected<ModuleSP> module_sp_or_err =
           m_process->ReadModuleFromMemory(FileSpec(jit_name), symbolfile_addr,
+                                          disable_memory_symtab_caching,
                                           symbolfile_size);
       if (auto err = module_sp_or_err.takeError())
         LLDB_LOG_ERROR(
diff --git a/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp b/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp
index 7d79d938723e20..2f019d19c719ea 100644
--- a/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp
+++ b/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp
@@ -97,7 +97,8 @@ ObjectFile *ObjectFileBreakpad::CreateInstance(const ModuleSP &module_sp,
 
 ObjectFile *ObjectFileBreakpad::CreateMemoryInstance(
     const ModuleSP &module_sp, WritableDataBufferSP data_sp,
-    const ProcessSP &process_sp, addr_t header_addr) {
+    const ProcessSP &process_sp, addr_t header_addr,
+    bool disable_memory_symtab_caching) {
   return nullptr;
 }
 
diff --git a/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h b/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h
index 19ea35a13f0011..abc888b4f590f2 100644
--- a/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h
+++ b/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h
@@ -36,7 +36,8 @@ class ObjectFileBreakpad : public ObjectFile {
   static ObjectFile *CreateMemoryInstance(const lldb::ModuleSP &module_sp,
                                           lldb::WritableDataBufferSP data_sp,
                                           const lldb::ProcessSP &process_sp,
-                                          lldb::addr_t header_addr);
+                                          lldb::addr_t header_addr,
+                                          bool disable_memory_symtab_caching);
 
   static ModuleSpecList
   GetModuleSpecifications(const FileSpec &file,
diff --git a/lldb/source/Plugins/ObjectFile/COFF/ObjectFileCOFF.cpp b/lldb/source/Plugins/ObjectFile/COFF/ObjectFileCOFF.cpp
index 585badecf07195..ac50b9a5f3d896 100644
--- a/lldb/source/Plugins/ObjectFile/COFF/ObjectFileCOFF.cpp
+++ b/lldb/source/Plugins/ObjectFile/COFF/ObjectFileCOFF.cpp
@@ -106,9 +106,11 @@ ObjectFileCOFF::CreateInstance(const ModuleSP &module_sp,
                             file, file_offset, length);
 }
 
-lldb_private::ObjectFile *ObjectFileCOFF::CreateMemoryInstance(
-    const ModuleSP &module_sp, WritableDataBufferSP data_sp,
-    const ProcessSP &process_sp, addr_t header) {
+lldb_private::ObjectFile *
+ObjectFileCOFF::CreateMemoryInstance(const ModuleSP &module_sp,
+                                     WritableDataBufferSP data_sp,
+                                     const ProcessSP &process_sp, addr_t header,
+                                     bool disable_memory_symtab_caching) {
   // FIXME: do we need to worry about construction from a memory region?
   return nullptr;
 }
diff --git a/lldb/source/Plugins/ObjectFile/COFF/ObjectFileCOFF.h b/lldb/source/Plugins/ObjectFile/COFF/ObjectFileCOFF.h
index dd9f68e824114d..738222989ba5e4 100644
--- a/lldb/source/Plugins/ObjectFile/COFF/ObjectFileCOFF.h
+++ b/lldb/source/Plugins/ObjectFile/COFF/ObjectFileCOFF.h
@@ -52,7 +52,8 @@ class ObjectFileCOFF : public lldb_private::ObjectFile {
   static lldb_private::ObjectFile *
   CreateMemoryInstance(const lldb::ModuleSP &module_sp,
                        lldb::WritableDataBufferSP data_sp,
-                       const lldb::ProcessSP &process_sp, lldb::addr_t header);
+                       const lldb::ProcessSP &process_sp, lldb::addr_t header,
+                       bool disable_memory_symtab_caching);
 
   static lldb_private::ModuleSpecList
   GetModuleSpecifications(const lldb_private::FileSpec &file,
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index 662f69c8e6df8c..8e78b15a527841 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -475,7 +475,8 @@ ObjectFile *ObjectFileELF::CreateInstance(const lldb::ModuleSP &module_sp,
 
 ObjectFile *ObjectFileELF::CreateMemoryInstance(
     const lldb::ModuleSP &module_sp, WritableDataBufferSP data_sp,
-    const lldb::ProcessSP &process_sp, lldb::addr_t header_addr) {
+    const lldb::ProcessSP &process_sp, lldb::addr_t header_addr,
+    bool disable_memory_symtab_caching) {
   if (!data_sp || data_sp->GetByteSize() < (llvm::ELF::EI_NIDENT))
     return nullptr;
   const uint8_t *magic = data_sp->GetBytes();
@@ -501,6 +502,7 @@ ObjectFile *ObjectFileELF::CreateMemoryInstance(
 
   std::unique_ptr<ObjectFileELF> objfile_up(
       new ObjectFileELF(module_sp, data_sp, process_sp, header_addr));
+  objfile_up->SetDisableMemorySymtabCaching(disable_memory_symtab_caching);
   ArchSpec spec = objfile_up->GetArchitecture();
   if (spec && objfile_up->SetModulesArchitecture(spec))
     return objfile_up.release();
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
index 8adb8af10fe169..d624c287e940c5 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
@@ -76,7 +76,8 @@ class ObjectFileELF : public lldb_private::ObjectFile {
 
   static lldb_private::ObjectFile *CreateMemoryInstance(
       const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp,
-      const lldb::ProcessSP &process_sp, lldb::addr_t header_addr);
+      const lldb::ProcessSP &process_sp, lldb::addr_t header_addr,
+      bool disable_memory_symtab_caching);
 
   static lldb_private::ModuleSpecList
   GetModuleSpecifications(const lldb_private::FileSpec &file,
diff --git a/lldb/source/Plugins/ObjectFile/JSON/ObjectFileJSON.cpp b/lldb/source/Plugins/ObjectFile/JSON/ObjectFileJSON.cpp
index 9804b36ba86045..c70f5899556289 100644
--- a/lldb/source/Plugins/ObjectFile/JSON/ObjectFileJSON.cpp
+++ b/lldb/source/Plugins/ObjectFile/JSON/ObjectFileJSON.cpp
@@ -109,10 +109,10 @@ ObjectFile *ObjectFileJSON::CreateInstance(const ModuleSP &module_sp,
                             std::move(body.sections));
 }
 
-ObjectFile *ObjectFileJSON::CreateMemoryInstance(const ModuleSP &module_sp,
-                                                 WritableDataBufferSP data_sp,
-                                                 const ProcessSP &process_sp,
-                                                 addr_t header_addr) {
+ObjectFile *ObjectFileJSON::CreateMemoryInstance(
+    const ModuleSP &module_sp, WritableDataBufferSP data_sp,
+    const ProcessSP &process_sp, addr_t header_addr,
+    bool disable_memory_symtab_caching) {
   return nullptr;
 }
 
diff --git a/lldb/source/Plugins/ObjectFile/JSON/ObjectFileJSON.h b/lldb/source/Plugins/ObjectFile/JSON/ObjectFileJSON.h
index f48ebdf79220f7..3ec35ee7686367 100644
--- a/lldb/source/Plugins/ObjectFile/JSON/ObjectFileJSON.h
+++ b/lldb/source/Plugins/ObjectFile/JSON/ObjectFileJSON.h
@@ -36,7 +36,8 @@ class ObjectFileJSON : public ObjectFile {
   static ObjectFile *CreateMemoryInstance(const lldb::ModuleSP &module_sp,
                                           lldb::WritableDataBufferSP data_sp,
                                           const lldb::ProcessSP &process_sp,
-                                          lldb::addr_t header_addr);
+                                          lldb::addr_t header_addr,
+                                          bool disable_memory_symtab_caching);
 
   static ModuleSpecList
   GetModuleSpecifications(const FileSpec &file,
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 7a88637e729f52..285f442bd2418c 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -844,12 +844,14 @@ ObjectFile *ObjectFileMachO::CreateInstance(const lldb::ModuleSP &module_sp,
 
 ObjectFile *ObjectFileMachO::CreateMemoryInstance(
     const lldb::ModuleSP &module_sp, WritableDataBufferSP data_sp,
-    const ProcessSP &process_sp, lldb::addr_t header_addr) {
+    const ProcessSP &process_sp, lldb::addr_t header_addr,
+    bool disable_memory_symtab_caching) {
   DataExtractorSP extractor_sp = std::make_shared<DataExtractor>(data_sp);
   if (ObjectFileMachO::MagicBytesMatch(extractor_sp, 0,
                                        extractor_sp->GetByteSize())) {
     std::unique_ptr<ObjectFile> objfile_up(
         new ObjectFileMachO(module_sp, data_sp, process_sp, header_addr));
+    objfile_up->SetDisableMemorySymtabCaching(disable_memory_symtab_caching);
     if (objfile_up.get() && objfile_up->ParseHeader())
       return objfile_up.release();
   }
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
index bcc76d7e4bec2f..fdeff8e8619551 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
@@ -55,7 +55,8 @@ class ObjectFileMachO : public lldb_private::ObjectFile {
 
   static lldb_private::ObjectFile *CreateMemoryInstance(
       const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp,
-      const lldb::ProcessSP &process_sp, lldb::addr_t header_addr);
+      const lldb::ProcessSP &process_sp, lldb::addr_t header_addr,
+      bool disable_memory_symtab_caching);
 
   static lldb_private::ModuleSpecList
   GetModuleSpecifications(const lldb_private::FileSpec &file,
diff --git a/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp b/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp
index 20817aac285407..380f0e8321f405 100644
--- a/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp
+++ b/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp
@@ -43,7 +43,8 @@ ObjectFile *ObjectFileMinidump::CreateInstance(
 
 ObjectFile *ObjectFileMinidump::CreateMemoryInstance(
     const lldb::ModuleSP &module_sp, WritableDataBufferSP data_sp,
-    const ProcessSP &process_sp, lldb::addr_t header_addr) {
+    const ProcessSP &process_sp, lldb::addr_t header_addr,
+    bool disable_memory_symtab_caching) {
   return nullptr;
 }
 
diff --git a/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h b/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h
index 0c859151fc8170..a060a45a50ec68 100644
--- a/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h
+++ b/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h
@@ -46,7 +46,8 @@ class ObjectFileMinidump : public lldb_private::PluginInterface {
 
   static lldb_private::ObjectFile *CreateMemoryInstance(
       const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp,
-      const lldb::ProcessSP &process_sp, lldb::addr_t header_addr);
+      const lldb::ProcessSP &process_sp, lldb::addr_t header_addr,
+      bool disable_memory_symtab_caching);
 
   static lldb_private::ModuleSpecList
   GetModuleSpecifications(const lldb_private::FileSpec &file,
diff --git a/lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.cpp b/lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.cpp
index 840169c563a9c8..9220d88febb3fd 100644
--- a/lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.cpp
+++ b/lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.cpp
@@ -104,10 +104,10 @@ ObjectFile *ObjectFilePDB::CreateInstance(const ModuleSP &module_sp,
   return objfile_up.release();
 }
 
-ObjectFile *ObjectFilePDB::CreateMemoryInstance(const ModuleSP &module_sp,
-                                                WritableDataBufferSP data_sp,
-                                                const ProcessSP &process_sp,
-                                                addr_t header_addr) {
+ObjectFile *ObjectFilePDB::CreateMemoryInstance(
+    const ModuleSP &module_sp, WritableDataBufferSP data_sp,
+    const ProcessSP &process_sp, addr_t header_addr,
+    bool disable_memory_symtab_caching) {
   return nullptr;
 }
 
diff --git a/lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.h b/lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.h
index 5f52908a22d9e2..01c8bf892d9289 100644
--- a/lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.h
+++ b/lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.h
@@ -40,7 +40,8 @@ class ObjectFilePDB : public ObjectFile {
   static ObjectFile *CreateMemoryInstance(const lldb::ModuleSP &module_sp,
                                           lldb::WritableDataBufferSP data_sp,
                                           const lldb::ProcessSP &process_sp,
-                                          lldb::addr_t header_addr);
+                                          lldb::addr_t header_addr,
+                                          bool disable_memory_symtab_caching);
 
   static ModuleSpecList
   GetModuleSpecifications(const FileSpec &file,
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
index ac7dd8c967f4e6..6f7fd200228177 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -243,7 +243,8 @@ ObjectFile *ObjectFilePECOFF::CreateInstance(
 
 ObjectFile *ObjectFilePECOFF::CreateMemoryInstance(
     const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp,
-    const lldb::ProcessSP &process_sp, lldb::addr_t header_addr) {
+    const lldb::ProcessSP &process_sp, lldb::addr_t header_addr,
+    bool disable_memory_symtab_caching) {
   if (!data_sp)
     return nullptr;
   DataExtractorSP extractor_sp =
@@ -252,6 +253,7 @@ ObjectFile *ObjectFilePECOFF::CreateMemoryInstance(
     return nullptr;
   auto objfile_up = std::make_unique<ObjectFilePECOFF>(
       module_sp, data_sp, process_sp, header_addr);
+  objfile_up->SetDisableMemorySymtabCaching(disable_memory_symtab_caching);
   if (objfile_up.get() && objfile_up->ParseHeader()) {
     return objfile_up.release();
   }
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
index 923097348d9714..b22233d8982b9a 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
@@ -76,7 +76,8 @@ class ObjectFilePECOFF : public lldb_private::ObjectFile {
 
   static lldb_private::ObjectFile *CreateMemoryInstance(
       const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp,
-      const lldb::ProcessSP &process_sp, lldb::addr_t header_addr);
+      const lldb::ProcessSP &process_sp, lldb::addr_t header_addr,
+      bool disable_memory_symtab_caching);
 
   static lldb_private::ModuleSpecList
   GetModuleSpecifications(const lldb_private::FileSpec &file,
diff --git a/lldb/source/Plugins/ObjectFile/Placeholder/ObjectFilePlaceholder.cpp b/lldb/source/Plugins/ObjectFile/Placeholder/ObjectFilePlaceholder.cpp
index 4dd5c1bd296481..fb74c250df8cc0 100644
--- a/lldb/source/Plugins/ObjectFile/Placeholder/ObjectFilePlaceholder.cpp
+++ b/lldb/source/Plugins/ObjectFile/Placeholder/ObjectFilePlaceholder.cpp
@@ -30,7 +30,8 @@ ObjectFilePlaceholder::ObjectFilePlaceholder(
                  /*length*/ 0, /*data_sp*/ nullptr, /*data_offset*/ 0),
       m_arch(module_spec.GetArchitecture()), m_uuid(module_spec.GetUUID()),
       m_base(base), m_size(size) {
-  m_symtab_up = std::make_unique<lldb_private::Symtab>(this);
+  m_symtab_up = std::make_unique<lldb_private::Symtab>(
+      this, m_disable_memory_symtab_caching);
 }
 
 void ObjectFilePlaceholder::CreateSections(
diff --git a/lldb/source/Plugins/ObjectFile/XCOFF/ObjectFileXCOFF.cpp b/lldb/source/Plugins/ObjectFile/XCOFF/ObjectFileXCOFF.cpp
index a00d92f5885200..ad3c910a2f5d94 100644
--- a/lldb/source/Plugins/ObjectFile/XCOFF/ObjectFileXCOFF.cpp
+++ b/lldb/source/Plugins/ObjectFile/XCOFF/ObjectFileXCOFF.cpp
@@ -122,7 +122,8 @@ bool ObjectFileXCOFF::CreateBinary() {
 
 ObjectFile *ObjectFileXCOFF::CreateMemoryInstance(
     const lldb::ModuleSP &module_sp, WritableDataBufferSP data_sp,
-    const lldb::ProcessSP &process_sp, lldb::addr_t header_addr) {
+    const lldb::ProcessSP &process_sp, lldb::addr_t header_addr,
+    bool disable_memory_symtab_caching) {
   return nullptr;
 }
 
diff --git a/lldb/source/Plugins/ObjectFile/XCOFF/ObjectFileXCOFF.h b/lldb/source/Plugins/ObjectFile/XCOFF/ObjectFileXCOFF.h
index 749902eebf3007..f125af94f52d43 100644
--- a/lldb/source/Plugins/ObjectFile/XCOFF/ObjectFileXCOFF.h
+++ b/lldb/source/Plugins/ObjectFile/XCOFF/ObjectFileXCOFF.h
@@ -45,7 +45,8 @@ class ObjectFileXCOFF : public lldb_private::ObjectFile {
 
   static lldb_private::ObjectFile *CreateMemoryInstance(
       const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp,
-      const lldb::ProcessSP &process_sp, lldb::addr_t header_addr);
+      const lldb::ProcessSP &process_sp, lldb::addr_t header_addr,
+      bool disable_memory_symtab_caching);
 
   static lldb_private::ModuleSpecList
   GetModuleSpecifications(const lldb_private::FileSpec &file,
diff --git a/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp b/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp
index 4b89e44a18d9da..b694fe501d89b1 100644
--- a/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp
+++ b/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp
@@ -203,15 +203,16 @@ ObjectFile *ObjectFileWasm::CreateInstance(const ModuleSP &module_sp,
   return nullptr;
 }
 
-ObjectFile *ObjectFileWasm::CreateMemoryInstance(const ModuleSP &module_sp,
-                                                 WritableDataBufferSP data_sp,
-                                                 const ProcessSP &process_sp,
-                                                 addr_t header_addr) {
+ObjectFile *ObjectFileWasm::CreateMemoryInstance(
+    const ModuleSP &module_sp, WritableDataBufferSP data_sp,
+    const ProcessSP &process_sp, addr_t header_addr,
+    bool disable_memory_symtab_caching) {
   if (!ValidateModuleHeader(data_sp->GetData()))
     return nullptr;
 
   std::unique_ptr<ObjectFileWasm> objfile_up(
       new ObjectFileWasm(module_sp, data_sp, process_sp, header_addr));
+  objfile_up->SetDisableMemorySymtabCaching(disable_memory_symtab_caching);
   ArchSpec spec = objfile_up->GetArchitecture();
   if (spec && objfile_up->SetModulesArchitecture(spec))
     return objfile_up.release();
diff --git a/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.h b/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.h
index cdfe6e41bab84d..d00a1061e6cfe6 100644
--- a/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.h
+++ b/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.h
@@ -57,7 +57,8 @@ class ObjectFileWasm : public ObjectFile {
   static ObjectFile *CreateMemoryInstance(const lldb::ModuleSP &module_sp,
                                           lldb::WritableDataBufferSP data_sp,
                                           const lldb::ProcessSP &process_sp,
-                                          lldb::addr_t header_addr);
+                                          lldb::addr_t header_addr,
+                                          bool disable_memory_symtab_caching);
 
   static ModuleSpecList
   GetModuleSpecifications(const FileSpec &file,
diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
index e7e9088c38356b..be77bc859d492c 100644
--- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -277,9 +277,13 @@ Status ProcessElfCore::DoLoadCore() {
         std::optional<NT_FILE_Entry> exe_header =
             GetNTFileEntryForExecutableELFHeader();
         if (exe_header) {
+          // Don't use the index cache for symbol tables of binaries read out of
+          // a corefile.
+          const bool disable_memory_symtab_caching = (bool)GetCoreFile();
           if (llvm::Expected<lldb::ModuleSP> module_sp_or_err =
                   ReadModuleFromMemory(exe_module_spec.GetFileSpec(),
                                        exe_header->start,
+                                       disable_memory_symtab_caching,
                                        exe_header->end - exe_header->start))
             exe_module_sp = *module_sp_or_err;
           else
diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp
index b921b145e489eb..31bd66446550ad 100644
--- a/lldb/source/Symbol/ObjectFile.cpp
+++ b/lldb/source/Symbol/ObjectFile.cpp
@@ -158,7 +158,8 @@ ObjectFileSP ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp,
 ObjectFileSP ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp,
                                     const ProcessSP &process_sp,
                                     lldb::addr_t header_addr,
-                                    WritableDataBufferSP data_sp) {
+                                    WritableDataBufferSP data_sp,
+                                    bool disable_memory_symtab_caching) {
   ObjectFileSP object_file_sp;
 
   if (module_sp) {
@@ -173,8 +174,9 @@ ObjectFileSP ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp,
     for (auto &cbs : PluginManager::GetObjectFileCallbacks()) {
       if (!cbs.create_memory_callback)
         continue;
-      object_file_sp.reset(cbs.create_memory_callback(module_sp, data_sp,
-                                                      process_sp, header_addr));
+      object_file_sp.reset(cbs.create_memory_callback(
+          module_sp, data_sp, process_sp, header_addr,
+          disable_memory_symtab_caching));
       if (object_file_sp.get())
         return object_file_sp;
     }
@@ -256,7 +258,8 @@ ObjectFile::ObjectFile(const lldb::ModuleSP &module_sp,
       m_type(eTypeInvalid), m_strata(eStrataInvalid),
       m_file_offset(file_offset), m_length(length),
       m_data_nsp(std::make_shared<DataExtractor>()), m_process_wp(),
-      m_memory_addr(LLDB_INVALID_ADDRESS), m_sections_up(), m_symtab_up(),
+      m_memory_addr(LLDB_INVALID_ADDRESS),
+      m_disable_memory_symtab_caching(false), m_sections_up(), m_symtab_up(),
       m_symtab_once_up(new llvm::once_flag()) {
   if (file_spec_ptr)
     m_file = *file_spec_ptr;
@@ -283,8 +286,8 @@ ObjectFile::ObjectFile(const lldb::ModuleSP &module_sp,
     : ModuleChild(module_sp), m_file(), m_type(eTypeInvalid),
       m_strata(eStrataInvalid), m_file_offset(0), m_length(0),
       m_data_nsp(std::make_shared<DataExtractor>()), m_process_wp(process_sp),
-      m_memory_addr(header_addr), m_sections_up(), m_symtab_up(),
-      m_symtab_once_up(new llvm::once_flag()) {
+      m_memory_addr(header_addr), m_disable_memory_symtab_caching(false),
+      m_sections_up(), m_symtab_up(), m_symtab_once_up(new llvm::once_flag()) {
   if (header_extractor_sp && header_extractor_sp->HasData())
     m_data_nsp = header_extractor_sp;
   Log *log = GetLog(LLDBLog::Object);
@@ -800,7 +803,7 @@ Symtab *ObjectFile::GetSymtab(bool can_create) {
     // not be able to access the symbol table contents since all APIs in Symtab
     // are protected by a mutex in the Symtab object itself.
     llvm::call_once(*m_symtab_once_up, [&]() {
-      Symtab *symtab = new Symtab(this);
+      Symtab *symtab = new Symtab(this, m_disable_memory_symtab_caching);
       std::lock_guard<std::recursive_mutex> symtab_guard(symtab->GetMutex());
       m_symtab_up.reset(symtab);
       if (!m_symtab_up->LoadFromCache()) {
diff --git a/lldb/source/Symbol/Symtab.cpp b/lldb/source/Symbol/Symtab.cpp
index 8a075f92846ca7..54ae56ae476590 100644
--- a/lldb/source/Symbol/Symtab.cpp
+++ b/lldb/source/Symbol/Symtab.cpp
@@ -32,8 +32,9 @@
 using namespace lldb;
 using namespace lldb_private;
 
-Symtab::Symtab(ObjectFile *objfile)
-    : m_objfile(objfile), m_file_addr_to_index(*this) {
+Symtab::Symtab(ObjectFile *objfile, bool disable_memory_symtab_caching)
+    : m_objfile(objfile), m_file_addr_to_index(*this),
+      m_disable_memory_symtab_caching(disable_memory_symtab_caching) {
   m_name_to_symbol_indices.emplace(std::make_pair(
       lldb::eFunctionNameTypeNone, UniqueCStringMap<uint32_t>()));
   m_name_to_symbol_indices.emplace(std::make_pair(
@@ -1149,7 +1150,8 @@ std::string Symtab::GetCacheKey() {
 }
 
 void Symtab::SaveToCache() {
-  DataFileCache *cache = Module::GetIndexCache(m_objfile->IsInMemory());
+  DataFileCache *cache = Module::GetIndexCache(m_objfile->IsInMemory(),
+                                               m_disable_memory_symtab_caching);
   if (!cache)
     return; // Caching is not enabled.
 
@@ -1328,7 +1330,8 @@ bool Symtab::Decode(const DataExtractor &data, lldb::offset_t *offset_ptr,
 }
 
 bool Symtab::LoadFromCache() {
-  DataFileCache *cache = Module::GetIndexCache(m_objfile->IsInMemory());
+  DataFileCache *cache = Module::GetIndexCache(m_objfile->IsInMemory(),
+                                               m_disable_memory_symtab_caching);
   if (!cache)
     return false;
 
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index ad2ae1a5b682f9..97aceb06c05a17 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -2807,9 +2807,9 @@ bool Process::GetWatchpointReportedAfter() {
   return reported_after;
 }
 
-llvm::Expected<ModuleSP>
-Process::ReadModuleFromMemory(const FileSpec &file_spec,
-                              lldb::addr_t header_addr, size_t size_to_read) {
+llvm::Expected<ModuleSP> Process::ReadModuleFromMemory(
+    const FileSpec &file_spec, lldb::addr_t header_addr,
+    bool disable_memory_symtab_caching, size_t size_to_read) {
   LLDB_LOGF(GetLog(LLDBLog::Host),
             "Process::ReadModuleFromMemory reading %s binary from memory",
             file_spec.GetPath().c_str());
@@ -2827,6 +2827,7 @@ Process::ReadModuleFromMemory(const FileSpec &file_spec,
                                              file_spec.GetFilename().str());
 
   if (module_sp->GetMemoryObjectFile(shared_from_this(), header_addr, error,
+                                     disable_memory_symtab_caching,
                                      size_to_read))
     return module_sp;
 
diff --git a/lldb/test/API/functionalities/module_cache/corefile_memory_module/Makefile b/lldb/test/API/functionalities/module_cache/corefile_memory_module/Makefile
new file mode 100644
index 00000000000000..99998b20bcb050
--- /dev/null
+++ b/lldb/test/API/functionalities/module_cache/corefile_memory_module/Makefile
@@ -0,0 +1,3 @@
+CXX_SOURCES := main.cpp
+
+include Makefile.rules
diff --git a/lldb/test/API/functionalities/module_cache/corefile_memory_module/TestModuleCacheCorefileMemoryModule.py b/lldb/test/API/functionalities/module_cache/corefile_memory_module/TestModuleCacheCorefileMemoryModule.py
new file mode 100644
index 00000000000000..2425eefbdefc21
--- /dev/null
+++ b/lldb/test/API/functionalities/module_cache/corefile_memory_module/TestModuleCacheCorefileMemoryModule.py
@@ -0,0 +1,86 @@
+"""Test that symbol tables of binaries read out of a corefile's memory
+are not saved in the LLDB index cache."""
+
+import glob
+import os
+import shutil
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class ModuleCacheCorefileMemoryModuleTestCase(TestBase):
+    NO_DEBUG_INFO_TESTCASE = True
+    SHARED_BUILD_TESTCASE = False
+
+    @requireDarwin
+    @skipIfRemote
+    def test_corefile_memory_module_not_cached(self):
+        """Create a corefile, then remove the binary from disk so lldb
+        must read it out of the corefile's memory. With caching of memory
+        modules enabled, confirm that no symbol table for the binary is
+        written to the index cache."""
+        self.build()
+        exe = self.getBuildArtifact("a.out")
+        corefile = self.getBuildArtifact("process.core")
+
+        target, process, _, _ = lldbutil.run_to_source_breakpoint(
+            self, "// break here", lldb.SBFileSpec("main.cpp")
+        )
+
+        # Save a stack-only corefile, plus the binary's __TEXT and
+        # __LINKEDIT so it can be read from the corefile's memory. A
+        # full corefile would include the entire shared cache.
+        options = lldb.SBSaveCoreOptions()
+        options.SetOutputFile(lldb.SBFileSpec(corefile))
+        options.SetStyle(lldb.eSaveCoreStackOnly)
+        exe_module = target.FindModule(lldb.SBFileSpec("a.out"))
+        for segname in ["__TEXT", "__LINKEDIT"]:
+            segment = exe_module.FindSection(segname)
+            self.assertTrue(segment.IsValid())
+            region = lldb.SBMemoryRegionInfo()
+            self.assertSuccess(
+                process.GetMemoryRegionInfo(segment.GetLoadAddress(target), region)
+            )
+            self.assertSuccess(options.AddMemoryRegionToSave(region))
+        self.assertSuccess(process.SaveCore(options))
+        self.assertTrue(os.path.isfile(corefile))
+
+        self.assertSuccess(process.Kill())
+        self.dbg.DeleteTarget(target)
+        self.assertEqual(self.dbg.GetNumTargets(), 0)
+        self.dbg.MemoryPressureDetected()
+
+        # Remove the binary and its dSYM so lldb can only get the binary
+        # from the corefile's memory.
+        os.unlink(exe)
+        dsym = exe + ".dSYM"
+        if os.path.exists(dsym):
+            shutil.rmtree(dsym)
+
+        cache_dir = os.path.join(self.getBuildDir(), "lldb-module-cache")
+        self.runCmd('settings set -g symbols.lldb-index-cache-path "%s"' % cache_dir)
+        self.runCmd("settings set -g symbols.enable-lldb-index-cache false")
+        self.runCmd(
+            "settings set -g symbols.enable-lldb-index-cache-memory-modules true"
+        )
+
+        target = self.dbg.CreateTarget(None)
+        self.assertTrue(target.IsValid())
+        process = target.LoadCore(corefile)
+        self.assertTrue(process.IsValid(), PROCESS_IS_VALID)
+
+        # Confirm the binary was loaded in the corefile process.
+        self.expect("image list", substrs=["a.out"])
+        exe_module = target.FindModule(lldb.SBFileSpec("a.out"))
+        self.assertTrue(exe_module.IsValid())
+
+        # Force the symbol table to be created, which is when it would be
+        # saved to the index cache.
+        self.runCmd("bt")
+        self.assertGreater(exe_module.GetNumSymbols(), 0)
+
+        # Confirm no symbol table was saved in the index cache for the binary.
+        module_file_glob = os.path.join(cache_dir, "llvmcache-*a.out*-symtab-*")
+        self.assertEqual(len(glob.glob(module_file_glob)), 0)
diff --git a/lldb/test/API/functionalities/module_cache/corefile_memory_module/main.cpp b/lldb/test/API/functionalities/module_cache/corefile_memory_module/main.cpp
new file mode 100644
index 00000000000000..d16f1d2d4ed5d0
--- /dev/null
+++ b/lldb/test/API/functionalities/module_cache/corefile_memory_module/main.cpp
@@ -0,0 +1,19 @@
+int func1(int in) { return in + 1; }
+
+int func2(int in) { return in * 2; }
+
+int func3(int in) { return in - 3; }
+
+int func4(int in) { return in * 4; }
+
+int func5(int in) { return in + 5; }
+
+int main() {
+  int val = 10;
+  val = func1(val);
+  val = func2(val);
+  val = func3(val);
+  val = func4(val);
+  val = func5(val); // break here
+  return val;
+}
diff --git a/lldb/unittests/ObjectFile/MachO/TestObjectFileMachO.cpp b/lldb/unittests/ObjectFile/MachO/TestObjectFileMachO.cpp
index 6963cc0b791bd0..78dcffc51b5380 100644
--- a/lldb/unittests/ObjectFile/MachO/TestObjectFileMachO.cpp
+++ b/lldb/unittests/ObjectFile/MachO/TestObjectFileMachO.cpp
@@ -117,7 +117,7 @@ TEST_F(ObjectFileMachOTest, IndirectSymbolsInTheSharedCache) {
 
   // Check that we can parse the symbol table several times over without
   // crashing.
-  Symtab symtab(OF);
+  Symtab symtab(OF, /*disable_memory_symtab_caching=*/false);
   for (size_t i = 0; i < 10; i++)
     OF->ParseSymtab(symtab);
 }
@@ -200,7 +200,7 @@ TEST_F(ObjectFileMachOTest, ParseSymtabSharedCacheMissingLinkedit) {
   ASSERT_TRUE(llvm::isa<ObjectFileMachO>(OF));
 
   // Simply no crashing is the regression check.
-  Symtab symtab(OF);
+  Symtab symtab(OF, /*disable_memory_symtab_caching=*/false);
   OF->ParseSymtab(symtab);
 }
 
@@ -245,6 +245,6 @@ TEST_F(ObjectFileMachOTest, ParseSymtabHugeSymbolCountIsBounded) {
   ObjectFile *OF = module->GetObjectFile();
   ASSERT_TRUE(llvm::isa<ObjectFileMachO>(OF));
 
-  Symtab symtab(OF);
+  Symtab symtab(OF, /*disable_memory_symtab_caching=*/false);
   OF->ParseSymtab(symtab);
 }
diff --git a/lldb/unittests/Symbol/SymtabTest.cpp b/lldb/unittests/Symbol/SymtabTest.cpp
index 0236b6caa97068..4449a47c5da62d 100644
--- a/lldb/unittests/Symbol/SymtabTest.cpp
+++ b/lldb/unittests/Symbol/SymtabTest.cpp
@@ -44,7 +44,8 @@ static void EncodeDecode(const Symtab &object, ByteOrder byte_order) {
   object.Encode(file);
   llvm::ArrayRef<uint8_t> bytes = file.GetData();
   DataExtractor data(bytes.data(), bytes.size(), byte_order, addr_size);
-  Symtab decoded_object(object.GetObjectFile());
+  Symtab decoded_object(object.GetObjectFile(),
+                        /*disable_memory_symtab_caching=*/false);
   offset_t data_offset = 0;
   bool uuid_mismatch = false;
   decoded_object.Decode(data, &data_offset, uuid_mismatch);
@@ -296,7 +297,7 @@ TEST_F(SymtabTest, EncodeDecodeSymtab) {
   ASSERT_NE(objfile, nullptr);
 
   // Test encoding and decoding an empty symbol table.
-  Symtab symtab(objfile);
+  Symtab symtab(objfile, /*disable_memory_symtab_caching=*/false);
   symtab.PreloadSymbols();
   EncodeDecode(symtab);
 
@@ -671,7 +672,7 @@ TEST_F(SymtabTest, TestDecodeCStringMaps) {
   // Test encoding and decoding an empty symbol table.
   DataExtractor data(symtab_cache_bytes, sizeof(symtab_cache_bytes),
                      eByteOrderLittle, 8);
-  Symtab symtab(objfile);
+  Symtab symtab(objfile, /*disable_memory_symtab_caching=*/false);
   offset_t data_offset = 0;
   bool uuid_mismatch = false; // Gets set to true if signature doesn't match.
   const bool success = symtab.Decode(data, &data_offset, uuid_mismatch);

>From b2655515aac7862935e8571c94f149604a0920f8 Mon Sep 17 00:00:00 2001
From: Jason Molenda <jmolenda at apple.com>
Date: Fri, 30 Oct 2026 22:00:07 -0700
Subject: [PATCH 2/7] Move logic for force-disabling the symtab caching on the
 debug host into Process::ReadModuleFromMemory, remove it from all callers.

In a subsequent PR I will be adding a flag to Process::ReadModuleFromMemory
to disable caching of memory modules on the debug host, with a defaulted
value so only DynamicLoaderDarwin will use that flag.  I'll also add
caching of the binary header bytes in Process::ReadModuleFromMemory.
---
 lldb/include/lldb/Target/Process.h                  |  5 -----
 lldb/source/API/SBModule.cpp                        |  6 +-----
 lldb/source/Core/DynamicLoader.cpp                  | 13 +++----------
 .../Darwin-Kernel/DynamicLoaderDarwinKernel.cpp     | 10 +---------
 .../FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp   | 10 +---------
 .../MacOSX-DYLD/DynamicLoaderDarwin.cpp             | 12 +++---------
 .../POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp           |  6 +-----
 .../wasm-DYLD/DynamicLoaderWasmDYLD.cpp             |  7 ++-----
 lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp  |  4 ----
 .../Plugins/Process/elf-core/ProcessElfCore.cpp     |  4 ----
 lldb/source/Target/Process.cpp                      | 10 +++++++---
 11 files changed, 19 insertions(+), 68 deletions(-)

diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h
index 95bac144c93c9c..226c58034dd655 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -2072,16 +2072,11 @@ class Process : public std::enable_shared_from_this<Process>,
   /// \param[in] header_addr
   ///   The address pointing to the beginning of the object file's header.
   ///
-  /// \param[in] disable_memory_symtab_caching
-  ///   If true, the symbol table for this module will not be loaded from or
-  ///   saved to the index cache, even if caching of memory modules is enabled.
-  ///
   /// \param[in] size_to_read
   ///   The number of bytes to read from memory. This should be large enough to
   ///   identify the object file format. Defaults to 512.
   llvm::Expected<lldb::ModuleSP>
   ReadModuleFromMemory(const FileSpec &file_spec, lldb::addr_t header_addr,
-                       bool disable_memory_symtab_caching,
                        size_t size_to_read = 512);
 
   /// Attempt to get the attributes for a region of memory in the process.
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp
index 0ae426775d39ff..4bc3df9992a72e 100644
--- a/lldb/source/API/SBModule.cpp
+++ b/lldb/source/API/SBModule.cpp
@@ -53,12 +53,8 @@ SBModule::SBModule(lldb::SBProcess &process, lldb::addr_t header_addr) {
 
   ProcessSP process_sp(process.GetSP());
   if (process_sp) {
-    // Don't use the index cache for symbol tables of binaries read out of a
-    // corefile.
-    const bool disable_memory_symtab_caching = (bool)process_sp->GetCoreFile();
     llvm::Expected<ModuleSP> module_sp_or_err =
-        process_sp->ReadModuleFromMemory(FileSpec(), header_addr,
-                                         disable_memory_symtab_caching);
+        process_sp->ReadModuleFromMemory(FileSpec(), header_addr);
     if (auto err = module_sp_or_err.takeError()) {
       llvm::consumeError(std::move(err));
       return;
diff --git a/lldb/source/Core/DynamicLoader.cpp b/lldb/source/Core/DynamicLoader.cpp
index 94ab706300dce5..18226fb2be887a 100644
--- a/lldb/source/Core/DynamicLoader.cpp
+++ b/lldb/source/Core/DynamicLoader.cpp
@@ -183,12 +183,8 @@ ModuleSP DynamicLoader::LoadModuleAtAddress(const FileSpec &file,
   // We have a core file, try to load the image from memory if we didn't find
   // the module.
   if (!module_sp && !m_process->IsLiveDebugSession()) {
-    // Don't use the index cache for symbol tables of binaries read out of a
-    // corefile.
-    const bool disable_memory_symtab_caching = (bool)m_process->GetCoreFile();
     llvm::Expected<ModuleSP> memory_module_sp_or_err =
-        m_process->ReadModuleFromMemory(file, base_addr,
-                                        disable_memory_symtab_caching);
+        m_process->ReadModuleFromMemory(file, base_addr);
     if (auto err = memory_module_sp_or_err.takeError())
       LLDB_LOG_ERROR(GetLog(LLDBLog::DynamicLoader), std::move(err),
                      "Failed to read module from memory: {0}");
@@ -210,11 +206,8 @@ static ModuleSP ReadUnnamedMemoryModule(Process *process, addr_t addr,
     snprintf(namebuf, sizeof(namebuf), "memory-image-0x%" PRIx64, addr);
     name = namebuf;
   }
-  // Don't use the index cache for symbol tables of binaries read out of a
-  // corefile.
-  const bool disable_memory_symtab_caching = (bool)process->GetCoreFile();
-  llvm::Expected<ModuleSP> module_sp_or_err = process->ReadModuleFromMemory(
-      FileSpec(name), addr, disable_memory_symtab_caching);
+  llvm::Expected<ModuleSP> module_sp_or_err =
+      process->ReadModuleFromMemory(FileSpec(name), addr);
   if (auto err = module_sp_or_err.takeError()) {
     LLDB_LOG_ERROR(GetLog(LLDBLog::DynamicLoader), std::move(err),
                    "Failed to read module from memory: {0}");
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 85c9ac0d65eccd..054af037abf413 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -468,12 +468,8 @@ DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(lldb::addr_t addr,
   if (header.filetype == llvm::MachO::MH_EXECUTE &&
       (header.flags & llvm::MachO::MH_DYLDLINK) == 0) {
     // Create a full module to get the UUID
-    // Don't use the index cache for symbol tables of binaries read out of a
-    // corefile.
-    const bool disable_memory_symtab_caching = (bool)process->GetCoreFile();
     llvm::Expected<ModuleSP> memory_module_sp_or_err =
-        process->ReadModuleFromMemory(FileSpec("temp_mach_kernel"), addr,
-                                      disable_memory_symtab_caching);
+        process->ReadModuleFromMemory(FileSpec("temp_mach_kernel"), addr);
     if (auto err = memory_module_sp_or_err.takeError()) {
       LLDB_LOG_ERROR(log, std::move(err),
                      "DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress: "
@@ -677,12 +673,8 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::ReadMemoryModule(
       size_to_read = sizeof(llvm::MachO::mach_header_64) + mh.sizeofcmds;
   }
 
-  // Don't use the index cache for symbol tables of binaries read out of a
-  // corefile.
-  const bool disable_memory_symtab_caching = (bool)process->GetCoreFile();
   llvm::Expected<ModuleSP> memory_module_sp_or_err =
       process->ReadModuleFromMemory(file_spec, m_load_address,
-                                    disable_memory_symtab_caching,
                                     size_to_read);
   if (auto err = memory_module_sp_or_err.takeError()) {
     LLDB_LOG_ERROR(log, std::move(err),
diff --git a/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp b/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
index f2520266c3d1c0..6a74c9a67ba0c4 100644
--- a/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
@@ -296,12 +296,8 @@ lldb_private::UUID DynamicLoaderFreeBSDKernel::CheckForKernelImageAtAddress(
   if (header.e_type != expected_type)
     return UUID();
 
-  // Don't use the index cache for symbol tables of binaries read out of a
-  // corefile.
-  const bool disable_memory_symtab_caching = (bool)process->GetCoreFile();
   llvm::Expected<ModuleSP> memory_module_sp_or_err =
-      process->ReadModuleFromMemory(FileSpec("temp_freebsd_kernel"), addr,
-                                    disable_memory_symtab_caching);
+      process->ReadModuleFromMemory(FileSpec("temp_freebsd_kernel"), addr);
   if (auto err = memory_module_sp_or_err.takeError()) {
     LLDB_LOG_ERROR(log, std::move(err),
                    "DynamicLoaderFreeBSDKernel::CheckForKernelImageAtAddress: "
@@ -398,12 +394,8 @@ bool DynamicLoaderFreeBSDKernel::KModImageInfo::ReadMemoryModule(
     }
   }
 
-  // Don't use the index cache for symbol tables of binaries read out of a
-  // corefile.
-  const bool disable_memory_symtab_caching = (bool)process->GetCoreFile();
   llvm::Expected<ModuleSP> memory_module_sp_or_err =
       process->ReadModuleFromMemory(file_spec, m_load_address,
-                                    disable_memory_symtab_caching,
                                     size_to_read);
   if (auto err = memory_module_sp_or_err.takeError()) {
     LLDB_LOG_ERROR(log, std::move(err),
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
index de94de7d6a75cd..6afda72dbbfff2 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
@@ -179,11 +179,8 @@ ModuleSP DynamicLoaderDarwin::FindTargetModuleForImageInfo(
   // We'll call Target::ModulesDidLoad after all the modules have been
   // added to the target, don't let it be called for every one.
   if (!module_sp || module_sp->GetObjectFile() == nullptr) {
-    // Don't use the index cache for symbol tables of binaries read out of a
-    // corefile.
-    const bool disable_memory_symtab_caching = (bool)m_process->GetCoreFile();
     llvm::Expected<ModuleSP> module_sp_or_err = m_process->ReadModuleFromMemory(
-        image_info.file_spec, image_info.address, disable_memory_symtab_caching,
+        image_info.file_spec, image_info.address,
         image_info.mh_and_load_cmd_size);
     if (auto err = module_sp_or_err.takeError()) {
       LLDB_LOG_ERROR(GetLog(LLDBLog::DynamicLoader), std::move(err),
@@ -788,12 +785,9 @@ bool DynamicLoaderDarwin::AddModulesUsingPreloadedModules(
                                                                true /* notify */);
               if (!commpage_image_module_sp ||
                   commpage_image_module_sp->GetObjectFile() == nullptr) {
-                const bool disable_memory_symtab_caching =
-                    (bool)m_process->GetCoreFile();
                 llvm::Expected<ModuleSP> module_sp_or_err =
-                    m_process->ReadModuleFromMemory(
-                        image_info.file_spec, image_info.address,
-                        disable_memory_symtab_caching);
+                    m_process->ReadModuleFromMemory(image_info.file_spec,
+                                                    image_info.address);
                 if (auto err = module_sp_or_err.takeError()) {
                   LLDB_LOG_ERROR(log, std::move(err),
                                  "Failed to read module from memory: {0}");
diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
index a04496d4959e04..0ecb4528771a7f 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
@@ -609,12 +609,8 @@ void DynamicLoaderPOSIXDYLD::LoadVDSO() {
     return;
   }
 
-  // Don't use the index cache for symbol tables of binaries read out of a
-  // corefile.
-  const bool disable_memory_symtab_caching = (bool)m_process->GetCoreFile();
   llvm::Expected<ModuleSP> module_sp_or_err = m_process->ReadModuleFromMemory(
-      file, m_vdso_base, disable_memory_symtab_caching,
-      info.GetRange().GetByteSize());
+      file, m_vdso_base, info.GetRange().GetByteSize());
   if (auto err = module_sp_or_err.takeError()) {
     LLDB_LOG_ERROR(log, std::move(err),
                    "Failed to read module from memory: {0}");
diff --git a/lldb/source/Plugins/DynamicLoader/wasm-DYLD/DynamicLoaderWasmDYLD.cpp b/lldb/source/Plugins/DynamicLoader/wasm-DYLD/DynamicLoaderWasmDYLD.cpp
index 5fbc609497644c..69e41ac5ebd12b 100644
--- a/lldb/source/Plugins/DynamicLoader/wasm-DYLD/DynamicLoaderWasmDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/wasm-DYLD/DynamicLoaderWasmDYLD.cpp
@@ -76,11 +76,8 @@ lldb::ModuleSP DynamicLoaderWasmDYLD::LoadModuleAtAddress(
           file, link_map_addr, base_addr, base_addr_is_offset))
     return module_sp;
 
-  // Don't use the index cache for symbol tables of binaries read out of a
-  // corefile.
-  const bool disable_memory_symtab_caching = (bool)m_process->GetCoreFile();
-  llvm::Expected<ModuleSP> module_sp_or_err = m_process->ReadModuleFromMemory(
-      file, base_addr, disable_memory_symtab_caching);
+  llvm::Expected<ModuleSP> module_sp_or_err =
+      m_process->ReadModuleFromMemory(file, base_addr);
   if (auto err = module_sp_or_err.takeError()) {
     LLDB_LOG_ERROR(GetLog(LLDBLog::DynamicLoader), std::move(err),
                    "Failed to read module from memory: {0}");
diff --git a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
index b5e3e57d044848..b336a605b747af 100644
--- a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
+++ b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
@@ -323,12 +323,8 @@ bool JITLoaderGDB::ReadJITDescriptorImpl(bool all_entries) {
 
       char jit_name[64];
       snprintf(jit_name, 64, "JIT(0x%" PRIx64 ")", symbolfile_addr);
-      // Don't use the index cache for symbol tables of binaries read out of a
-      // corefile.
-      const bool disable_memory_symtab_caching = (bool)m_process->GetCoreFile();
       llvm::Expected<ModuleSP> module_sp_or_err =
           m_process->ReadModuleFromMemory(FileSpec(jit_name), symbolfile_addr,
-                                          disable_memory_symtab_caching,
                                           symbolfile_size);
       if (auto err = module_sp_or_err.takeError())
         LLDB_LOG_ERROR(
diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
index be77bc859d492c..e7e9088c38356b 100644
--- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -277,13 +277,9 @@ Status ProcessElfCore::DoLoadCore() {
         std::optional<NT_FILE_Entry> exe_header =
             GetNTFileEntryForExecutableELFHeader();
         if (exe_header) {
-          // Don't use the index cache for symbol tables of binaries read out of
-          // a corefile.
-          const bool disable_memory_symtab_caching = (bool)GetCoreFile();
           if (llvm::Expected<lldb::ModuleSP> module_sp_or_err =
                   ReadModuleFromMemory(exe_module_spec.GetFileSpec(),
                                        exe_header->start,
-                                       disable_memory_symtab_caching,
                                        exe_header->end - exe_header->start))
             exe_module_sp = *module_sp_or_err;
           else
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 97aceb06c05a17..ebc6b5d624a911 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -2807,9 +2807,9 @@ bool Process::GetWatchpointReportedAfter() {
   return reported_after;
 }
 
-llvm::Expected<ModuleSP> Process::ReadModuleFromMemory(
-    const FileSpec &file_spec, lldb::addr_t header_addr,
-    bool disable_memory_symtab_caching, size_t size_to_read) {
+llvm::Expected<ModuleSP>
+Process::ReadModuleFromMemory(const FileSpec &file_spec,
+                              lldb::addr_t header_addr, size_t size_to_read) {
   LLDB_LOGF(GetLog(LLDBLog::Host),
             "Process::ReadModuleFromMemory reading %s binary from memory",
             file_spec.GetPath().c_str());
@@ -2826,6 +2826,10 @@ llvm::Expected<ModuleSP> Process::ReadModuleFromMemory(
     progress_up = std::make_unique<Progress>("Reading binary from memory",
                                              file_spec.GetFilename().str());
 
+  // Don't use the index cache for symbol tables of binaries read out of a
+  // corefile.
+  const bool disable_memory_symtab_caching = (bool)GetCoreFile();
+
   if (module_sp->GetMemoryObjectFile(shared_from_this(), header_addr, error,
                                      disable_memory_symtab_caching,
                                      size_to_read))

>From 99f090288f19761aaa1bd494a94a8d4de84ff150 Mon Sep 17 00:00:00 2001
From: Jason Molenda <jmolenda at apple.com>
Date: Fri, 30 Oct 2026 22:12:38 -0700
Subject: [PATCH 3/7] ws fix

---
 .../FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp              | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp b/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
index 6a74c9a67ba0c4..eb08683f4f1e67 100644
--- a/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
@@ -395,8 +395,7 @@ bool DynamicLoaderFreeBSDKernel::KModImageInfo::ReadMemoryModule(
   }
 
   llvm::Expected<ModuleSP> memory_module_sp_or_err =
-      process->ReadModuleFromMemory(file_spec, m_load_address,
-                                    size_to_read);
+      process->ReadModuleFromMemory(file_spec, m_load_address, size_to_read);
   if (auto err = memory_module_sp_or_err.takeError()) {
     LLDB_LOG_ERROR(log, std::move(err),
                    "KextImageInfo::ReadMemoryModule: Failed to read module "

>From cff3f490e30fa7b12e9beb523a910b042d9a3555 Mon Sep 17 00:00:00 2001
From: Jason Molenda <jmolenda at apple.com>
Date: Fri, 30 Oct 2026 23:05:25 -0700
Subject: [PATCH 4/7] ws fix

---
 .../DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp  | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 054af037abf413..7428523ae763b4 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -674,8 +674,7 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::ReadMemoryModule(
   }
 
   llvm::Expected<ModuleSP> memory_module_sp_or_err =
-      process->ReadModuleFromMemory(file_spec, m_load_address,
-                                    size_to_read);
+      process->ReadModuleFromMemory(file_spec, m_load_address, size_to_read);
   if (auto err = memory_module_sp_or_err.takeError()) {
     LLDB_LOG_ERROR(log, std::move(err),
                    "KextImageInfo::ReadMemoryModule failed to read module from "

>From e5e0327f19befe601cf56705e351496363d47860 Mon Sep 17 00:00:00 2001
From: Jason Molenda <jmolenda at apple.com>
Date: Mon, 2 Nov 2026 19:59:34 -0800
Subject: [PATCH 5/7] Make headerdoc for Module::GetIndexCache clearer about
 what it is doing.

---
 lldb/include/lldb/Core/Module.h | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/lldb/include/lldb/Core/Module.h b/lldb/include/lldb/Core/Module.h
index 5c4fe9fd2beb0a..5bd8563575a560 100644
--- a/lldb/include/lldb/Core/Module.h
+++ b/lldb/include/lldb/Core/Module.h
@@ -1046,8 +1046,13 @@ class Module : public std::enable_shared_from_this<Module>,
   ///
   /// LLDB can cache data for a module between runs. This cache directory can be
   /// used to stored data that previously was manually created each time you
-  /// debug. Examples include debug information indexes, symbol tables, symbol
-  /// table indexes, and more.
+  /// debug. Examples include debug information indexes, symbol tables, memory
+  /// module headerbytes, and more.
+  ///
+  /// The arguments to this method give it context about the type of file being
+  /// cache.  It will integrate the user's settings to decide if a DataFileCache
+  /// should be used in this case.
+  ///
   ///
   /// \param[in] memory_module
   ///     True if this binary exists only in memory.
@@ -1057,8 +1062,9 @@ class Module : public std::enable_shared_from_this<Module>,
   ///     modules.
   ///
   /// \returns
-  ///   If caching is enabled in the lldb settings, return a pointer to the data
-  ///   file cache. If caching is not enabled, return NULL.
+  ///   If caching is enabled in the lldb settings and based on the arguments
+  ///   for this currentu se case, , return a pointer to the data file cache.
+  ///   If caching is not enabled for this context/settings, returns nullptr.
   static DataFileCache *
   GetIndexCache(bool memory_module, bool disable_memory_symtab_caching = false);
 

>From f06a6239960671791704c91d7a4f7a4a918ba1d3 Mon Sep 17 00:00:00 2001
From: Jason Molenda <jmolenda at apple.com>
Date: Mon, 2 Nov 2026 20:01:35 -0800
Subject: [PATCH 6/7] small rewrite

---
 lldb/include/lldb/Core/Module.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lldb/include/lldb/Core/Module.h b/lldb/include/lldb/Core/Module.h
index 5bd8563575a560..310a6ed0bdb9a7 100644
--- a/lldb/include/lldb/Core/Module.h
+++ b/lldb/include/lldb/Core/Module.h
@@ -1049,10 +1049,9 @@ class Module : public std::enable_shared_from_this<Module>,
   /// debug. Examples include debug information indexes, symbol tables, memory
   /// module headerbytes, and more.
   ///
-  /// The arguments to this method give it context about the type of file being
-  /// cache.  It will integrate the user's settings to decide if a DataFileCache
-  /// should be used in this case.
-  ///
+  /// The arguments to this method give it context about the type of file we
+  /// are currently handling. It will combine that context with the user's
+  /// settings, to decide if a DataFileCache should be used.
   ///
   /// \param[in] memory_module
   ///     True if this binary exists only in memory.

>From f1968865e31df1e840481d4d6d98f93bcfc64fd9 Mon Sep 17 00:00:00 2001
From: Jason Molenda <jmolenda at apple.com>
Date: Mon, 2 Nov 2026 20:05:08 -0800
Subject: [PATCH 7/7] typeo fix

---
 lldb/include/lldb/Core/Module.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/include/lldb/Core/Module.h b/lldb/include/lldb/Core/Module.h
index 310a6ed0bdb9a7..4f67d850fb9f3e 100644
--- a/lldb/include/lldb/Core/Module.h
+++ b/lldb/include/lldb/Core/Module.h
@@ -1062,7 +1062,7 @@ class Module : public std::enable_shared_from_this<Module>,
   ///
   /// \returns
   ///   If caching is enabled in the lldb settings and based on the arguments
-  ///   for this currentu se case, , return a pointer to the data file cache.
+  ///   for this current use case, return a pointer to the data file cache.
   ///   If caching is not enabled for this context/settings, returns nullptr.
   static DataFileCache *
   GetIndexCache(bool memory_module, bool disable_memory_symtab_caching = false);



More information about the lldb-commits mailing list