[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


================
@@ -0,0 +1,42 @@
+//===-- CoreDumpOptions.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_SOURCE_PLUGINS_OBJECTFILE_COREDUMPOPTIONS_H
+#define LLDB_SOURCE_PLUGINS_OBJECTFILE_COREDUMPOPTIONS_H
+
+#include "lldb/Utility/FileSpec.h"
+#include "lldb/lldb-forward.h"
+#include "lldb/lldb-types.h"
+
+#include <optional>
+#include <string>
+
+namespace lldb_private {
+
+class CoreDumpOptions {
+public:
+  CoreDumpOptions(const lldb_private::FileSpec &fspec)
+      : m_core_dump_file(std::move(fspec)){};
+  ~CoreDumpOptions() = default;
+
+  void SetCoreDumpPluginName(llvm::StringRef name);
+  std::optional<llvm::StringRef> GetCoreDumpPluginName() const;
----------------
clayborg wrote:

return an `std::optional<std::string>` to match how it is stored in the instance variable.

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


More information about the lldb-commits mailing list