[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:52 PDT 2024


================
@@ -0,0 +1,59 @@
+//===-- SBCoreDumpOptions.h -------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_API_SBCOREDUMPOPTIONS_H
+#define LLDB_API_SBCOREDUMPOPTIONS_H
+
+#include "lldb/API/SBDefines.h"
+#include "lldb/Symbol/CoreDumpOptions.h"
+
+namespace lldb {
+
+class LLDB_API SBCoreDumpOptions {
+public:
+  SBCoreDumpOptions(const char *filePath);
+  SBCoreDumpOptions(const lldb::SBCoreDumpOptions &rhs);
+  ~SBCoreDumpOptions() = default;
+
+  const SBCoreDumpOptions &operator=(const lldb::SBCoreDumpOptions &rhs);
+
+  /// Set the Core dump plugin name.
+  ///
+  /// \param plugin Name of the object file plugin.
+  void SetCoreDumpPluginName(const char *plugin);
+
+  /// Get the Core dump plugin name, if set.
+  ///
+  /// \return The name of the plugin, or nullopt if not set.
+  const std::optional<const char *> GetCoreDumpPluginName() const;
+
+  /// Set the Core dump style.
+  ///
+  /// \param style The style of the core dump.
+  void SetCoreDumpStyle(lldb::SaveCoreStyle style);
+
+  /// Get the Core dump style, if set.
+  ///
+  /// \return The core dump style, or nullopt if not set.
+  const std::optional<lldb::SaveCoreStyle> GetCoreDumpStyle() const;
----------------
clayborg wrote:

return `lldb::SaveCoreStyle` with no optional. `lldb_private::CoreDumpOptions::GetCoreDumpStyle()` should return a good default value for this, and that will be returned as the result of this function.

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


More information about the lldb-commits mailing list