LLDB mainline
OptionValueFormat.cpp
Go to the documentation of this file.
1//===-- OptionValueFormat.cpp ---------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
10
13#include "lldb/Utility/Stream.h"
14
15using namespace lldb;
16using namespace lldb_private;
17
19 uint32_t dump_mask) {
20 if (dump_mask & eDumpOptionType)
21 strm.Printf("(%s)", GetTypeAsCString());
22 if (dump_mask & eDumpOptionValue) {
23 if (dump_mask & eDumpOptionType)
24 strm.PutCString(" = ");
26 }
27}
28
29llvm::json::Value OptionValueFormat::ToJSON(const ExecutionContext *exe_ctx) {
31}
32
36 switch (op) {
38 Clear();
40 break;
41
44 Format new_format;
45 error = OptionArgParser::ToFormat(value.str().c_str(), new_format, nullptr);
46 if (error.Success()) {
47 m_value_was_set = true;
48 m_current_value = new_format;
50 }
51 } break;
52
59 break;
60 }
61 return error;
62}
static llvm::raw_ostream & error(Stream &strm)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
static const char * GetFormatAsCString(lldb::Format format)
llvm::json::Value ToJSON(const ExecutionContext *exe_ctx) override
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
void DumpValue(const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) override
virtual Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign)
virtual const char * GetTypeAsCString() const
Definition: OptionValue.h:87
An error handling class.
Definition: Status.h:44
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:134
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:65
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
VarSetOperationType
Settable state variable types.
Definition: SBAddress.h:15
Format
Display format definitions.
static Status ToFormat(const char *s, lldb::Format &format, size_t *byte_size_ptr)