Path: blob/main/contrib/llvm-project/lldb/source/Symbol/SaveCoreOptions.cpp
39587 views
//===-- SaveCoreOptions.cpp -------------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "lldb/Symbol/SaveCoreOptions.h"9#include "lldb/Core/PluginManager.h"1011using namespace lldb;12using namespace lldb_private;1314Status SaveCoreOptions::SetPluginName(const char *name) {15Status error;16if (!name || !name[0]) {17m_plugin_name = std::nullopt;18return error;19}2021if (!PluginManager::IsRegisteredObjectFilePluginName(name)) {22error.SetErrorStringWithFormat(23"plugin name '%s' is not a valid ObjectFile plugin name", name);24return error;25}2627m_plugin_name = name;28return error;29}3031void SaveCoreOptions::SetStyle(lldb::SaveCoreStyle style) { m_style = style; }3233void SaveCoreOptions::SetOutputFile(FileSpec file) { m_file = file; }3435std::optional<std::string> SaveCoreOptions::GetPluginName() const {36return m_plugin_name;37}3839lldb::SaveCoreStyle SaveCoreOptions::GetStyle() const {40return m_style.value_or(lldb::eSaveCoreUnspecified);41}4243const std::optional<lldb_private::FileSpec>44SaveCoreOptions::GetOutputFile() const {45return m_file;46}4748void SaveCoreOptions::Clear() {49m_file = std::nullopt;50m_plugin_name = std::nullopt;51m_style = std::nullopt;52}535455