File indexing completed on 2026-05-10 08:42:50
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_INTERPRETER_OPTIONARGPARSER_H
0010 #define LLDB_INTERPRETER_OPTIONARGPARSER_H
0011
0012 #include "lldb/lldb-private-types.h"
0013
0014 #include <optional>
0015
0016 namespace lldb_private {
0017
0018 struct OptionArgParser {
0019
0020
0021 static lldb::addr_t ToAddress(const ExecutionContext *exe_ctx,
0022 llvm::StringRef s, lldb::addr_t fail_value,
0023 Status *error_ptr);
0024
0025
0026 static lldb::addr_t ToRawAddress(const ExecutionContext *exe_ctx,
0027 llvm::StringRef s, lldb::addr_t fail_value,
0028 Status *error_ptr);
0029
0030 static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr);
0031
0032 static llvm::Expected<bool> ToBoolean(llvm::StringRef option_name,
0033 llvm::StringRef option_arg);
0034
0035 static char ToChar(llvm::StringRef s, char fail_value, bool *success_ptr);
0036
0037 static int64_t ToOptionEnum(llvm::StringRef s,
0038 const OptionEnumValues &enum_values,
0039 int32_t fail_value, Status &error);
0040
0041 static lldb::ScriptLanguage ToScriptLanguage(llvm::StringRef s,
0042 lldb::ScriptLanguage fail_value,
0043 bool *success_ptr);
0044
0045
0046 static Status ToFormat(const char *s, lldb::Format &format,
0047 size_t *byte_size_ptr);
0048
0049
0050
0051 private:
0052 static std::optional<lldb::addr_t>
0053 DoToAddress(const ExecutionContext *exe_ctx, llvm::StringRef s,
0054 Status *error);
0055 };
0056
0057 }
0058
0059 #endif