CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
98 lines
3.2 KiB
C++
98 lines
3.2 KiB
C++
//===-- UserSettingsController.cpp ----------------------------------------===//
|
|
//
|
|
// 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/Core/UserSettingsController.h"
|
|
|
|
#include "lldb/Interpreter/OptionValueProperties.h"
|
|
#include "lldb/Utility/Status.h"
|
|
#include "lldb/Utility/Stream.h"
|
|
|
|
#include <memory>
|
|
|
|
namespace lldb_private {
|
|
class CommandInterpreter;
|
|
}
|
|
namespace lldb_private {
|
|
class ConstString;
|
|
}
|
|
namespace lldb_private {
|
|
class ExecutionContext;
|
|
}
|
|
namespace lldb_private {
|
|
class Property;
|
|
}
|
|
|
|
using namespace lldb;
|
|
using namespace lldb_private;
|
|
|
|
Properties::Properties() = default;
|
|
|
|
Properties::Properties(const lldb::OptionValuePropertiesSP &collection_sp)
|
|
: m_collection_sp(collection_sp) {}
|
|
|
|
Properties::~Properties() = default;
|
|
|
|
lldb::OptionValueSP
|
|
Properties::GetPropertyValue(const ExecutionContext *exe_ctx,
|
|
llvm::StringRef path, Status &error) const {
|
|
return m_collection_sp->GetSubValue(exe_ctx, path, error);
|
|
}
|
|
|
|
Status Properties::SetPropertyValue(const ExecutionContext *exe_ctx,
|
|
VarSetOperationType op,
|
|
llvm::StringRef path,
|
|
llvm::StringRef value) {
|
|
return m_collection_sp->SetSubValue(exe_ctx, op, path, value);
|
|
}
|
|
|
|
void Properties::DumpAllPropertyValues(const ExecutionContext *exe_ctx,
|
|
Stream &strm, uint32_t dump_mask,
|
|
bool is_json) {
|
|
if (is_json) {
|
|
llvm::json::Value json = m_collection_sp->ToJSON(exe_ctx);
|
|
strm << llvm::formatv("{0:2}", json);
|
|
} else
|
|
m_collection_sp->DumpValue(exe_ctx, strm, dump_mask);
|
|
}
|
|
|
|
void Properties::DumpAllDescriptions(CommandInterpreter &interpreter,
|
|
Stream &strm) const {
|
|
strm.PutCString("Top level variables:\n\n");
|
|
|
|
return m_collection_sp->DumpAllDescriptions(interpreter, strm);
|
|
}
|
|
|
|
Status Properties::DumpPropertyValue(const ExecutionContext *exe_ctx,
|
|
Stream &strm,
|
|
llvm::StringRef property_path,
|
|
uint32_t dump_mask, bool is_json) {
|
|
return m_collection_sp->DumpPropertyValue(exe_ctx, strm, property_path,
|
|
dump_mask, is_json);
|
|
}
|
|
|
|
void Properties::Apropos(
|
|
llvm::StringRef keyword, std::vector<const Property *> &matching_properties,
|
|
std::vector<const Property *> &matching_property_paths) const {
|
|
m_collection_sp->Apropos(keyword, matching_properties,
|
|
matching_property_paths);
|
|
}
|
|
|
|
llvm::StringRef Properties::GetExperimentalSettingsName() {
|
|
static constexpr llvm::StringLiteral g_experimental("experimental");
|
|
return g_experimental;
|
|
}
|
|
|
|
bool Properties::IsSettingExperimental(llvm::StringRef setting) {
|
|
if (setting.empty())
|
|
return false;
|
|
|
|
llvm::StringRef experimental = GetExperimentalSettingsName();
|
|
size_t dot_pos = setting.find_first_of('.');
|
|
return setting.take_front(dot_pos) == experimental;
|
|
}
|