LLDB mainline
OptionValueArch.cpp
Go to the documentation of this file.
1//===-- OptionValueArch.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
14#include "lldb/Utility/Args.h"
15#include "lldb/Utility/State.h"
16
17using namespace lldb;
18using namespace lldb_private;
19
21 uint32_t dump_mask) {
22 if (dump_mask & eDumpOptionType)
23 strm.Printf("(%s)", GetTypeAsCString());
24 if (dump_mask & eDumpOptionValue) {
25 if (dump_mask & eDumpOptionType)
26 strm.PutCString(" = ");
27
29 const char *arch_name = m_current_value.GetArchitectureName();
30 if (arch_name)
31 strm.PutCString(arch_name);
32 }
33 }
34}
35
39 switch (op) {
41 Clear();
43 break;
44
47 std::string value_str = value.trim().str();
48 if (m_current_value.SetTriple(value_str.c_str())) {
49 m_value_was_set = true;
51 } else
52 error.SetErrorStringWithFormat("unsupported architecture '%s'",
53 value_str.c_str());
54 break;
55 }
62 break;
63 }
64 return error;
65}
66
68 CompletionRequest &request) {
71 nullptr);
72}
static llvm::raw_ostream & error(Stream &strm)
bool IsValid() const
Tests if this ArchSpec is valid.
Definition: ArchSpec.h:361
bool SetTriple(const llvm::Triple &triple)
Architecture triple setter.
Definition: ArchSpec.cpp:750
const char * GetArchitectureName() const
Returns a static string representing the current architecture.
Definition: ArchSpec.cpp:547
static bool InvokeCommonCompletionCallbacks(CommandInterpreter &interpreter, uint32_t completion_mask, lldb_private::CompletionRequest &request, SearchFilter *searcher)
"lldb/Utility/ArgCompletionRequest.h"
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
void AutoComplete(CommandInterpreter &interpreter, lldb_private::CompletionRequest &request) 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:77
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:107
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:63
A class that represents a running process on the host machine.
VarSetOperationType
Settable state variable types.
Definition: SBAddress.h:15