[Lldb-commits] [lldb] [lldb][Darwin] Fetch detailed binary info in chunks (PR #190720)

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 13 16:47:32 PDT 2026


================
@@ -413,26 +440,44 @@ void DynamicLoaderMacOS::AddBinaries(
   Log *log = GetLog(LLDBLog::DynamicLoader);
   ImageInfo::collection image_infos;
 
-  LLDB_LOGF(log, "Adding %" PRId64 " modules.",
-            (uint64_t)load_addresses.size());
-  StructuredData::ObjectSP binaries_info_sp =
-      m_process->GetLoadedDynamicLibrariesInfos(load_addresses);
-  if (binaries_info_sp.get() && binaries_info_sp->GetAsDictionary() &&
-      binaries_info_sp->GetAsDictionary()->HasKey("images") &&
-      binaries_info_sp->GetAsDictionary()
-          ->GetValueForKey("images")
-          ->GetAsArray() &&
-      binaries_info_sp->GetAsDictionary()
-              ->GetValueForKey("images")
-              ->GetAsArray()
-              ->GetSize() == load_addresses.size()) {
-    if (JSONImageInformationIntoImageInfo(binaries_info_sp, image_infos)) {
-      auto images = PreloadModulesFromImageInfos(image_infos);
-      UpdateSpecialBinariesFromPreloadedModules(images);
-      AddModulesUsingPreloadedModules(images);
+  // For now, hardcode a limit of fetching 600 binaries at once.
+  // Fetching the full binary information for a large number of
+  // binaries can cause debugserver to use too much memory on
+  // memory-limited environments, and get killed.
+  const size_t image_fetch_max = 600;
----------------
medismailben wrote:

Yeah a user settings would make more sense, I agree.

https://github.com/llvm/llvm-project/pull/190720


More information about the lldb-commits mailing list