[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 10 22:57:53 PDT 2024


================
@@ -1304,9 +1304,11 @@ class CommandObjectProcessSaveCore : public CommandObjectParsed {
         FileSpec output_file(command.GetArgumentAtIndex(0));
         FileSystem::Instance().Resolve(output_file);
         SaveCoreStyle corefile_style = m_options.m_requested_save_core_style;
-        Status error =
-            PluginManager::SaveCore(process_sp, output_file, corefile_style,
-                                    m_options.m_requested_plugin_name);
+        CoreDumpOptions core_dump_options(output_file);
+        core_dump_options.SetCoreDumpPluginName(
+            m_options.m_requested_plugin_name);
+        core_dump_options.SetCoreDumpStyle(corefile_style);
+        Status error = PluginManager::SaveCore(process_sp, core_dump_options);
----------------
clayborg wrote:

We need to remove the instance variables `m_requested_plugin_name` and `m_requested_save_core_style` and replace with with `lldb_private::CoreDumpOptions m_options;`. Then in the code that used to fill in the old ivars, we will just call the accessor instead. We can also call the accessor to set the output file as well on the `m_options;` ivar.

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


More information about the lldb-commits mailing list