[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Add 64b support to LLDB's minidump file builder. (PR #95312)

Jacob Lalonde via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 13 09:59:06 PDT 2024


================
@@ -59,39 +68,67 @@ class MinidumpFileBuilder {
   // Add ThreadList stream, containing information about all threads running
   // at the moment of core saving. Contains information about thread
   // contexts.
-  lldb_private::Status AddThreadList(const lldb::ProcessSP &process_sp);
-  // Add Exception streams for any threads that stopped with exceptions.
-  void AddExceptions(const lldb::ProcessSP &process_sp);
-  // Add MemoryList stream, containing dumps of important memory segments
-  lldb_private::Status AddMemoryList(const lldb::ProcessSP &process_sp,
-                                     lldb::SaveCoreStyle core_style);
   // Add MiscInfo stream, mainly providing ProcessId
   void AddMiscInfo(const lldb::ProcessSP &process_sp);
   // Add informative files about a Linux process
   void AddLinuxFileStreams(const lldb::ProcessSP &process_sp);
+  // Add Exception streams for any threads that stopped with exceptions.
+  void AddExceptions(const lldb::ProcessSP &process_sp);
   // Dump the prepared data into file. In case of the failure data are
   // intact.
-  lldb_private::Status Dump(lldb::FileUP &core_file) const;
-  // Returns the current number of directories(streams) that have been so far
-  // created. This number of directories will be dumped when calling Dump()
-  size_t GetDirectoriesNum() const;
+  lldb_private::Status AddThreadList(const lldb::ProcessSP &process_sp);
+
+  lldb_private::Status AddMemory(const lldb::ProcessSP &process_sp,
+                                 lldb::SaveCoreStyle core_style);
+
+  lldb_private::Status DumpToFile();
----------------
Jlalond wrote:

To start, this is not a good name, but we need at least two methods: 
 - One method to just write data from the buffer to the current end of the file
 - One method to finalize and run header/directory cleanup.

When trying to get this done I couldn't come up with a good name, so I am soliciting ideas. I think going forward some better version could be `CompleteFile()` `FinalizeFile()` `WriteAndFinish()` but I don't like any of them

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


More information about the lldb-commits mailing list