File indexing completed on 2026-05-10 08:42:51
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_INTERPRETER_PROPERTY_H
0010 #define LLDB_INTERPRETER_PROPERTY_H
0011
0012 #include "lldb/Interpreter/OptionValue.h"
0013 #include "lldb/Utility/Flags.h"
0014 #include "lldb/lldb-defines.h"
0015 #include "lldb/lldb-private-types.h"
0016
0017 #include <string>
0018
0019 namespace lldb_private {
0020
0021
0022
0023 struct PropertyDefinition {
0024 const char *name;
0025 OptionValue::Type type;
0026 bool global;
0027 uintptr_t default_uint_value;
0028 const char *default_cstr_value;
0029 OptionEnumValues enum_values;
0030 const char *description;
0031 };
0032
0033 using PropertyDefinitions = llvm::ArrayRef<PropertyDefinition>;
0034
0035 class Property {
0036 public:
0037 Property(const PropertyDefinition &definition);
0038
0039 Property(llvm::StringRef name, llvm::StringRef desc, bool is_global,
0040 const lldb::OptionValueSP &value_sp);
0041
0042 llvm::StringRef GetName() const { return m_name; }
0043 llvm::StringRef GetDescription() const { return m_description; }
0044
0045 const lldb::OptionValueSP &GetValue() const { return m_value_sp; }
0046
0047 void SetOptionValue(const lldb::OptionValueSP &value_sp) {
0048 m_value_sp = value_sp;
0049 }
0050
0051 bool IsValid() const { return (bool)m_value_sp; }
0052
0053 bool IsGlobal() const { return m_is_global; }
0054
0055 void Dump(const ExecutionContext *exe_ctx, Stream &strm,
0056 uint32_t dump_mask) const;
0057
0058 bool DumpQualifiedName(Stream &strm) const;
0059
0060 void DumpDescription(CommandInterpreter &interpreter, Stream &strm,
0061 uint32_t output_width,
0062 bool display_qualified_name) const;
0063
0064 void SetValueChangedCallback(std::function<void()> callback);
0065
0066 protected:
0067 std::string m_name;
0068 std::string m_description;
0069 lldb::OptionValueSP m_value_sp;
0070 bool m_is_global;
0071 };
0072
0073 }
0074
0075 #endif