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

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 9 18:22:56 PDT 2026


================
@@ -1332,15 +1332,40 @@ class Process : public std::enable_shared_from_this<Process>,
     return StructuredData::ObjectSP();
   }
 
-  // On macOS 10.12, tvOS 10, iOS 10, watchOS 3 and newer, debugserver can
-  // return the full list of loaded shared libraries without needing any input.
+  /// Retrieve a StructuredData dictionary about all of the binaries
+  /// loaded in the process at this time.
+  /// A Darwin target specific behavior, only supported by debugserver,
+  /// response will include load address, filepath, uuid, and may also
+  /// include the fully parsed mach header and load commands.
+  ///
+  /// \param [in] include_mh_and_load_commands
+  ///     Whether the remote stub should include the full details of
+  ///     the mach header and load commands in its reply.  This may
+  ///     cause the packet size to be quite large, so to avoid memory
+  ///     pressure in the remote stub, caller may choose not to fetch
+  ///     these for all binaries.
+  ///
+  /// \return
+  ///     A StructuredData object with the information that could be
+  ///     retrieved..
   virtual lldb_private::StructuredData::ObjectSP
-  GetLoadedDynamicLibrariesInfos() {
+  GetLoadedDynamicLibrariesInfos(bool include_mh_and_load_commands) {
----------------
jasonmolenda wrote:

It turns into a `bool` in the JSON packet we send to debugserver, which is why I thought of that.  I could make an enum, but it would probably be a set of bitfield flags rather than an enum -- it's hard to envision was the second behavior we'd want to enable for `Process::GetLoadedDynamicLibrariesInfos` would be, so I don't know what the most natural representation of this internal API is.

I think I have to defer to you two on this, because the boolean seems the most natural/appropriate API choice here.  

FWIW we have two API today,

```
StructuredData::ObjectSP  GetLoadedDynamicLibrariesInfos()
StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos(lldb::addr_t image_list_address, lldb::addr_t image_count)
```

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


More information about the lldb-commits mailing list