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


================
@@ -0,0 +1,45 @@
+//===-- CoreDumpOptions.cpp -------------------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Symbol/CoreDumpOptions.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+void CoreDumpOptions::SetCoreDumpPluginName(const char * name) {
+  m_plugin_name = name;
+}
+
+void CoreDumpOptions::SetCoreDumpStyle(lldb::SaveCoreStyle style) {
+  m_style = style;
+}
+
+void CoreDumpOptions::SetOutputFile(FileSpec file) {
+  m_file = file;
+}
+
+std::optional<std::string> CoreDumpOptions::GetCoreDumpPluginName() const {
+  return m_plugin_name;
+}
+
+lldb::SaveCoreStyle CoreDumpOptions::GetCoreDumpStyle() const {
+  // If unspecified, default to stack only
+  if (m_style == lldb::eSaveCoreUnspecified)
+    return lldb::eSaveCoreStackOnly;
----------------
Jlalond wrote:

@jasonmolenda I think we should keep the default behaviors for this diff (as it's getting fairly big), this does mean we'll need a non const options object being passed around. With the `const-ness` being the only reason I removed the default behaviors.

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


More information about the lldb-commits mailing list