[Lldb-commits] [PATCH] D125325: Pass plugin_name in SBProcess::SaveCore

Levon Ter-Grigoryan via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 12 01:43:05 PDT 2022


PatriosTheGreat updated this revision to Diff 428880.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125325/new/

https://reviews.llvm.org/D125325

Files:
  lldb/bindings/interface/SBProcess.i
  lldb/include/lldb/API/SBProcess.h
  lldb/source/API/SBProcess.cpp


Index: lldb/source/API/SBProcess.cpp
===================================================================
--- lldb/source/API/SBProcess.cpp
+++ lldb/source/API/SBProcess.cpp
@@ -1138,6 +1138,12 @@
 
 lldb::SBError SBProcess::SaveCore(const char *file_name) {
   LLDB_INSTRUMENT_VA(this, file_name);
+  return SaveCore(file_name, "");
+}
+
+lldb::SBError SBProcess::SaveCore(const char *file_name,
+                                  const char *flavor) {
+  LLDB_INSTRUMENT_VA(this, file_name, flavor);
 
   lldb::SBError error;
   ProcessSP process_sp(GetSP());
@@ -1156,7 +1162,8 @@
 
   FileSpec core_file(file_name);
   SaveCoreStyle core_style = SaveCoreStyle::eSaveCoreFull;
-  error.ref() = PluginManager::SaveCore(process_sp, core_file, core_style, "");
+  error.ref() = PluginManager::SaveCore(process_sp, core_file, core_style,
+                                        flavor);
   return error;
 }
 
Index: lldb/include/lldb/API/SBProcess.h
===================================================================
--- lldb/include/lldb/API/SBProcess.h
+++ lldb/include/lldb/API/SBProcess.h
@@ -337,7 +337,18 @@
 
   bool IsInstrumentationRuntimePresent(InstrumentationRuntimeType type);
 
-  /// Save the state of the process in a core file (or mini dump on Windows).
+  /// Save the state of the process in a core file.
+  ///
+  /// \param[in] file_name - The name of the file to save the core file to.
+  ///
+  /// \param[in] flavor - Specify the flavor of a core file plug-in to save.
+  /// Currently supported flavors include "mach-o" and "minidump"
+  lldb::SBError SaveCore(const char *file_name, const char *flavor);
+
+  /// Save the state of the process with the a flavor that matches the
+  /// current process' main executable (if supported).
+  ///
+  /// \param[in] file_name - The name of the file to save the core file to.
   lldb::SBError SaveCore(const char *file_name);
 
   /// Query the address load_addr and store the details of the memory
Index: lldb/bindings/interface/SBProcess.i
===================================================================
--- lldb/bindings/interface/SBProcess.i
+++ lldb/bindings/interface/SBProcess.i
@@ -397,6 +397,9 @@
     bool
     IsInstrumentationRuntimePresent(lldb::InstrumentationRuntimeType type);
 
+    lldb::SBError
+    SaveCore(const char *file_name, const char *flavor);
+
     lldb::SBError
     SaveCore(const char *file_name);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125325.428880.patch
Type: text/x-patch
Size: 2405 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220512/d061aee7/attachment.bin>


More information about the lldb-commits mailing list