[Lldb-commits] [lldb] [LLDB][SaveCore] Add SBCoreDumpOptions Object, and SBProcess::SaveCore() overload (PR #98403)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 17 14:10:43 PDT 2024


================
@@ -6519,14 +6519,16 @@ struct page_object {
 };
 
 bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp,
-                               const FileSpec &outfile,
-                               lldb::SaveCoreStyle &core_style, Status &error) {
-  if (!process_sp)
-    return false;
-
-  // Default on macOS is to create a dirty-memory-only corefile.
+                               const lldb_private::CoreDumpOptions &options,
+                               Status &error) {
+  auto core_style = options.GetStyle();
   if (core_style == SaveCoreStyle::eSaveCoreUnspecified)
     core_style = SaveCoreStyle::eSaveCoreDirtyOnly;
+  // The FileSpec is already checked in PluginManager::SaveCore.
+  assert(options.GetOutputFile().has_value());
+  const FileSpec outfile = options.GetOutputFile().value();
+  if (!process_sp)
+    return false;
----------------
clayborg wrote:

This would be checked in the `PluginManager::SaveCore(...)` and we can do a assert like we did for the options.GetOutputFile() above

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


More information about the lldb-commits mailing list