Files
clang-p2996/lldb/source/Symbol/SaveCoreOptions.cpp
Jacob Lalonde accf5c9bb3 Revert "[LLDB][SBSaveCore] Implement a selectable threadlist for Core… (#102018)
… Options.  (#100443)"

This reverts commit 3e4af61633.

@adrian-prantl FYI

Reverts #100443
2024-08-05 10:17:25 -07:00

54 lines
1.4 KiB
C++

//===-- SaveCoreOptions.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/SaveCoreOptions.h"
#include "lldb/Core/PluginManager.h"
using namespace lldb;
using namespace lldb_private;
Status SaveCoreOptions::SetPluginName(const char *name) {
Status error;
if (!name || !name[0]) {
m_plugin_name = std::nullopt;
return error;
}
if (!PluginManager::IsRegisteredObjectFilePluginName(name)) {
error.SetErrorStringWithFormat(
"plugin name '%s' is not a valid ObjectFile plugin name", name);
return error;
}
m_plugin_name = name;
return error;
}
void SaveCoreOptions::SetStyle(lldb::SaveCoreStyle style) { m_style = style; }
void SaveCoreOptions::SetOutputFile(FileSpec file) { m_file = file; }
std::optional<std::string> SaveCoreOptions::GetPluginName() const {
return m_plugin_name;
}
lldb::SaveCoreStyle SaveCoreOptions::GetStyle() const {
return m_style.value_or(lldb::eSaveCoreUnspecified);
}
const std::optional<lldb_private::FileSpec>
SaveCoreOptions::GetOutputFile() const {
return m_file;
}
void SaveCoreOptions::Clear() {
m_file = std::nullopt;
m_plugin_name = std::nullopt;
m_style = std::nullopt;
}