LLDB mainline
OptionGroupArchitecture.cpp
Go to the documentation of this file.
1//===-- OptionGroupArchitecture.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
12
13using namespace lldb;
14using namespace lldb_private;
15
16static constexpr OptionDefinition g_option_table[] = {
18 nullptr, {}, 0, eArgTypeArchitecture,
19 "Specify the architecture for the target."},
20};
21
22llvm::ArrayRef<OptionDefinition> OptionGroupArchitecture::GetDefinitions() {
23 return llvm::ArrayRef(g_option_table);
24}
25
27 ArchSpec &arch) {
29 return arch.IsValid();
30}
31
34 llvm::StringRef option_arg,
35 ExecutionContext *execution_context) {
37 const int short_option = g_option_table[option_idx].short_option;
38
39 switch (short_option) {
40 case 'a':
41 m_arch_str.assign(std::string(option_arg));
42 break;
43
44 default:
45 llvm_unreachable("Unimplemented option");
46 }
47
48 return error;
49}
50
52 ExecutionContext *execution_context) {
53 m_arch_str.clear();
54}
static llvm::raw_ostream & error(Stream &strm)
static constexpr OptionDefinition g_option_table[]
An architecture specification class.
Definition: ArchSpec.h:31
bool IsValid() const
Tests if this ArchSpec is valid.
Definition: ArchSpec.h:348
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override
void OptionParsingStarting(ExecutionContext *execution_context) override
bool GetArchitecture(Platform *platform, ArchSpec &arch)
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
A plug-in interface definition class for debug platform that includes many platform abilities such as...
Definition: Platform.h:74
static ArchSpec GetAugmentedArchSpec(Platform *platform, llvm::StringRef triple)
Augments the triple either with information from platform or the host system (if platform is null).
Definition: Platform.cpp:261
An error handling class.
Definition: Status.h:44
#define LLDB_OPT_SET_1
Definition: lldb-defines.h:111
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
Definition: SBAddress.h:15
@ eArgTypeArchitecture
int short_option
Single character for this option.