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

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 18 11:48:29 PDT 2024


================
@@ -1216,13 +1217,26 @@ bool SBProcess::IsInstrumentationRuntimePresent(
 
 lldb::SBError SBProcess::SaveCore(const char *file_name) {
   LLDB_INSTRUMENT_VA(this, file_name);
-  return SaveCore(file_name, "", SaveCoreStyle::eSaveCoreFull);
+  SBSaveCoreOptions options;
+  options.SetOutputFile(SBFileSpec(file_name));
+  options.SetStyle(SaveCoreStyle::eSaveCoreFull);
+  return SaveCore(options);
 }
 
 lldb::SBError SBProcess::SaveCore(const char *file_name,
                                   const char *flavor,
                                   SaveCoreStyle core_style) {
   LLDB_INSTRUMENT_VA(this, file_name, flavor, core_style);
+  SBSaveCoreOptions options;
+  options.SetOutputFile(SBFileSpec(file_name));
+  options.SetPluginName(flavor);
----------------
clayborg wrote:

Check the error from SetPluginName here and return an error if it fails. Otherwise the option won't get set due to the error and it will try to default to the default plug-in.

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


More information about the lldb-commits mailing list