1 //===-- OptionGroupUUID.cpp -------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "lldb/Interpreter/OptionGroupUUID.h"
14 // Other libraries and framework includes
16 #include "lldb/Host/OptionParser.h"
19 using namespace lldb_private;
21 OptionGroupUUID::OptionGroupUUID() : m_uuid() {}
23 OptionGroupUUID::~OptionGroupUUID() {}
25 static OptionDefinition g_option_table[] = {
26 {LLDB_OPT_SET_1, false, "uuid", 'u', OptionParser::eRequiredArgument,
27 nullptr, nullptr, 0, eArgTypeNone, "A module UUID value."},
30 llvm::ArrayRef<OptionDefinition> OptionGroupUUID::GetDefinitions() {
31 return llvm::makeArrayRef(g_option_table);
34 Status OptionGroupUUID::SetOptionValue(uint32_t option_idx,
35 llvm::StringRef option_arg,
36 ExecutionContext *execution_context) {
38 const int short_option = g_option_table[option_idx].short_option;
40 switch (short_option) {
42 error = m_uuid.SetValueFromString(option_arg);
44 m_uuid.SetOptionWasSet();
48 error.SetErrorStringWithFormat("unrecognized option '%c'", short_option);
55 void OptionGroupUUID::OptionParsingStarting(
56 ExecutionContext *execution_context) {