LLDB mainline
OptionGroupUUID.cpp
Go to the documentation of this file.
1//===-- OptionGroupUUID.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
12
13using namespace lldb;
14using namespace lldb_private;
15
16static constexpr OptionDefinition g_option_table[] = {
18 nullptr, {}, 0, eArgTypeModuleUUID, "A module UUID value."},
19};
20
21llvm::ArrayRef<OptionDefinition> OptionGroupUUID::GetDefinitions() {
22 return llvm::ArrayRef(g_option_table);
23}
24
26 llvm::StringRef option_arg,
27 ExecutionContext *execution_context) {
29 const int short_option = g_option_table[option_idx].short_option;
30
31 switch (short_option) {
32 case 'u':
33 error = m_uuid.SetValueFromString(option_arg);
34 if (error.Success())
36 break;
37
38 default:
39 llvm_unreachable("Unimplemented option");
40 }
41
42 return error;
43}
44
46 ExecutionContext *execution_context) {
47 m_uuid.Clear();
48}
static llvm::raw_ostream & error(Stream &strm)
static constexpr OptionDefinition g_option_table[]
static constexpr OptionDefinition g_option_table[]
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
void OptionParsingStarting(ExecutionContext *execution_context) override
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
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: SBAddress.h:15
@ eArgTypeModuleUUID
int short_option
Single character for this option.