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

Jacob Lalonde via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 17 09:47:12 PDT 2024


================
@@ -1222,7 +1223,19 @@ lldb::SBError SBProcess::SaveCore(const char *file_name) {
 lldb::SBError SBProcess::SaveCore(const char *file_name,
                                   const char *flavor,
                                   SaveCoreStyle core_style) {
-  LLDB_INSTRUMENT_VA(this, file_name, flavor, core_style);
+  SBFileSpec fspec(file_name);
+  SBCoreDumpOptions options;
+  options.SetOutputFile(fspec);
+  options.SetCoreDumpPluginName(flavor);
+  options.SetCoreDumpStyle(core_style);
+  return SaveCore(options);
+}
+
+lldb::SBError SBProcess::SaveCore(SBCoreDumpOptions &options) {
+
+  LLDB_INSTRUMENT_VA(this, options.GetOutputFile(),
+                     options.GetCoreDumpPluginName(),
+                     options.GetCoreDumpStyle());
----------------
Jlalond wrote:

The original source code asked for each individual field, so I kept roughly the same behavior, if we have a way to decompose the object in `INSTUMENT_VA` I would prefer to pass the object as this API will implicitly expand as the options object gains members/options.

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


More information about the lldb-commits mailing list