Update prebuilt Clang to r365631c1 from Android.
The version we had was segfaulting.
Bug: 132420445
Change-Id: Icb45a6fe0b4e2166f7895e669df1157cec9fb4e0
diff --git a/linux-x64/clang/include/lldb/Interpreter/CommandAlias.h b/linux-x64/clang/include/lldb/Interpreter/CommandAlias.h
new file mode 100644
index 0000000..c2a7a38
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/CommandAlias.h
@@ -0,0 +1,84 @@
+//===-- CommandAlias.h -----------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_CommandAlias_h_
+#define liblldb_CommandAlias_h_
+
+#include <memory>
+
+#include "lldb/Interpreter/CommandObject.h"
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/CompletionRequest.h"
+#include "lldb/lldb-forward.h"
+
+namespace lldb_private {
+class CommandAlias : public CommandObject {
+public:
+ typedef std::unique_ptr<CommandAlias> UniquePointer;
+
+ CommandAlias(CommandInterpreter &interpreter, lldb::CommandObjectSP cmd_sp,
+ llvm::StringRef options_args, llvm::StringRef name,
+ llvm::StringRef help = llvm::StringRef(),
+ llvm::StringRef syntax = llvm::StringRef(), uint32_t flags = 0);
+
+ void GetAliasExpansion(StreamString &help_string) const;
+
+ bool IsValid() const { return m_underlying_command_sp && m_option_args_sp; }
+
+ explicit operator bool() const { return IsValid(); }
+
+ bool WantsRawCommandString() override;
+
+ bool WantsCompletion() override;
+
+ int HandleCompletion(CompletionRequest &request) override;
+
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override;
+
+ Options *GetOptions() override;
+
+ bool IsAlias() override { return true; }
+
+ bool IsDashDashCommand() override;
+
+ llvm::StringRef GetHelp() override;
+
+ llvm::StringRef GetHelpLong() override;
+
+ void SetHelp(llvm::StringRef str) override;
+
+ void SetHelpLong(llvm::StringRef str) override;
+
+ bool Execute(const char *args_string, CommandReturnObject &result) override;
+
+ lldb::CommandObjectSP GetUnderlyingCommand() {
+ return m_underlying_command_sp;
+ }
+ OptionArgVectorSP GetOptionArguments() const { return m_option_args_sp; }
+ const char *GetOptionString() { return m_option_string.c_str(); }
+
+ // this takes an alias - potentially nested (i.e. an alias to an alias) and
+ // expands it all the way to a non-alias command
+ std::pair<lldb::CommandObjectSP, OptionArgVectorSP> Desugar();
+
+protected:
+ bool IsNestedAlias();
+
+private:
+ lldb::CommandObjectSP m_underlying_command_sp;
+ std::string m_option_string;
+ OptionArgVectorSP m_option_args_sp;
+ LazyBool m_is_dashdash_alias;
+ bool m_did_set_help : 1;
+ bool m_did_set_help_long : 1;
+};
+} // namespace lldb_private
+
+#endif // liblldb_CommandAlias_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/CommandCompletions.h b/linux-x64/clang/include/lldb/Interpreter/CommandCompletions.h
new file mode 100644
index 0000000..3d09db5
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/CommandCompletions.h
@@ -0,0 +1,203 @@
+//===-- CommandCompletions.h ------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef lldb_CommandCompletions_h_
+#define lldb_CommandCompletions_h_
+
+#include <set>
+
+#include "lldb/Core/FileSpecList.h"
+#include "lldb/Core/SearchFilter.h"
+#include "lldb/Utility/CompletionRequest.h"
+#include "lldb/Utility/RegularExpression.h"
+#include "lldb/lldb-private.h"
+
+#include "llvm/ADT/Twine.h"
+
+namespace lldb_private {
+class TildeExpressionResolver;
+class CommandCompletions {
+public:
+ // This is the command completion callback that is used to complete the
+ // argument of the option it is bound to (in the OptionDefinition table
+ // below). Return the total number of matches.
+ typedef int (*CompletionCallback)(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ // A search filter to limit the search...
+ lldb_private::SearchFilter *searcher);
+ enum CommonCompletionTypes {
+ eNoCompletion = 0u,
+ eSourceFileCompletion = (1u << 0),
+ eDiskFileCompletion = (1u << 1),
+ eDiskDirectoryCompletion = (1u << 2),
+ eSymbolCompletion = (1u << 3),
+ eModuleCompletion = (1u << 4),
+ eSettingsNameCompletion = (1u << 5),
+ ePlatformPluginCompletion = (1u << 6),
+ eArchitectureCompletion = (1u << 7),
+ eVariablePathCompletion = (1u << 8),
+ // This item serves two purposes. It is the last element in the enum, so
+ // you can add custom enums starting from here in your Option class. Also
+ // if you & in this bit the base code will not process the option.
+ eCustomCompletion = (1u << 9)
+ };
+
+ struct CommonCompletionElement {
+ uint32_t type;
+ CompletionCallback callback;
+ };
+
+ static bool InvokeCommonCompletionCallbacks(
+ CommandInterpreter &interpreter, uint32_t completion_mask,
+ lldb_private::CompletionRequest &request, SearchFilter *searcher);
+
+ // These are the generic completer functions:
+ static int DiskFiles(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
+
+ static int DiskFiles(const llvm::Twine &partial_file_name,
+ StringList &matches, TildeExpressionResolver &Resolver);
+
+ static int DiskDirectories(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher);
+
+ static int DiskDirectories(const llvm::Twine &partial_file_name,
+ StringList &matches,
+ TildeExpressionResolver &Resolver);
+
+ static int SourceFiles(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
+
+ static int Modules(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
+
+ static int Symbols(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
+
+ static int SettingsNames(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
+
+ static int PlatformPluginNames(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher);
+
+ static int ArchitectureNames(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher);
+
+ static int VariablePath(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
+
+ // The Completer class is a convenient base class for building searchers that
+ // go along with the SearchFilter passed to the standard Completer functions.
+ class Completer : public Searcher {
+ public:
+ Completer(CommandInterpreter &interpreter, CompletionRequest &request);
+
+ ~Completer() override;
+
+ CallbackReturn SearchCallback(SearchFilter &filter, SymbolContext &context,
+ Address *addr, bool complete) override = 0;
+
+ lldb::SearchDepth GetDepth() override = 0;
+
+ virtual size_t DoCompletion(SearchFilter *filter) = 0;
+
+ protected:
+ CommandInterpreter &m_interpreter;
+ CompletionRequest &m_request;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(Completer);
+ };
+
+ // SourceFileCompleter implements the source file completer
+ class SourceFileCompleter : public Completer {
+ public:
+ SourceFileCompleter(CommandInterpreter &interpreter,
+ bool include_support_files, CompletionRequest &request);
+
+ lldb::SearchDepth GetDepth() override;
+
+ Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
+ SymbolContext &context,
+ Address *addr,
+ bool complete) override;
+
+ size_t DoCompletion(SearchFilter *filter) override;
+
+ private:
+ bool m_include_support_files;
+ FileSpecList m_matching_files;
+ const char *m_file_name;
+ const char *m_dir_name;
+
+ DISALLOW_COPY_AND_ASSIGN(SourceFileCompleter);
+ };
+
+ // ModuleCompleter implements the module completer
+ class ModuleCompleter : public Completer {
+ public:
+ ModuleCompleter(CommandInterpreter &interpreter,
+ CompletionRequest &request);
+
+ lldb::SearchDepth GetDepth() override;
+
+ Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
+ SymbolContext &context,
+ Address *addr,
+ bool complete) override;
+
+ size_t DoCompletion(SearchFilter *filter) override;
+
+ private:
+ const char *m_file_name;
+ const char *m_dir_name;
+
+ DISALLOW_COPY_AND_ASSIGN(ModuleCompleter);
+ };
+
+ // SymbolCompleter implements the symbol completer
+ class SymbolCompleter : public Completer {
+ public:
+ SymbolCompleter(CommandInterpreter &interpreter,
+ CompletionRequest &request);
+
+ lldb::SearchDepth GetDepth() override;
+
+ Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
+ SymbolContext &context,
+ Address *addr,
+ bool complete) override;
+
+ size_t DoCompletion(SearchFilter *filter) override;
+
+ private:
+ // struct NameCmp {
+ // bool operator() (const ConstString& lhs, const ConstString&
+ // rhs) const
+ // {
+ // return lhs < rhs;
+ // }
+ // };
+
+ RegularExpression m_regex;
+ typedef std::set<ConstString> collection;
+ collection m_match_set;
+
+ DISALLOW_COPY_AND_ASSIGN(SymbolCompleter);
+ };
+
+private:
+ static CommonCompletionElement g_common_completions[];
+};
+
+} // namespace lldb_private
+
+#endif // lldb_CommandCompletions_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/CommandHistory.h b/linux-x64/clang/include/lldb/Interpreter/CommandHistory.h
new file mode 100644
index 0000000..c1386f8
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/CommandHistory.h
@@ -0,0 +1,58 @@
+//===-- CommandHistory.h ----------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_CommandHistory_h_
+#define liblldb_CommandHistory_h_
+
+#include <mutex>
+#include <string>
+#include <vector>
+
+#include "lldb/Utility/Stream.h"
+#include "lldb/lldb-private.h"
+
+namespace lldb_private {
+
+class CommandHistory {
+public:
+ CommandHistory();
+
+ ~CommandHistory();
+
+ size_t GetSize() const;
+
+ bool IsEmpty() const;
+
+ llvm::Optional<llvm::StringRef> FindString(llvm::StringRef input_str) const;
+
+ llvm::StringRef GetStringAtIndex(size_t idx) const;
+
+ llvm::StringRef operator[](size_t idx) const;
+
+ llvm::StringRef GetRecentmostString() const;
+
+ void AppendString(llvm::StringRef str, bool reject_if_dupe = true);
+
+ void Clear();
+
+ void Dump(Stream &stream, size_t start_idx = 0,
+ size_t stop_idx = SIZE_MAX) const;
+
+ static const char g_repeat_char = '!';
+
+private:
+ DISALLOW_COPY_AND_ASSIGN(CommandHistory);
+
+ typedef std::vector<std::string> History;
+ mutable std::recursive_mutex m_mutex;
+ History m_history;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_CommandHistory_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/CommandInterpreter.h b/linux-x64/clang/include/lldb/Interpreter/CommandInterpreter.h
new file mode 100644
index 0000000..c3dd660
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/CommandInterpreter.h
@@ -0,0 +1,606 @@
+//===-- CommandInterpreter.h ------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_CommandInterpreter_h_
+#define liblldb_CommandInterpreter_h_
+
+#include "lldb/Core/Debugger.h"
+#include "lldb/Core/IOHandler.h"
+#include "lldb/Interpreter/CommandAlias.h"
+#include "lldb/Interpreter/CommandHistory.h"
+#include "lldb/Interpreter/CommandObject.h"
+#include "lldb/Interpreter/ScriptInterpreter.h"
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/Broadcaster.h"
+#include "lldb/Utility/CompletionRequest.h"
+#include "lldb/Utility/Event.h"
+#include "lldb/Utility/Log.h"
+#include "lldb/Utility/StringList.h"
+#include "lldb/lldb-forward.h"
+#include "lldb/lldb-private.h"
+#include <mutex>
+
+namespace lldb_private {
+
+class CommandInterpreterRunOptions {
+public:
+ /// Construct a CommandInterpreterRunOptions object. This class is used to
+ /// control all the instances where we run multiple commands, e.g.
+ /// HandleCommands, HandleCommandsFromFile, RunCommandInterpreter.
+ ///
+ /// The meanings of the options in this object are:
+ ///
+ /// \param[in] stop_on_continue
+ /// If \b true, execution will end on the first command that causes the
+ /// process in the execution context to continue. If \b false, we won't
+ /// check the execution status.
+ /// \param[in] stop_on_error
+ /// If \b true, execution will end on the first command that causes an
+ /// error.
+ /// \param[in] stop_on_crash
+ /// If \b true, when a command causes the target to run, and the end of the
+ /// run is a signal or exception, stop executing the commands.
+ /// \param[in] echo_commands
+ /// If \b true, echo the command before executing it. If \b false, execute
+ /// silently.
+ /// \param[in] echo_comments
+ /// If \b true, echo command even if it is a pure comment line. If
+ /// \b false, print no ouput in this case. This setting has an effect only
+ /// if \param echo_commands is \b true.
+ /// \param[in] print_results
+ /// If \b true and the command succeeds, print the results of the command
+ /// after executing it. If \b false, execute silently.
+ /// \param[in] print_errors
+ /// If \b true and the command fails, print the results of the command
+ /// after executing it. If \b false, execute silently.
+ /// \param[in] add_to_history
+ /// If \b true add the commands to the command history. If \b false, don't
+ /// add them.
+ CommandInterpreterRunOptions(LazyBool stop_on_continue,
+ LazyBool stop_on_error, LazyBool stop_on_crash,
+ LazyBool echo_commands, LazyBool echo_comments,
+ LazyBool print_results, LazyBool print_errors,
+ LazyBool add_to_history)
+ : m_stop_on_continue(stop_on_continue), m_stop_on_error(stop_on_error),
+ m_stop_on_crash(stop_on_crash), m_echo_commands(echo_commands),
+ m_echo_comment_commands(echo_comments), m_print_results(print_results),
+ m_print_errors(print_errors), m_add_to_history(add_to_history) {}
+
+ CommandInterpreterRunOptions()
+ : m_stop_on_continue(eLazyBoolCalculate),
+ m_stop_on_error(eLazyBoolCalculate),
+ m_stop_on_crash(eLazyBoolCalculate),
+ m_echo_commands(eLazyBoolCalculate),
+ m_echo_comment_commands(eLazyBoolCalculate),
+ m_print_results(eLazyBoolCalculate), m_print_errors(eLazyBoolCalculate),
+ m_add_to_history(eLazyBoolCalculate) {}
+
+ void SetSilent(bool silent) {
+ LazyBool value = silent ? eLazyBoolNo : eLazyBoolYes;
+
+ m_print_results = value;
+ m_print_errors = value;
+ m_echo_commands = value;
+ m_echo_comment_commands = value;
+ m_add_to_history = value;
+ }
+ // These return the default behaviors if the behavior is not
+ // eLazyBoolCalculate. But I've also left the ivars public since for
+ // different ways of running the interpreter you might want to force
+ // different defaults... In that case, just grab the LazyBool ivars directly
+ // and do what you want with eLazyBoolCalculate.
+ bool GetStopOnContinue() const { return DefaultToNo(m_stop_on_continue); }
+
+ void SetStopOnContinue(bool stop_on_continue) {
+ m_stop_on_continue = stop_on_continue ? eLazyBoolYes : eLazyBoolNo;
+ }
+
+ bool GetStopOnError() const { return DefaultToNo(m_stop_on_error); }
+
+ void SetStopOnError(bool stop_on_error) {
+ m_stop_on_error = stop_on_error ? eLazyBoolYes : eLazyBoolNo;
+ }
+
+ bool GetStopOnCrash() const { return DefaultToNo(m_stop_on_crash); }
+
+ void SetStopOnCrash(bool stop_on_crash) {
+ m_stop_on_crash = stop_on_crash ? eLazyBoolYes : eLazyBoolNo;
+ }
+
+ bool GetEchoCommands() const { return DefaultToYes(m_echo_commands); }
+
+ void SetEchoCommands(bool echo_commands) {
+ m_echo_commands = echo_commands ? eLazyBoolYes : eLazyBoolNo;
+ }
+
+ bool GetEchoCommentCommands() const {
+ return DefaultToYes(m_echo_comment_commands);
+ }
+
+ void SetEchoCommentCommands(bool echo_comments) {
+ m_echo_comment_commands = echo_comments ? eLazyBoolYes : eLazyBoolNo;
+ }
+
+ bool GetPrintResults() const { return DefaultToYes(m_print_results); }
+
+ void SetPrintResults(bool print_results) {
+ m_print_results = print_results ? eLazyBoolYes : eLazyBoolNo;
+ }
+
+ bool GetPrintErrors() const { return DefaultToYes(m_print_errors); }
+
+ void SetPrintErrors(bool print_errors) {
+ m_print_errors = print_errors ? eLazyBoolYes : eLazyBoolNo;
+ }
+
+ bool GetAddToHistory() const { return DefaultToYes(m_add_to_history); }
+
+ void SetAddToHistory(bool add_to_history) {
+ m_add_to_history = add_to_history ? eLazyBoolYes : eLazyBoolNo;
+ }
+
+ LazyBool m_stop_on_continue;
+ LazyBool m_stop_on_error;
+ LazyBool m_stop_on_crash;
+ LazyBool m_echo_commands;
+ LazyBool m_echo_comment_commands;
+ LazyBool m_print_results;
+ LazyBool m_print_errors;
+ LazyBool m_add_to_history;
+
+private:
+ static bool DefaultToYes(LazyBool flag) {
+ switch (flag) {
+ case eLazyBoolNo:
+ return false;
+ default:
+ return true;
+ }
+ }
+
+ static bool DefaultToNo(LazyBool flag) {
+ switch (flag) {
+ case eLazyBoolYes:
+ return true;
+ default:
+ return false;
+ }
+ }
+};
+
+class CommandInterpreter : public Broadcaster,
+ public Properties,
+ public IOHandlerDelegate {
+public:
+ enum {
+ eBroadcastBitThreadShouldExit = (1 << 0),
+ eBroadcastBitResetPrompt = (1 << 1),
+ eBroadcastBitQuitCommandReceived = (1 << 2), // User entered quit
+ eBroadcastBitAsynchronousOutputData = (1 << 3),
+ eBroadcastBitAsynchronousErrorData = (1 << 4)
+ };
+
+ enum ChildrenTruncatedWarningStatus // tristate boolean to manage children
+ // truncation warning
+ { eNoTruncation = 0, // never truncated
+ eUnwarnedTruncation = 1, // truncated but did not notify
+ eWarnedTruncation = 2 // truncated and notified
+ };
+
+ enum CommandTypes {
+ eCommandTypesBuiltin = 0x0001, // native commands such as "frame"
+ eCommandTypesUserDef = 0x0002, // scripted commands
+ eCommandTypesAliases = 0x0004, // aliases such as "po"
+ eCommandTypesHidden = 0x0008, // commands prefixed with an underscore
+ eCommandTypesAllThem = 0xFFFF // all commands
+ };
+
+ CommandInterpreter(Debugger &debugger, bool synchronous_execution);
+
+ ~CommandInterpreter() override;
+
+ // These two functions fill out the Broadcaster interface:
+
+ static ConstString &GetStaticBroadcasterClass();
+
+ ConstString &GetBroadcasterClass() const override {
+ return GetStaticBroadcasterClass();
+ }
+
+ void SourceInitFileCwd(CommandReturnObject &result);
+ void SourceInitFileHome(CommandReturnObject &result);
+
+ bool AddCommand(llvm::StringRef name, const lldb::CommandObjectSP &cmd_sp,
+ bool can_replace);
+
+ bool AddUserCommand(llvm::StringRef name, const lldb::CommandObjectSP &cmd_sp,
+ bool can_replace);
+
+ lldb::CommandObjectSP GetCommandSPExact(llvm::StringRef cmd,
+ bool include_aliases) const;
+
+ CommandObject *GetCommandObject(llvm::StringRef cmd,
+ StringList *matches = nullptr,
+ StringList *descriptions = nullptr) const;
+
+ bool CommandExists(llvm::StringRef cmd) const;
+
+ bool AliasExists(llvm::StringRef cmd) const;
+
+ bool UserCommandExists(llvm::StringRef cmd) const;
+
+ CommandAlias *AddAlias(llvm::StringRef alias_name,
+ lldb::CommandObjectSP &command_obj_sp,
+ llvm::StringRef args_string = llvm::StringRef());
+
+ // Remove a command if it is removable (python or regex command)
+ bool RemoveCommand(llvm::StringRef cmd);
+
+ bool RemoveAlias(llvm::StringRef alias_name);
+
+ bool GetAliasFullName(llvm::StringRef cmd, std::string &full_name) const;
+
+ bool RemoveUser(llvm::StringRef alias_name);
+
+ void RemoveAllUser() { m_user_dict.clear(); }
+
+ const CommandAlias *GetAlias(llvm::StringRef alias_name) const;
+
+ CommandObject *BuildAliasResult(llvm::StringRef alias_name,
+ std::string &raw_input_string,
+ std::string &alias_result,
+ CommandReturnObject &result);
+
+ bool HandleCommand(const char *command_line, LazyBool add_to_history,
+ CommandReturnObject &result,
+ ExecutionContext *override_context = nullptr,
+ bool repeat_on_empty_command = true,
+ bool no_context_switching = false);
+
+ bool WasInterrupted() const;
+
+ /// Execute a list of commands in sequence.
+ ///
+ /// \param[in] commands
+ /// The list of commands to execute.
+ /// \param[in,out] context
+ /// The execution context in which to run the commands. Can be nullptr in
+ /// which case the default
+ /// context will be used.
+ /// \param[in] options
+ /// This object holds the options used to control when to stop, whether to
+ /// execute commands,
+ /// etc.
+ /// \param[out] result
+ /// This is marked as succeeding with no output if all commands execute
+ /// safely,
+ /// and failed with some explanation if we aborted executing the commands
+ /// at some point.
+ void HandleCommands(const StringList &commands, ExecutionContext *context,
+ CommandInterpreterRunOptions &options,
+ CommandReturnObject &result);
+
+ /// Execute a list of commands from a file.
+ ///
+ /// \param[in] file
+ /// The file from which to read in commands.
+ /// \param[in,out] context
+ /// The execution context in which to run the commands. Can be nullptr in
+ /// which case the default
+ /// context will be used.
+ /// \param[in] options
+ /// This object holds the options used to control when to stop, whether to
+ /// execute commands,
+ /// etc.
+ /// \param[out] result
+ /// This is marked as succeeding with no output if all commands execute
+ /// safely,
+ /// and failed with some explanation if we aborted executing the commands
+ /// at some point.
+ void HandleCommandsFromFile(FileSpec &file, ExecutionContext *context,
+ CommandInterpreterRunOptions &options,
+ CommandReturnObject &result);
+
+ CommandObject *GetCommandObjectForCommand(llvm::StringRef &command_line);
+
+ // This handles command line completion. You are given a pointer to the
+ // command string buffer, to the current cursor, and to the end of the string
+ // (in case it is not NULL terminated). You also passed in an StringList
+ // object to fill with the returns. The first element of the array will be
+ // filled with the string that you would need to insert at the cursor point
+ // to complete the cursor point to the longest common matching prefix. If you
+ // want to limit the number of elements returned, set max_return_elements to
+ // the number of elements you want returned. Otherwise set
+ // max_return_elements to -1. If you want to start some way into the match
+ // list, then set match_start_point to the desired start point. Returns: -1
+ // if the completion character should be inserted -2 if the entire command
+ // line should be deleted and replaced with matches.GetStringAtIndex(0)
+ // INT_MAX if the number of matches is > max_return_elements, but it is
+ // expensive to compute. Otherwise, returns the number of matches.
+ //
+ // FIXME: Only max_return_elements == -1 is supported at present.
+ int HandleCompletion(const char *current_line, const char *cursor,
+ const char *last_char, int match_start_point,
+ int max_return_elements, StringList &matches,
+ StringList &descriptions);
+
+ // This version just returns matches, and doesn't compute the substring. It
+ // is here so the Help command can call it for the first argument. It uses
+ // a CompletionRequest for simplicity reasons.
+ int HandleCompletionMatches(CompletionRequest &request);
+
+ int GetCommandNamesMatchingPartialString(const char *cmd_cstr,
+ bool include_aliases,
+ StringList &matches,
+ StringList &descriptions);
+
+ void GetHelp(CommandReturnObject &result,
+ uint32_t types = eCommandTypesAllThem);
+
+ void GetAliasHelp(const char *alias_name, StreamString &help_string);
+
+ void OutputFormattedHelpText(Stream &strm, llvm::StringRef prefix,
+ llvm::StringRef help_text);
+
+ void OutputFormattedHelpText(Stream &stream, llvm::StringRef command_word,
+ llvm::StringRef separator,
+ llvm::StringRef help_text, size_t max_word_len);
+
+ // this mimics OutputFormattedHelpText but it does perform a much simpler
+ // formatting, basically ensuring line alignment. This is only good if you
+ // have some complicated layout for your help text and want as little help as
+ // reasonable in properly displaying it. Most of the times, you simply want
+ // to type some text and have it printed in a reasonable way on screen. If
+ // so, use OutputFormattedHelpText
+ void OutputHelpText(Stream &stream, llvm::StringRef command_word,
+ llvm::StringRef separator, llvm::StringRef help_text,
+ uint32_t max_word_len);
+
+ Debugger &GetDebugger() { return m_debugger; }
+
+ ExecutionContext GetExecutionContext() {
+ const bool thread_and_frame_only_if_stopped = true;
+ return m_exe_ctx_ref.Lock(thread_and_frame_only_if_stopped);
+ }
+
+ void UpdateExecutionContext(ExecutionContext *override_context);
+
+ lldb::PlatformSP GetPlatform(bool prefer_target_platform);
+
+ const char *ProcessEmbeddedScriptCommands(const char *arg);
+
+ void UpdatePrompt(llvm::StringRef prompt);
+
+ bool Confirm(llvm::StringRef message, bool default_answer);
+
+ void LoadCommandDictionary();
+
+ void Initialize();
+
+ void Clear();
+
+ bool HasCommands() const;
+
+ bool HasAliases() const;
+
+ bool HasUserCommands() const;
+
+ bool HasAliasOptions() const;
+
+ void BuildAliasCommandArgs(CommandObject *alias_cmd_obj,
+ const char *alias_name, Args &cmd_args,
+ std::string &raw_input_string,
+ CommandReturnObject &result);
+
+ int GetOptionArgumentPosition(const char *in_string);
+
+ void SkipLLDBInitFiles(bool skip_lldbinit_files) {
+ m_skip_lldbinit_files = skip_lldbinit_files;
+ }
+
+ void SkipAppInitFiles(bool skip_app_init_files) {
+ m_skip_app_init_files = skip_app_init_files;
+ }
+
+ bool GetSynchronous();
+
+ void FindCommandsForApropos(llvm::StringRef word, StringList &commands_found,
+ StringList &commands_help,
+ bool search_builtin_commands,
+ bool search_user_commands,
+ bool search_alias_commands);
+
+ bool GetBatchCommandMode() { return m_batch_command_mode; }
+
+ bool SetBatchCommandMode(bool value) {
+ const bool old_value = m_batch_command_mode;
+ m_batch_command_mode = value;
+ return old_value;
+ }
+
+ void ChildrenTruncated() {
+ if (m_truncation_warning == eNoTruncation)
+ m_truncation_warning = eUnwarnedTruncation;
+ }
+
+ bool TruncationWarningNecessary() {
+ return (m_truncation_warning == eUnwarnedTruncation);
+ }
+
+ void TruncationWarningGiven() { m_truncation_warning = eWarnedTruncation; }
+
+ const char *TruncationWarningText() {
+ return "*** Some of your variables have more members than the debugger "
+ "will show by default. To show all of them, you can either use the "
+ "--show-all-children option to %s or raise the limit by changing "
+ "the target.max-children-count setting.\n";
+ }
+
+ CommandHistory &GetCommandHistory() { return m_command_history; }
+
+ bool IsActive();
+
+ void RunCommandInterpreter(bool auto_handle_events, bool spawn_thread,
+ CommandInterpreterRunOptions &options);
+ void GetLLDBCommandsFromIOHandler(const char *prompt,
+ IOHandlerDelegate &delegate,
+ bool asynchronously, void *baton);
+
+ void GetPythonCommandsFromIOHandler(const char *prompt,
+ IOHandlerDelegate &delegate,
+ bool asynchronously, void *baton);
+
+ const char *GetCommandPrefix();
+
+ // Properties
+ bool GetExpandRegexAliases() const;
+
+ bool GetPromptOnQuit() const;
+
+ void SetPromptOnQuit(bool b);
+
+ bool GetEchoCommands() const;
+ void SetEchoCommands(bool b);
+
+ bool GetEchoCommentCommands() const;
+ void SetEchoCommentCommands(bool b);
+
+ /// Specify if the command interpreter should allow that the user can
+ /// specify a custom exit code when calling 'quit'.
+ void AllowExitCodeOnQuit(bool allow);
+
+ /// Sets the exit code for the quit command.
+ /// \param[in] exit_code
+ /// The exit code that the driver should return on exit.
+ /// \return True if the exit code was successfully set; false if the
+ /// interpreter doesn't allow custom exit codes.
+ /// \see AllowExitCodeOnQuit
+ LLVM_NODISCARD bool SetQuitExitCode(int exit_code);
+
+ /// Returns the exit code that the user has specified when running the
+ /// 'quit' command.
+ /// \param[out] exited
+ /// Set to true if the user has called quit with a custom exit code.
+ int GetQuitExitCode(bool &exited) const;
+
+ void ResolveCommand(const char *command_line, CommandReturnObject &result);
+
+ bool GetStopCmdSourceOnError() const;
+
+ uint32_t GetNumErrors() const { return m_num_errors; }
+
+ bool GetQuitRequested() const { return m_quit_requested; }
+
+ lldb::IOHandlerSP
+ GetIOHandler(bool force_create = false,
+ CommandInterpreterRunOptions *options = nullptr);
+
+ bool GetStoppedForCrash() const { return m_stopped_for_crash; }
+
+ bool GetSpaceReplPrompts() const;
+
+protected:
+ friend class Debugger;
+
+ // IOHandlerDelegate functions
+ void IOHandlerInputComplete(IOHandler &io_handler,
+ std::string &line) override;
+
+ ConstString IOHandlerGetControlSequence(char ch) override {
+ if (ch == 'd')
+ return ConstString("quit\n");
+ return ConstString();
+ }
+
+ bool IOHandlerInterrupt(IOHandler &io_handler) override;
+
+ size_t GetProcessOutput();
+
+ void SetSynchronous(bool value);
+
+ lldb::CommandObjectSP GetCommandSP(llvm::StringRef cmd,
+ bool include_aliases = true,
+ bool exact = true,
+ StringList *matches = nullptr,
+ StringList *descriptions = nullptr) const;
+
+private:
+ Status PreprocessCommand(std::string &command);
+
+ void SourceInitFile(FileSpec file, CommandReturnObject &result);
+
+ // Completely resolves aliases and abbreviations, returning a pointer to the
+ // final command object and updating command_line to the fully substituted
+ // and translated command.
+ CommandObject *ResolveCommandImpl(std::string &command_line,
+ CommandReturnObject &result);
+
+ void FindCommandsForApropos(llvm::StringRef word, StringList &commands_found,
+ StringList &commands_help,
+ CommandObject::CommandMap &command_map);
+
+ // An interruptible wrapper around the stream output
+ void PrintCommandOutput(Stream &stream, llvm::StringRef str);
+
+ bool EchoCommandNonInteractive(llvm::StringRef line,
+ const Flags &io_handler_flags) const;
+
+ // A very simple state machine which models the command handling transitions
+ enum class CommandHandlingState {
+ eIdle,
+ eInProgress,
+ eInterrupted,
+ };
+
+ std::atomic<CommandHandlingState> m_command_state{
+ CommandHandlingState::eIdle};
+
+ int m_iohandler_nesting_level = 0;
+
+ void StartHandlingCommand();
+ void FinishHandlingCommand();
+ bool InterruptCommand();
+
+ Debugger &m_debugger; // The debugger session that this interpreter is
+ // associated with
+ ExecutionContextRef m_exe_ctx_ref; // The current execution context to use
+ // when handling commands
+ bool m_synchronous_execution;
+ bool m_skip_lldbinit_files;
+ bool m_skip_app_init_files;
+ CommandObject::CommandMap m_command_dict; // Stores basic built-in commands
+ // (they cannot be deleted, removed
+ // or overwritten).
+ CommandObject::CommandMap
+ m_alias_dict; // Stores user aliases/abbreviations for commands
+ CommandObject::CommandMap m_user_dict; // Stores user-defined commands
+ CommandHistory m_command_history;
+ std::string m_repeat_command; // Stores the command that will be executed for
+ // an empty command string.
+ lldb::IOHandlerSP m_command_io_handler_sp;
+ char m_comment_char;
+ bool m_batch_command_mode;
+ ChildrenTruncatedWarningStatus m_truncation_warning; // Whether we truncated
+ // children and whether
+ // the user has been told
+ uint32_t m_command_source_depth;
+ std::vector<uint32_t> m_command_source_flags;
+ uint32_t m_num_errors;
+ bool m_quit_requested;
+ bool m_stopped_for_crash;
+
+ // The exit code the user has requested when calling the 'quit' command.
+ // No value means the user hasn't set a custom exit code so far.
+ llvm::Optional<int> m_quit_exit_code;
+ // If the driver is accepts custom exit codes for the 'quit' command.
+ bool m_allow_exit_code = false;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_CommandInterpreter_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/CommandObject.h b/linux-x64/clang/include/lldb/Interpreter/CommandObject.h
new file mode 100644
index 0000000..31f7f12
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/CommandObject.h
@@ -0,0 +1,431 @@
+//===-- CommandObject.h -----------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_CommandObject_h_
+#define liblldb_CommandObject_h_
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include "lldb/Utility/Flags.h"
+
+#include "lldb/Interpreter/CommandCompletions.h"
+#include "lldb/Interpreter/Options.h"
+#include "lldb/Target/ExecutionContext.h"
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/CompletionRequest.h"
+#include "lldb/Utility/StringList.h"
+#include "lldb/lldb-private.h"
+
+namespace lldb_private {
+
+// This function really deals with CommandObjectLists, but we didn't make a
+// CommandObjectList class, so I'm sticking it here. But we really should have
+// such a class. Anyway, it looks up the commands in the map that match the
+// partial string cmd_str, inserts the matches into matches, and returns the
+// number added.
+
+template <typename ValueType>
+int AddNamesMatchingPartialString(
+ const std::map<std::string, ValueType> &in_map, llvm::StringRef cmd_str,
+ StringList &matches, StringList *descriptions = nullptr) {
+ int number_added = 0;
+
+ const bool add_all = cmd_str.empty();
+
+ for (auto iter = in_map.begin(), end = in_map.end(); iter != end; iter++) {
+ if (add_all || (iter->first.find(cmd_str, 0) == 0)) {
+ ++number_added;
+ matches.AppendString(iter->first.c_str());
+ if (descriptions)
+ descriptions->AppendString(iter->second->GetHelp());
+ }
+ }
+
+ return number_added;
+}
+
+template <typename ValueType>
+size_t FindLongestCommandWord(std::map<std::string, ValueType> &dict) {
+ auto end = dict.end();
+ size_t max_len = 0;
+
+ for (auto pos = dict.begin(); pos != end; ++pos) {
+ size_t len = pos->first.size();
+ if (max_len < len)
+ max_len = len;
+ }
+ return max_len;
+}
+
+class CommandObject {
+public:
+ typedef llvm::StringRef(ArgumentHelpCallbackFunction)();
+
+ struct ArgumentHelpCallback {
+ ArgumentHelpCallbackFunction *help_callback;
+ bool self_formatting;
+
+ llvm::StringRef operator()() const { return (*help_callback)(); }
+
+ explicit operator bool() const { return (help_callback != nullptr); }
+ };
+
+ struct ArgumentTableEntry // Entries in the main argument information table
+ {
+ lldb::CommandArgumentType arg_type;
+ const char *arg_name;
+ CommandCompletions::CommonCompletionTypes completion_type;
+ ArgumentHelpCallback help_function;
+ const char *help_text;
+ };
+
+ struct CommandArgumentData // Used to build individual command argument lists
+ {
+ lldb::CommandArgumentType arg_type;
+ ArgumentRepetitionType arg_repetition;
+ uint32_t arg_opt_set_association; // This arg might be associated only with
+ // some particular option set(s).
+ CommandArgumentData()
+ : arg_type(lldb::eArgTypeNone), arg_repetition(eArgRepeatPlain),
+ arg_opt_set_association(LLDB_OPT_SET_ALL) // By default, the arg
+ // associates to all option
+ // sets.
+ {}
+ };
+
+ typedef std::vector<CommandArgumentData>
+ CommandArgumentEntry; // Used to build individual command argument lists
+
+ static ArgumentTableEntry g_arguments_data
+ [lldb::eArgTypeLastArg]; // Main argument information table
+
+ typedef std::map<std::string, lldb::CommandObjectSP> CommandMap;
+
+ CommandObject(CommandInterpreter &interpreter, llvm::StringRef name,
+ llvm::StringRef help = "", llvm::StringRef syntax = "",
+ uint32_t flags = 0);
+
+ virtual ~CommandObject();
+
+ static const char *
+ GetArgumentTypeAsCString(const lldb::CommandArgumentType arg_type);
+
+ static const char *
+ GetArgumentDescriptionAsCString(const lldb::CommandArgumentType arg_type);
+
+ CommandInterpreter &GetCommandInterpreter() { return m_interpreter; }
+ Debugger &GetDebugger();
+
+ virtual llvm::StringRef GetHelp();
+
+ virtual llvm::StringRef GetHelpLong();
+
+ virtual llvm::StringRef GetSyntax();
+
+ llvm::StringRef GetCommandName() const;
+
+ virtual void SetHelp(llvm::StringRef str);
+
+ virtual void SetHelpLong(llvm::StringRef str);
+
+ void SetSyntax(llvm::StringRef str);
+
+ // override this to return true if you want to enable the user to delete the
+ // Command object from the Command dictionary (aliases have their own
+ // deletion scheme, so they do not need to care about this)
+ virtual bool IsRemovable() const { return false; }
+
+ virtual bool IsMultiwordObject() { return false; }
+
+ virtual CommandObjectMultiword *GetAsMultiwordCommand() { return nullptr; }
+
+ virtual bool IsAlias() { return false; }
+
+ // override this to return true if your command is somehow a "dash-dash" form
+ // of some other command (e.g. po is expr -O --); this is a powerful hint to
+ // the help system that one cannot pass options to this command
+ virtual bool IsDashDashCommand() { return false; }
+
+ virtual lldb::CommandObjectSP GetSubcommandSP(llvm::StringRef sub_cmd,
+ StringList *matches = nullptr) {
+ return lldb::CommandObjectSP();
+ }
+
+ virtual CommandObject *GetSubcommandObject(llvm::StringRef sub_cmd,
+ StringList *matches = nullptr) {
+ return nullptr;
+ }
+
+ virtual void AproposAllSubCommands(llvm::StringRef prefix,
+ llvm::StringRef search_word,
+ StringList &commands_found,
+ StringList &commands_help) {}
+
+ void FormatLongHelpText(Stream &output_strm, llvm::StringRef long_help);
+
+ void GenerateHelpText(CommandReturnObject &result);
+
+ virtual void GenerateHelpText(Stream &result);
+
+ // this is needed in order to allow the SBCommand class to transparently try
+ // and load subcommands - it will fail on anything but a multiword command,
+ // but it avoids us doing type checkings and casts
+ virtual bool LoadSubCommand(llvm::StringRef cmd_name,
+ const lldb::CommandObjectSP &command_obj) {
+ return false;
+ }
+
+ virtual bool WantsRawCommandString() = 0;
+
+ // By default, WantsCompletion = !WantsRawCommandString. Subclasses who want
+ // raw command string but desire, for example, argument completion should
+ // override this method to return true.
+ virtual bool WantsCompletion() { return !WantsRawCommandString(); }
+
+ virtual Options *GetOptions();
+
+ static const ArgumentTableEntry *GetArgumentTable();
+
+ static lldb::CommandArgumentType LookupArgumentName(llvm::StringRef arg_name);
+
+ static const ArgumentTableEntry *
+ FindArgumentDataByType(lldb::CommandArgumentType arg_type);
+
+ int GetNumArgumentEntries();
+
+ CommandArgumentEntry *GetArgumentEntryAtIndex(int idx);
+
+ static void GetArgumentHelp(Stream &str, lldb::CommandArgumentType arg_type,
+ CommandInterpreter &interpreter);
+
+ static const char *GetArgumentName(lldb::CommandArgumentType arg_type);
+
+ // Generates a nicely formatted command args string for help command output.
+ // By default, all possible args are taken into account, for example, '<expr
+ // | variable-name>'. This can be refined by passing a second arg specifying
+ // which option set(s) we are interested, which could then, for example,
+ // produce either '<expr>' or '<variable-name>'.
+ void GetFormattedCommandArguments(Stream &str,
+ uint32_t opt_set_mask = LLDB_OPT_SET_ALL);
+
+ bool IsPairType(ArgumentRepetitionType arg_repeat_type);
+
+ bool ParseOptions(Args &args, CommandReturnObject &result);
+
+ void SetCommandName(llvm::StringRef name);
+
+ /// This default version handles calling option argument completions and then
+ /// calls HandleArgumentCompletion if the cursor is on an argument, not an
+ /// option. Don't override this method, override HandleArgumentCompletion
+ /// instead unless you have special reasons.
+ ///
+ /// \param[in/out] request
+ /// The completion request that needs to be answered.
+ ///
+ /// FIXME: This is the wrong return value, since we also need to make a
+ /// distinction between
+ /// total number of matches, and the window the user wants returned.
+ ///
+ /// \return
+ /// \btrue if we were in an option, \bfalse otherwise.
+ virtual int HandleCompletion(CompletionRequest &request);
+
+ /// The input array contains a parsed version of the line. The insertion
+ /// point is given by cursor_index (the index in input of the word containing
+ /// the cursor) and cursor_char_position (the position of the cursor in that
+ /// word.)
+ /// We've constructed the map of options and their arguments as well if that
+ /// is helpful for the completion.
+ ///
+ /// \param[in/out] request
+ /// The completion request that needs to be answered.
+ ///
+ /// FIXME: This is the wrong return value, since we also need to make a
+ /// distinction between
+ /// total number of matches, and the window the user wants returned.
+ ///
+ /// \return
+ /// The number of completions.
+ virtual int
+ HandleArgumentCompletion(CompletionRequest &request,
+ OptionElementVector &opt_element_vector) {
+ return 0;
+ }
+
+ bool HelpTextContainsWord(llvm::StringRef search_word,
+ bool search_short_help = true,
+ bool search_long_help = true,
+ bool search_syntax = true,
+ bool search_options = true);
+
+ /// The flags accessor.
+ ///
+ /// \return
+ /// A reference to the Flags member variable.
+ Flags &GetFlags() { return m_flags; }
+
+ /// The flags const accessor.
+ ///
+ /// \return
+ /// A const reference to the Flags member variable.
+ const Flags &GetFlags() const { return m_flags; }
+
+ /// Get the command that appropriate for a "repeat" of the current command.
+ ///
+ /// \param[in] current_command_line
+ /// The complete current command line.
+ ///
+ /// \return
+ /// nullptr if there is no special repeat command - it will use the
+ /// current command line.
+ /// Otherwise a pointer to the command to be repeated.
+ /// If the returned string is the empty string, the command won't be
+ /// repeated.
+ virtual const char *GetRepeatCommand(Args ¤t_command_args,
+ uint32_t index) {
+ return nullptr;
+ }
+
+ bool HasOverrideCallback() const {
+ return m_command_override_callback ||
+ m_deprecated_command_override_callback;
+ }
+
+ void SetOverrideCallback(lldb::CommandOverrideCallback callback,
+ void *baton) {
+ m_deprecated_command_override_callback = callback;
+ m_command_override_baton = baton;
+ }
+
+ void SetOverrideCallback(lldb::CommandOverrideCallbackWithResult callback,
+ void *baton) {
+ m_command_override_callback = callback;
+ m_command_override_baton = baton;
+ }
+
+ bool InvokeOverrideCallback(const char **argv, CommandReturnObject &result) {
+ if (m_command_override_callback)
+ return m_command_override_callback(m_command_override_baton, argv,
+ result);
+ else if (m_deprecated_command_override_callback)
+ return m_deprecated_command_override_callback(m_command_override_baton,
+ argv);
+ else
+ return false;
+ }
+
+ virtual bool Execute(const char *args_string,
+ CommandReturnObject &result) = 0;
+
+protected:
+ bool ParseOptionsAndNotify(Args &args, CommandReturnObject &result,
+ OptionGroupOptions &group_options,
+ ExecutionContext &exe_ctx);
+
+ virtual const char *GetInvalidTargetDescription() {
+ return "invalid target, create a target using the 'target create' command";
+ }
+
+ virtual const char *GetInvalidProcessDescription() {
+ return "invalid process";
+ }
+
+ virtual const char *GetInvalidThreadDescription() { return "invalid thread"; }
+
+ virtual const char *GetInvalidFrameDescription() { return "invalid frame"; }
+
+ virtual const char *GetInvalidRegContextDescription() {
+ return "invalid frame, no registers";
+ }
+
+ // This is for use in the command interpreter, when you either want the
+ // selected target, or if no target is present you want to prime the dummy
+ // target with entities that will be copied over to new targets.
+ Target *GetSelectedOrDummyTarget(bool prefer_dummy = false);
+ Target *GetDummyTarget();
+
+ // If a command needs to use the "current" thread, use this call. Command
+ // objects will have an ExecutionContext to use, and that may or may not have
+ // a thread in it. If it does, you should use that by default, if not, then
+ // use the ExecutionContext's target's selected thread, etc... This call
+ // insulates you from the details of this calculation.
+ Thread *GetDefaultThread();
+
+ /// Check the command to make sure anything required by this
+ /// command is available.
+ ///
+ /// \param[out] result
+ /// A command result object, if it is not okay to run the command
+ /// this will be filled in with a suitable error.
+ ///
+ /// \return
+ /// \b true if it is okay to run this command, \b false otherwise.
+ bool CheckRequirements(CommandReturnObject &result);
+
+ void Cleanup();
+
+ CommandInterpreter &m_interpreter;
+ ExecutionContext m_exe_ctx;
+ std::unique_lock<std::recursive_mutex> m_api_locker;
+ std::string m_cmd_name;
+ std::string m_cmd_help_short;
+ std::string m_cmd_help_long;
+ std::string m_cmd_syntax;
+ Flags m_flags;
+ std::vector<CommandArgumentEntry> m_arguments;
+ lldb::CommandOverrideCallback m_deprecated_command_override_callback;
+ lldb::CommandOverrideCallbackWithResult m_command_override_callback;
+ void *m_command_override_baton;
+
+ // Helper function to populate IDs or ID ranges as the command argument data
+ // to the specified command argument entry.
+ static void AddIDsArgumentData(CommandArgumentEntry &arg,
+ lldb::CommandArgumentType ID,
+ lldb::CommandArgumentType IDRange);
+};
+
+class CommandObjectParsed : public CommandObject {
+public:
+ CommandObjectParsed(CommandInterpreter &interpreter, const char *name,
+ const char *help = nullptr, const char *syntax = nullptr,
+ uint32_t flags = 0)
+ : CommandObject(interpreter, name, help, syntax, flags) {}
+
+ ~CommandObjectParsed() override = default;
+
+ bool Execute(const char *args_string, CommandReturnObject &result) override;
+
+protected:
+ virtual bool DoExecute(Args &command, CommandReturnObject &result) = 0;
+
+ bool WantsRawCommandString() override { return false; }
+};
+
+class CommandObjectRaw : public CommandObject {
+public:
+ CommandObjectRaw(CommandInterpreter &interpreter, llvm::StringRef name,
+ llvm::StringRef help = "", llvm::StringRef syntax = "",
+ uint32_t flags = 0)
+ : CommandObject(interpreter, name, help, syntax, flags) {}
+
+ ~CommandObjectRaw() override = default;
+
+ bool Execute(const char *args_string, CommandReturnObject &result) override;
+
+protected:
+ virtual bool DoExecute(llvm::StringRef command,
+ CommandReturnObject &result) = 0;
+
+ bool WantsRawCommandString() override { return true; }
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_CommandObject_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/CommandObjectMultiword.h b/linux-x64/clang/include/lldb/Interpreter/CommandObjectMultiword.h
new file mode 100644
index 0000000..660e9d4
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/CommandObjectMultiword.h
@@ -0,0 +1,134 @@
+//===-- CommandObjectMultiword.h --------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_CommandObjectMultiword_h_
+#define liblldb_CommandObjectMultiword_h_
+
+#include "lldb/Interpreter/CommandObject.h"
+#include "lldb/Utility/CompletionRequest.h"
+
+namespace lldb_private {
+
+// CommandObjectMultiword
+
+class CommandObjectMultiword : public CommandObject {
+ // These two want to iterate over the subcommand dictionary.
+ friend class CommandInterpreter;
+ friend class CommandObjectSyntax;
+
+public:
+ CommandObjectMultiword(CommandInterpreter &interpreter, const char *name,
+ const char *help = nullptr,
+ const char *syntax = nullptr, uint32_t flags = 0);
+
+ ~CommandObjectMultiword() override;
+
+ bool IsMultiwordObject() override { return true; }
+
+ CommandObjectMultiword *GetAsMultiwordCommand() override { return this; }
+
+ bool LoadSubCommand(llvm::StringRef cmd_name,
+ const lldb::CommandObjectSP &command_obj) override;
+
+ void GenerateHelpText(Stream &output_stream) override;
+
+ lldb::CommandObjectSP GetSubcommandSP(llvm::StringRef sub_cmd,
+ StringList *matches = nullptr) override;
+
+ CommandObject *GetSubcommandObject(llvm::StringRef sub_cmd,
+ StringList *matches = nullptr) override;
+
+ void AproposAllSubCommands(llvm::StringRef prefix,
+ llvm::StringRef search_word,
+ StringList &commands_found,
+ StringList &commands_help) override;
+
+ bool WantsRawCommandString() override { return false; }
+
+ int HandleCompletion(CompletionRequest &request) override;
+
+ const char *GetRepeatCommand(Args ¤t_command_args,
+ uint32_t index) override;
+
+ bool Execute(const char *args_string, CommandReturnObject &result) override;
+
+ bool IsRemovable() const override { return m_can_be_removed; }
+
+ void SetRemovable(bool removable) { m_can_be_removed = removable; }
+
+protected:
+ CommandObject::CommandMap &GetSubcommandDictionary() {
+ return m_subcommand_dict;
+ }
+
+ CommandObject::CommandMap m_subcommand_dict;
+ bool m_can_be_removed;
+};
+
+class CommandObjectProxy : public CommandObject {
+public:
+ CommandObjectProxy(CommandInterpreter &interpreter, const char *name,
+ const char *help = nullptr, const char *syntax = nullptr,
+ uint32_t flags = 0);
+
+ ~CommandObjectProxy() override;
+
+ // Subclasses must provide a command object that will be transparently used
+ // for this object.
+ virtual CommandObject *GetProxyCommandObject() = 0;
+
+ llvm::StringRef GetHelpLong() override;
+
+ bool IsRemovable() const override;
+
+ bool IsMultiwordObject() override;
+
+ CommandObjectMultiword *GetAsMultiwordCommand() override;
+
+ void GenerateHelpText(Stream &result) override;
+
+ lldb::CommandObjectSP GetSubcommandSP(llvm::StringRef sub_cmd,
+ StringList *matches = nullptr) override;
+
+ CommandObject *GetSubcommandObject(llvm::StringRef sub_cmd,
+ StringList *matches = nullptr) override;
+
+ void AproposAllSubCommands(llvm::StringRef prefix,
+ llvm::StringRef search_word,
+ StringList &commands_found,
+ StringList &commands_help) override;
+
+ bool LoadSubCommand(llvm::StringRef cmd_name,
+ const lldb::CommandObjectSP &command_obj) override;
+
+ bool WantsRawCommandString() override;
+
+ bool WantsCompletion() override;
+
+ Options *GetOptions() override;
+
+ int HandleCompletion(CompletionRequest &request) override;
+
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override;
+
+ const char *GetRepeatCommand(Args ¤t_command_args,
+ uint32_t index) override;
+
+ bool Execute(const char *args_string, CommandReturnObject &result) override;
+
+protected:
+ // These two want to iterate over the subcommand dictionary.
+ friend class CommandInterpreter;
+ friend class CommandObjectSyntax;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_CommandObjectMultiword_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/CommandObjectRegexCommand.h b/linux-x64/clang/include/lldb/Interpreter/CommandObjectRegexCommand.h
new file mode 100644
index 0000000..7f06e26
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/CommandObjectRegexCommand.h
@@ -0,0 +1,59 @@
+//===-- CommandObjectRegexCommand.h -----------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_CommandObjectRegexCommand_h_
+#define liblldb_CommandObjectRegexCommand_h_
+
+#include <list>
+
+#include "lldb/Interpreter/CommandObject.h"
+#include "lldb/Utility/CompletionRequest.h"
+#include "lldb/Utility/RegularExpression.h"
+
+namespace lldb_private {
+
+// CommandObjectRegexCommand
+
+class CommandObjectRegexCommand : public CommandObjectRaw {
+public:
+ CommandObjectRegexCommand(CommandInterpreter &interpreter, llvm::StringRef name,
+ llvm::StringRef help, llvm::StringRef syntax,
+ uint32_t max_matches, uint32_t completion_type_mask,
+ bool is_removable);
+
+ ~CommandObjectRegexCommand() override;
+
+ bool IsRemovable() const override { return m_is_removable; }
+
+ bool AddRegexCommand(const char *re_cstr, const char *command_cstr);
+
+ bool HasRegexEntries() const { return !m_entries.empty(); }
+
+ int HandleCompletion(CompletionRequest &request) override;
+
+protected:
+ bool DoExecute(llvm::StringRef command, CommandReturnObject &result) override;
+
+ struct Entry {
+ RegularExpression regex;
+ std::string command;
+ };
+
+ typedef std::list<Entry> EntryCollection;
+ const uint32_t m_max_matches;
+ const uint32_t m_completion_type_mask;
+ EntryCollection m_entries;
+ bool m_is_removable;
+
+private:
+ DISALLOW_COPY_AND_ASSIGN(CommandObjectRegexCommand);
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_CommandObjectRegexCommand_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/CommandOptionValidators.h b/linux-x64/clang/include/lldb/Interpreter/CommandOptionValidators.h
new file mode 100644
index 0000000..5483c15
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/CommandOptionValidators.h
@@ -0,0 +1,28 @@
+//===-- CommandOptionValidators.h -------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_CommandOptionValidators_h_
+#define liblldb_CommandOptionValidators_h_
+
+#include "lldb/lldb-private-types.h"
+
+namespace lldb_private {
+
+class Platform;
+class ExecutionContext;
+
+class PosixPlatformCommandOptionValidator : public OptionValidator {
+ bool IsValid(Platform &platform,
+ const ExecutionContext &target) const override;
+ const char *ShortConditionString() const override;
+ const char *LongConditionString() const override;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_CommandOptionValidators_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/CommandReturnObject.h b/linux-x64/clang/include/lldb/Interpreter/CommandReturnObject.h
new file mode 100644
index 0000000..a5f6126
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/CommandReturnObject.h
@@ -0,0 +1,177 @@
+//===-- CommandReturnObject.h -----------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_CommandReturnObject_h_
+#define liblldb_CommandReturnObject_h_
+
+#include "lldb/Core/STLUtils.h"
+#include "lldb/Core/StreamFile.h"
+#include "lldb/Utility/StreamString.h"
+#include "lldb/Utility/StreamTee.h"
+#include "lldb/lldb-private.h"
+
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/FormatVariadic.h"
+
+#include <memory>
+
+namespace lldb_private {
+
+class CommandReturnObject {
+public:
+ CommandReturnObject();
+
+ ~CommandReturnObject();
+
+ llvm::StringRef GetOutputData() {
+ lldb::StreamSP stream_sp(m_out_stream.GetStreamAtIndex(eStreamStringIndex));
+ if (stream_sp)
+ return static_pointer_cast<StreamString>(stream_sp)->GetString();
+ return llvm::StringRef();
+ }
+
+ llvm::StringRef GetErrorData() {
+ lldb::StreamSP stream_sp(m_err_stream.GetStreamAtIndex(eStreamStringIndex));
+ if (stream_sp)
+ return static_pointer_cast<StreamString>(stream_sp)->GetString();
+ return llvm::StringRef();
+ }
+
+ Stream &GetOutputStream() {
+ // Make sure we at least have our normal string stream output stream
+ lldb::StreamSP stream_sp(m_out_stream.GetStreamAtIndex(eStreamStringIndex));
+ if (!stream_sp) {
+ stream_sp.reset(new StreamString());
+ m_out_stream.SetStreamAtIndex(eStreamStringIndex, stream_sp);
+ }
+ return m_out_stream;
+ }
+
+ Stream &GetErrorStream() {
+ // Make sure we at least have our normal string stream output stream
+ lldb::StreamSP stream_sp(m_err_stream.GetStreamAtIndex(eStreamStringIndex));
+ if (!stream_sp) {
+ stream_sp.reset(new StreamString());
+ m_err_stream.SetStreamAtIndex(eStreamStringIndex, stream_sp);
+ }
+ return m_err_stream;
+ }
+
+ void SetImmediateOutputFile(FILE *fh, bool transfer_fh_ownership = false) {
+ lldb::StreamSP stream_sp(new StreamFile(fh, transfer_fh_ownership));
+ m_out_stream.SetStreamAtIndex(eImmediateStreamIndex, stream_sp);
+ }
+
+ void SetImmediateErrorFile(FILE *fh, bool transfer_fh_ownership = false) {
+ lldb::StreamSP stream_sp(new StreamFile(fh, transfer_fh_ownership));
+ m_err_stream.SetStreamAtIndex(eImmediateStreamIndex, stream_sp);
+ }
+
+ void SetImmediateOutputStream(const lldb::StreamSP &stream_sp) {
+ m_out_stream.SetStreamAtIndex(eImmediateStreamIndex, stream_sp);
+ }
+
+ void SetImmediateErrorStream(const lldb::StreamSP &stream_sp) {
+ m_err_stream.SetStreamAtIndex(eImmediateStreamIndex, stream_sp);
+ }
+
+ lldb::StreamSP GetImmediateOutputStream() {
+ return m_out_stream.GetStreamAtIndex(eImmediateStreamIndex);
+ }
+
+ lldb::StreamSP GetImmediateErrorStream() {
+ return m_err_stream.GetStreamAtIndex(eImmediateStreamIndex);
+ }
+
+ void Clear();
+
+ void AppendMessage(llvm::StringRef in_string);
+
+ void AppendMessageWithFormat(const char *format, ...)
+ __attribute__((format(printf, 2, 3)));
+
+ void AppendRawWarning(llvm::StringRef in_string);
+
+ void AppendWarning(llvm::StringRef in_string);
+
+ void AppendWarningWithFormat(const char *format, ...)
+ __attribute__((format(printf, 2, 3)));
+
+ void AppendError(llvm::StringRef in_string);
+
+ void AppendRawError(llvm::StringRef in_string);
+
+ void AppendErrorWithFormat(const char *format, ...)
+ __attribute__((format(printf, 2, 3)));
+
+ template <typename... Args>
+ void AppendMessageWithFormatv(const char *format, Args &&... args) {
+ AppendMessage(llvm::formatv(format, std::forward<Args>(args)...).str());
+ }
+
+ template <typename... Args>
+ void AppendWarningWithFormatv(const char *format, Args &&... args) {
+ AppendWarning(llvm::formatv(format, std::forward<Args>(args)...).str());
+ }
+
+ template <typename... Args>
+ void AppendErrorWithFormatv(const char *format, Args &&... args) {
+ AppendError(llvm::formatv(format, std::forward<Args>(args)...).str());
+ }
+
+ void SetError(const Status &error, const char *fallback_error_cstr = nullptr);
+
+ void SetError(llvm::StringRef error_cstr);
+
+ lldb::ReturnStatus GetStatus();
+
+ void SetStatus(lldb::ReturnStatus status);
+
+ bool Succeeded();
+
+ bool HasResult();
+
+ bool GetDidChangeProcessState();
+
+ void SetDidChangeProcessState(bool b);
+
+ bool GetInteractive() const;
+
+ void SetInteractive(bool b);
+
+ bool GetAbnormalStopWasExpected() const {
+ return m_abnormal_stop_was_expected;
+ }
+
+ void SetAbnormalStopWasExpected(bool signal_was_expected) {
+ m_abnormal_stop_was_expected = signal_was_expected;
+ }
+
+private:
+ enum { eStreamStringIndex = 0, eImmediateStreamIndex = 1 };
+
+ StreamTee m_out_stream;
+ StreamTee m_err_stream;
+
+ lldb::ReturnStatus m_status;
+ bool m_did_change_process_state;
+ bool m_interactive; // If true, then the input handle from the debugger will
+ // be hooked up
+ bool m_abnormal_stop_was_expected; // This is to support
+ // eHandleCommandFlagStopOnCrash vrs.
+ // attach.
+ // The attach command often ends up with the process stopped due to a signal.
+ // Normally that would mean stop on crash should halt batch execution, but we
+ // obviously don't want that for attach. Using this flag, the attach command
+ // (and anything else for which this is relevant) can say that the signal is
+ // expected, and batch command execution can continue.
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_CommandReturnObject_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionArgParser.h b/linux-x64/clang/include/lldb/Interpreter/OptionArgParser.h
new file mode 100644
index 0000000..ce901b0
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionArgParser.h
@@ -0,0 +1,42 @@
+//===-- OptionArgParser.h ---------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_INTERPRETER_OPTIONARGPARSER_H
+#define LLDB_INTERPRETER_OPTIONARGPARSER_H
+
+#include "lldb/lldb-private-types.h"
+
+namespace lldb_private {
+
+struct OptionArgParser {
+ static lldb::addr_t ToAddress(const ExecutionContext *exe_ctx,
+ llvm::StringRef s, lldb::addr_t fail_value,
+ Status *error);
+
+ static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr);
+
+ static char ToChar(llvm::StringRef s, char fail_value, bool *success_ptr);
+
+ static int64_t ToOptionEnum(llvm::StringRef s,
+ const OptionEnumValues &enum_values,
+ int32_t fail_value, Status &error);
+
+ static lldb::ScriptLanguage ToScriptLanguage(llvm::StringRef s,
+ lldb::ScriptLanguage fail_value,
+ bool *success_ptr);
+
+ // TODO: Use StringRef
+ static Status ToFormat(const char *s, lldb::Format &format,
+ size_t *byte_size_ptr); // If non-NULL, then a
+ // byte size can precede
+ // the format character
+};
+
+} // namespace lldb_private
+
+#endif // LLDB_INTERPRETER_OPTIONARGPARSER_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupArchitecture.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupArchitecture.h
new file mode 100644
index 0000000..4b7f9fe
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupArchitecture.h
@@ -0,0 +1,45 @@
+//===-- OptionGroupArchitecture.h -------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionGroupArchitecture_h_
+#define liblldb_OptionGroupArchitecture_h_
+
+#include "lldb/Interpreter/Options.h"
+#include "lldb/Utility/ArchSpec.h"
+
+namespace lldb_private {
+
+// OptionGroupArchitecture
+
+class OptionGroupArchitecture : public OptionGroup {
+public:
+ OptionGroupArchitecture();
+
+ ~OptionGroupArchitecture() override;
+
+ llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
+
+ 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);
+
+ bool ArchitectureWasSpecified() const { return !m_arch_str.empty(); }
+
+ llvm::StringRef GetArchitectureName() const { return m_arch_str; }
+
+protected:
+ std::string m_arch_str; // Save the arch triple in case a platform is
+ // specified after the architecture
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionGroupArchitecture_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupBoolean.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupBoolean.h
new file mode 100644
index 0000000..7749045
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupBoolean.h
@@ -0,0 +1,51 @@
+//===-- OptionGroupBoolean.h ------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionGroupBoolean_h_
+#define liblldb_OptionGroupBoolean_h_
+
+#include "lldb/Interpreter/OptionValueBoolean.h"
+#include "lldb/Interpreter/Options.h"
+
+namespace lldb_private {
+// OptionGroupBoolean
+
+class OptionGroupBoolean : public OptionGroup {
+public:
+ // When 'no_argument_toggle_default' is true, then setting the option value
+ // does NOT require an argument, it sets the boolean value to the inverse of
+ // the default value
+ OptionGroupBoolean(uint32_t usage_mask, bool required,
+ const char *long_option, int short_option,
+ const char *usage_text, bool default_value,
+ bool no_argument_toggle_default);
+
+ ~OptionGroupBoolean() override;
+
+ llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
+ return llvm::ArrayRef<OptionDefinition>(&m_option_definition, 1);
+ }
+
+ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
+ ExecutionContext *execution_context) override;
+ Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
+
+ void OptionParsingStarting(ExecutionContext *execution_context) override;
+
+ OptionValueBoolean &GetOptionValue() { return m_value; }
+
+ const OptionValueBoolean &GetOptionValue() const { return m_value; }
+
+protected:
+ OptionValueBoolean m_value;
+ OptionDefinition m_option_definition;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionGroupBoolean_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupFile.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupFile.h
new file mode 100644
index 0000000..cce3714
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupFile.h
@@ -0,0 +1,81 @@
+//===-- OptionGroupFile.h ---------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionGroupFile_h_
+#define liblldb_OptionGroupFile_h_
+
+#include "lldb/Interpreter/OptionValueFileSpec.h"
+#include "lldb/Interpreter/OptionValueFileSpecList.h"
+#include "lldb/Interpreter/Options.h"
+
+namespace lldb_private {
+
+// OptionGroupFile
+
+class OptionGroupFile : public OptionGroup {
+public:
+ OptionGroupFile(uint32_t usage_mask, bool required, const char *long_option,
+ int short_option, uint32_t completion_type,
+ lldb::CommandArgumentType argument_type,
+ const char *usage_text);
+
+ ~OptionGroupFile() override;
+
+ llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
+ return llvm::ArrayRef<OptionDefinition>(&m_option_definition, 1);
+ }
+
+ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
+ ExecutionContext *execution_context) override;
+ Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
+
+ void OptionParsingStarting(ExecutionContext *execution_context) override;
+
+ OptionValueFileSpec &GetOptionValue() { return m_file; }
+
+ const OptionValueFileSpec &GetOptionValue() const { return m_file; }
+
+protected:
+ OptionValueFileSpec m_file;
+ OptionDefinition m_option_definition;
+};
+
+// OptionGroupFileList
+
+class OptionGroupFileList : public OptionGroup {
+public:
+ OptionGroupFileList(uint32_t usage_mask, bool required,
+ const char *long_option, int short_option,
+ uint32_t completion_type,
+ lldb::CommandArgumentType argument_type,
+ const char *usage_text);
+
+ ~OptionGroupFileList() override;
+
+ llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
+ return llvm::ArrayRef<OptionDefinition>(&m_option_definition, 1);
+ }
+
+ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
+ ExecutionContext *execution_context) override;
+ Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
+
+ void OptionParsingStarting(ExecutionContext *execution_context) override;
+
+ OptionValueFileSpecList &GetOptionValue() { return m_file_list; }
+
+ const OptionValueFileSpecList &GetOptionValue() const { return m_file_list; }
+
+protected:
+ OptionValueFileSpecList m_file_list;
+ OptionDefinition m_option_definition;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionGroupFile_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupFormat.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupFormat.h
new file mode 100644
index 0000000..1b5020a
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupFormat.h
@@ -0,0 +1,81 @@
+//===-- OptionGroupFormat.h -------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionGroupFormat_h_
+#define liblldb_OptionGroupFormat_h_
+
+#include "lldb/Interpreter/OptionValueFormat.h"
+#include "lldb/Interpreter/OptionValueSInt64.h"
+#include "lldb/Interpreter/OptionValueUInt64.h"
+#include "lldb/Interpreter/Options.h"
+
+namespace lldb_private {
+
+// OptionGroupFormat
+
+class OptionGroupFormat : public OptionGroup {
+public:
+ static const uint32_t OPTION_GROUP_FORMAT = LLDB_OPT_SET_1;
+ static const uint32_t OPTION_GROUP_GDB_FMT = LLDB_OPT_SET_2;
+ static const uint32_t OPTION_GROUP_SIZE = LLDB_OPT_SET_3;
+ static const uint32_t OPTION_GROUP_COUNT = LLDB_OPT_SET_4;
+
+ OptionGroupFormat(
+ lldb::Format default_format,
+ uint64_t default_byte_size =
+ UINT64_MAX, // Pass UINT64_MAX to disable the "--size" option
+ uint64_t default_count =
+ UINT64_MAX); // Pass UINT64_MAX to disable the "--count" option
+
+ ~OptionGroupFormat() override;
+
+ llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
+
+ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
+ ExecutionContext *execution_context) override;
+ Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
+
+ void OptionParsingStarting(ExecutionContext *execution_context) override;
+
+ lldb::Format GetFormat() const { return m_format.GetCurrentValue(); }
+
+ OptionValueFormat &GetFormatValue() { return m_format; }
+
+ const OptionValueFormat &GetFormatValue() const { return m_format; }
+
+ OptionValueUInt64 &GetByteSizeValue() { return m_byte_size; }
+
+ const OptionValueUInt64 &GetByteSizeValue() const { return m_byte_size; }
+
+ OptionValueUInt64 &GetCountValue() { return m_count; }
+
+ const OptionValueUInt64 &GetCountValue() const { return m_count; }
+
+ bool HasGDBFormat() const { return m_has_gdb_format; }
+
+ bool AnyOptionWasSet() const {
+ return m_format.OptionWasSet() || m_byte_size.OptionWasSet() ||
+ m_count.OptionWasSet();
+ }
+
+protected:
+ bool ParserGDBFormatLetter(ExecutionContext *execution_context,
+ char format_letter, lldb::Format &format,
+ uint32_t &byte_size);
+
+ OptionValueFormat m_format;
+ OptionValueUInt64 m_byte_size;
+ OptionValueUInt64 m_count;
+ char m_prev_gdb_format;
+ char m_prev_gdb_size;
+ bool m_has_gdb_format;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionGroupFormat_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupOutputFile.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupOutputFile.h
new file mode 100644
index 0000000..82d68b7
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupOutputFile.h
@@ -0,0 +1,48 @@
+//===-- OptionGroupOutputFile.h ---------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionGroupOutputFile_h_
+#define liblldb_OptionGroupOutputFile_h_
+
+#include "lldb/Interpreter/OptionValueBoolean.h"
+#include "lldb/Interpreter/OptionValueFileSpec.h"
+#include "lldb/Interpreter/Options.h"
+
+namespace lldb_private {
+// OptionGroupOutputFile
+
+class OptionGroupOutputFile : public OptionGroup {
+public:
+ OptionGroupOutputFile();
+
+ ~OptionGroupOutputFile() override;
+
+ llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
+
+ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
+ ExecutionContext *execution_context) override;
+ Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
+
+ void OptionParsingStarting(ExecutionContext *execution_context) override;
+
+ const OptionValueFileSpec &GetFile() { return m_file; }
+
+ const OptionValueBoolean &GetAppend() { return m_append; }
+
+ bool AnyOptionWasSet() const {
+ return m_file.OptionWasSet() || m_append.OptionWasSet();
+ }
+
+protected:
+ OptionValueFileSpec m_file;
+ OptionValueBoolean m_append;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionGroupOutputFile_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupPlatform.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupPlatform.h
new file mode 100644
index 0000000..ea5a3f3
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupPlatform.h
@@ -0,0 +1,73 @@
+//===-- OptionGroupPlatform.h -----------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionGroupPlatform_h_
+#define liblldb_OptionGroupPlatform_h_
+
+#include "lldb/Interpreter/Options.h"
+#include "lldb/Utility/ConstString.h"
+#include "llvm/Support/VersionTuple.h"
+
+namespace lldb_private {
+
+// PlatformOptionGroup
+//
+// Make platform options available to any commands that need the settings.
+class OptionGroupPlatform : public OptionGroup {
+public:
+ OptionGroupPlatform(bool include_platform_option)
+ : OptionGroup(), m_platform_name(), m_sdk_sysroot(),
+ m_include_platform_option(include_platform_option) {}
+
+ ~OptionGroupPlatform() override = default;
+
+ llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
+
+ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
+ ExecutionContext *execution_context) override;
+ Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
+
+ void OptionParsingStarting(ExecutionContext *execution_context) override;
+
+ lldb::PlatformSP CreatePlatformWithOptions(CommandInterpreter &interpreter,
+ const ArchSpec &arch,
+ bool make_selected, Status &error,
+ ArchSpec &platform_arch) const;
+
+ bool PlatformWasSpecified() const { return !m_platform_name.empty(); }
+
+ void SetPlatformName(const char *platform_name) {
+ if (platform_name && platform_name[0])
+ m_platform_name.assign(platform_name);
+ else
+ m_platform_name.clear();
+ }
+
+ ConstString GetSDKRootDirectory() const { return m_sdk_sysroot; }
+
+ void SetSDKRootDirectory(ConstString sdk_root_directory) {
+ m_sdk_sysroot = sdk_root_directory;
+ }
+
+ ConstString GetSDKBuild() const { return m_sdk_build; }
+
+ void SetSDKBuild(ConstString sdk_build) { m_sdk_build = sdk_build; }
+
+ bool PlatformMatches(const lldb::PlatformSP &platform_sp) const;
+
+protected:
+ std::string m_platform_name;
+ ConstString m_sdk_sysroot;
+ ConstString m_sdk_build;
+ llvm::VersionTuple m_os_version;
+ bool m_include_platform_option;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionGroupPlatform_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupString.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupString.h
new file mode 100644
index 0000000..ce10589
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupString.h
@@ -0,0 +1,48 @@
+//===-- OptionGroupString.h -------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionGroupString_h_
+#define liblldb_OptionGroupString_h_
+
+#include "lldb/Interpreter/OptionValueString.h"
+#include "lldb/Interpreter/Options.h"
+
+namespace lldb_private {
+// OptionGroupString
+
+class OptionGroupString : public OptionGroup {
+public:
+ OptionGroupString(uint32_t usage_mask, bool required, const char *long_option,
+ int short_option, uint32_t completion_type,
+ lldb::CommandArgumentType argument_type,
+ const char *usage_text, const char *default_value);
+
+ ~OptionGroupString() override;
+
+ llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
+ return llvm::ArrayRef<OptionDefinition>(&m_option_definition, 1);
+ }
+
+ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
+ ExecutionContext *execution_context) override;
+ Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
+
+ void OptionParsingStarting(ExecutionContext *execution_context) override;
+
+ OptionValueString &GetOptionValue() { return m_value; }
+
+ const OptionValueString &GetOptionValue() const { return m_value; }
+
+protected:
+ OptionValueString m_value;
+ OptionDefinition m_option_definition;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionGroupString_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupUInt64.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupUInt64.h
new file mode 100644
index 0000000..12f08a3
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupUInt64.h
@@ -0,0 +1,49 @@
+//===-- OptionGroupUInt64.h -------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionGroupUInt64_h_
+#define liblldb_OptionGroupUInt64_h_
+
+#include "lldb/Interpreter/OptionValueUInt64.h"
+#include "lldb/Interpreter/Options.h"
+
+namespace lldb_private {
+
+// OptionGroupUInt64
+
+class OptionGroupUInt64 : public OptionGroup {
+public:
+ OptionGroupUInt64(uint32_t usage_mask, bool required, const char *long_option,
+ int short_option, uint32_t completion_type,
+ lldb::CommandArgumentType argument_type,
+ const char *usage_text, uint64_t default_value);
+
+ ~OptionGroupUInt64() override;
+
+ llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
+ return llvm::ArrayRef<OptionDefinition>(&m_option_definition, 1);
+ }
+
+ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
+ ExecutionContext *execution_context) override;
+ Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
+
+ void OptionParsingStarting(ExecutionContext *execution_context) override;
+
+ OptionValueUInt64 &GetOptionValue() { return m_value; }
+
+ const OptionValueUInt64 &GetOptionValue() const { return m_value; }
+
+protected:
+ OptionValueUInt64 m_value;
+ OptionDefinition m_option_definition;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionGroupUInt64_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupUUID.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupUUID.h
new file mode 100644
index 0000000..22fc3a1
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupUUID.h
@@ -0,0 +1,41 @@
+//===-- OptionGroupUUID.h ---------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionGroupUUID_h_
+#define liblldb_OptionGroupUUID_h_
+
+#include "lldb/Interpreter/OptionValueUUID.h"
+#include "lldb/Interpreter/Options.h"
+
+namespace lldb_private {
+
+// OptionGroupUUID
+
+class OptionGroupUUID : public OptionGroup {
+public:
+ OptionGroupUUID();
+
+ ~OptionGroupUUID() override;
+
+ llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
+
+ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
+ ExecutionContext *execution_context) override;
+ Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
+
+ void OptionParsingStarting(ExecutionContext *execution_context) override;
+
+ const OptionValueUUID &GetOptionValue() const { return m_uuid; }
+
+protected:
+ OptionValueUUID m_uuid;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionGroupUUID_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h
new file mode 100644
index 0000000..5a1bbc9
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h
@@ -0,0 +1,58 @@
+//===-- OptionGroupValueObjectDisplay.h -------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionGroupValueObjectDisplay_h_
+#define liblldb_OptionGroupValueObjectDisplay_h_
+
+#include "lldb/Core/ValueObject.h"
+#include "lldb/Interpreter/Options.h"
+
+namespace lldb_private {
+
+// OptionGroupValueObjectDisplay
+
+class OptionGroupValueObjectDisplay : public OptionGroup {
+public:
+ OptionGroupValueObjectDisplay();
+
+ ~OptionGroupValueObjectDisplay() override;
+
+ llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
+
+ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
+ ExecutionContext *execution_context) override;
+ Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
+
+ void OptionParsingStarting(ExecutionContext *execution_context) override;
+
+ bool AnyOptionWasSet() const {
+ return show_types || no_summary_depth != 0 || show_location ||
+ flat_output || use_objc || max_depth != UINT32_MAX ||
+ ptr_depth != 0 || !use_synth || be_raw || ignore_cap ||
+ run_validator;
+ }
+
+ DumpValueObjectOptions GetAsDumpOptions(
+ LanguageRuntimeDescriptionDisplayVerbosity lang_descr_verbosity =
+ eLanguageRuntimeDescriptionDisplayVerbosityFull,
+ lldb::Format format = lldb::eFormatDefault,
+ lldb::TypeSummaryImplSP summary_sp = lldb::TypeSummaryImplSP());
+
+ bool show_types : 1, show_location : 1, flat_output : 1, use_objc : 1,
+ use_synth : 1, be_raw : 1, ignore_cap : 1, run_validator : 1;
+
+ uint32_t no_summary_depth;
+ uint32_t max_depth;
+ uint32_t ptr_depth;
+ uint32_t elem_count;
+ lldb::DynamicValueType use_dynamic;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionGroupValueObjectDisplay_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupVariable.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupVariable.h
new file mode 100644
index 0000000..0c042f4
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupVariable.h
@@ -0,0 +1,49 @@
+//===-- OptionGroupVariable.h -----------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionGroupVariable_h_
+#define liblldb_OptionGroupVariable_h_
+
+#include "lldb/Interpreter/OptionValueString.h"
+#include "lldb/Interpreter/Options.h"
+
+namespace lldb_private {
+
+// OptionGroupVariable
+
+class OptionGroupVariable : public OptionGroup {
+public:
+ OptionGroupVariable(bool show_frame_options);
+
+ ~OptionGroupVariable() override;
+
+ llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
+
+ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
+ ExecutionContext *execution_context) override;
+ Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
+
+ void OptionParsingStarting(ExecutionContext *execution_context) override;
+
+ bool include_frame_options : 1,
+ show_args : 1, // Frame option only (include_frame_options == true)
+ show_recognized_args : 1, // Frame option only (include_frame_options ==
+ // true)
+ show_locals : 1, // Frame option only (include_frame_options == true)
+ show_globals : 1, // Frame option only (include_frame_options == true)
+ use_regex : 1, show_scope : 1, show_decl : 1;
+ OptionValueString summary; // the name of a named summary
+ OptionValueString summary_string; // a summary string
+
+private:
+ DISALLOW_COPY_AND_ASSIGN(OptionGroupVariable);
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionGroupVariable_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupWatchpoint.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupWatchpoint.h
new file mode 100644
index 0000000..3729c00
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupWatchpoint.h
@@ -0,0 +1,54 @@
+//===-- OptionGroupWatchpoint.h ---------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionGroupWatchpoint_h_
+#define liblldb_OptionGroupWatchpoint_h_
+
+#include "lldb/Interpreter/Options.h"
+
+namespace lldb_private {
+
+// OptionGroupWatchpoint
+
+class OptionGroupWatchpoint : public OptionGroup {
+public:
+ OptionGroupWatchpoint();
+
+ ~OptionGroupWatchpoint() override;
+
+ static bool IsWatchSizeSupported(uint32_t watch_size);
+
+ llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
+
+ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
+ ExecutionContext *execution_context) override;
+ Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
+
+ void OptionParsingStarting(ExecutionContext *execution_context) override;
+
+ // Note:
+ // eWatchRead == LLDB_WATCH_TYPE_READ; and
+ // eWatchWrite == LLDB_WATCH_TYPE_WRITE
+ enum WatchType {
+ eWatchInvalid = 0,
+ eWatchRead,
+ eWatchWrite,
+ eWatchReadWrite
+ };
+
+ WatchType watch_type;
+ uint32_t watch_size;
+ bool watch_type_specified;
+
+private:
+ DISALLOW_COPY_AND_ASSIGN(OptionGroupWatchpoint);
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionGroupWatchpoint_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValue.h b/linux-x64/clang/include/lldb/Interpreter/OptionValue.h
new file mode 100644
index 0000000..0b85bc1
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValue.h
@@ -0,0 +1,337 @@
+//===-- OptionValue.h -------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValue_h_
+#define liblldb_OptionValue_h_
+
+#include "lldb/Core/FormatEntity.h"
+#include "lldb/Utility/CompletionRequest.h"
+#include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/Status.h"
+#include "lldb/lldb-defines.h"
+#include "lldb/lldb-private-enumerations.h"
+#include "lldb/lldb-private-interfaces.h"
+
+namespace lldb_private {
+
+// OptionValue
+class OptionValue {
+public:
+ enum Type {
+ eTypeInvalid = 0,
+ eTypeArch,
+ eTypeArgs,
+ eTypeArray,
+ eTypeBoolean,
+ eTypeChar,
+ eTypeDictionary,
+ eTypeEnum,
+ eTypeFileSpec,
+ eTypeFileSpecList,
+ eTypeFormat,
+ eTypeLanguage,
+ eTypePathMap,
+ eTypeProperties,
+ eTypeRegex,
+ eTypeSInt64,
+ eTypeString,
+ eTypeUInt64,
+ eTypeUUID,
+ eTypeFormatEntity
+ };
+
+ enum {
+ eDumpOptionName = (1u << 0),
+ eDumpOptionType = (1u << 1),
+ eDumpOptionValue = (1u << 2),
+ eDumpOptionDescription = (1u << 3),
+ eDumpOptionRaw = (1u << 4),
+ eDumpOptionCommand = (1u << 5),
+ eDumpGroupValue = (eDumpOptionName | eDumpOptionType | eDumpOptionValue),
+ eDumpGroupHelp =
+ (eDumpOptionName | eDumpOptionType | eDumpOptionDescription),
+ eDumpGroupExport = (eDumpOptionCommand | eDumpOptionName | eDumpOptionValue)
+ };
+
+ OptionValue()
+ : m_callback(nullptr), m_baton(nullptr), m_value_was_set(false) {}
+
+ OptionValue(const OptionValue &rhs)
+ : m_callback(rhs.m_callback), m_baton(rhs.m_baton),
+ m_value_was_set(rhs.m_value_was_set) {}
+
+ virtual ~OptionValue() = default;
+
+ // Subclasses should override these functions
+ virtual Type GetType() const = 0;
+
+ // If this value is always hidden, the avoid showing any info on this value,
+ // just show the info for the child values.
+ virtual bool ValueIsTransparent() const {
+ return GetType() == eTypeProperties;
+ }
+
+ virtual const char *GetTypeAsCString() const {
+ return GetBuiltinTypeAsCString(GetType());
+ }
+
+ static const char *GetBuiltinTypeAsCString(Type t);
+
+ virtual void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) = 0;
+
+ virtual Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign);
+
+ virtual bool Clear() = 0;
+
+ virtual lldb::OptionValueSP DeepCopy() const = 0;
+
+ virtual size_t AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request);
+
+ // Subclasses can override these functions
+ virtual lldb::OptionValueSP GetSubValue(const ExecutionContext *exe_ctx,
+ llvm::StringRef name,
+ bool will_modify,
+ Status &error) const {
+ error.SetErrorStringWithFormat("'%s' is not a value subvalue", name.str().c_str());
+ return lldb::OptionValueSP();
+ }
+
+ virtual Status SetSubValue(const ExecutionContext *exe_ctx,
+ VarSetOperationType op, llvm::StringRef name,
+ llvm::StringRef value);
+
+ virtual bool IsAggregateValue() const { return false; }
+
+ virtual ConstString GetName() const { return ConstString(); }
+
+ virtual bool DumpQualifiedName(Stream &strm) const;
+
+ // Subclasses should NOT override these functions as they use the above
+ // functions to implement functionality
+ uint32_t GetTypeAsMask() { return 1u << GetType(); }
+
+ static uint32_t ConvertTypeToMask(OptionValue::Type type) {
+ return 1u << type;
+ }
+
+ static OptionValue::Type ConvertTypeMaskToType(uint32_t type_mask) {
+ // If only one bit is set, then return an appropriate enumeration
+ switch (type_mask) {
+ case 1u << eTypeArch:
+ return eTypeArch;
+ case 1u << eTypeArgs:
+ return eTypeArgs;
+ case 1u << eTypeArray:
+ return eTypeArray;
+ case 1u << eTypeBoolean:
+ return eTypeBoolean;
+ case 1u << eTypeChar:
+ return eTypeChar;
+ case 1u << eTypeDictionary:
+ return eTypeDictionary;
+ case 1u << eTypeEnum:
+ return eTypeEnum;
+ case 1u << eTypeFileSpec:
+ return eTypeFileSpec;
+ case 1u << eTypeFileSpecList:
+ return eTypeFileSpecList;
+ case 1u << eTypeFormat:
+ return eTypeFormat;
+ case 1u << eTypeLanguage:
+ return eTypeLanguage;
+ case 1u << eTypePathMap:
+ return eTypePathMap;
+ case 1u << eTypeProperties:
+ return eTypeProperties;
+ case 1u << eTypeRegex:
+ return eTypeRegex;
+ case 1u << eTypeSInt64:
+ return eTypeSInt64;
+ case 1u << eTypeString:
+ return eTypeString;
+ case 1u << eTypeUInt64:
+ return eTypeUInt64;
+ case 1u << eTypeUUID:
+ return eTypeUUID;
+ }
+ // Else return invalid
+ return eTypeInvalid;
+ }
+
+ static lldb::OptionValueSP
+ CreateValueFromCStringForTypeMask(const char *value_cstr, uint32_t type_mask,
+ Status &error);
+
+ // Get this value as a uint64_t value if it is encoded as a boolean, uint64_t
+ // or int64_t. Other types will cause "fail_value" to be returned
+ uint64_t GetUInt64Value(uint64_t fail_value, bool *success_ptr);
+
+ OptionValueArch *GetAsArch();
+
+ const OptionValueArch *GetAsArch() const;
+
+ OptionValueArray *GetAsArray();
+
+ const OptionValueArray *GetAsArray() const;
+
+ OptionValueArgs *GetAsArgs();
+
+ const OptionValueArgs *GetAsArgs() const;
+
+ OptionValueBoolean *GetAsBoolean();
+
+ OptionValueChar *GetAsChar();
+
+ const OptionValueBoolean *GetAsBoolean() const;
+
+ const OptionValueChar *GetAsChar() const;
+
+ OptionValueDictionary *GetAsDictionary();
+
+ const OptionValueDictionary *GetAsDictionary() const;
+
+ OptionValueEnumeration *GetAsEnumeration();
+
+ const OptionValueEnumeration *GetAsEnumeration() const;
+
+ OptionValueFileSpec *GetAsFileSpec();
+
+ const OptionValueFileSpec *GetAsFileSpec() const;
+
+ OptionValueFileSpecList *GetAsFileSpecList();
+
+ const OptionValueFileSpecList *GetAsFileSpecList() const;
+
+ OptionValueFormat *GetAsFormat();
+
+ const OptionValueFormat *GetAsFormat() const;
+
+ OptionValueLanguage *GetAsLanguage();
+
+ const OptionValueLanguage *GetAsLanguage() const;
+
+ OptionValuePathMappings *GetAsPathMappings();
+
+ const OptionValuePathMappings *GetAsPathMappings() const;
+
+ OptionValueProperties *GetAsProperties();
+
+ const OptionValueProperties *GetAsProperties() const;
+
+ OptionValueRegex *GetAsRegex();
+
+ const OptionValueRegex *GetAsRegex() const;
+
+ OptionValueSInt64 *GetAsSInt64();
+
+ const OptionValueSInt64 *GetAsSInt64() const;
+
+ OptionValueString *GetAsString();
+
+ const OptionValueString *GetAsString() const;
+
+ OptionValueUInt64 *GetAsUInt64();
+
+ const OptionValueUInt64 *GetAsUInt64() const;
+
+ OptionValueUUID *GetAsUUID();
+
+ const OptionValueUUID *GetAsUUID() const;
+
+ OptionValueFormatEntity *GetAsFormatEntity();
+
+ const OptionValueFormatEntity *GetAsFormatEntity() const;
+
+ bool GetBooleanValue(bool fail_value = false) const;
+
+ bool SetBooleanValue(bool new_value);
+
+ char GetCharValue(char fail_value) const;
+
+ char SetCharValue(char new_value);
+
+ int64_t GetEnumerationValue(int64_t fail_value = -1) const;
+
+ bool SetEnumerationValue(int64_t value);
+
+ FileSpec GetFileSpecValue() const;
+
+ bool SetFileSpecValue(const FileSpec &file_spec);
+
+ FileSpecList GetFileSpecListValue() const;
+
+ lldb::Format
+ GetFormatValue(lldb::Format fail_value = lldb::eFormatDefault) const;
+
+ bool SetFormatValue(lldb::Format new_value);
+
+ lldb::LanguageType GetLanguageValue(
+ lldb::LanguageType fail_value = lldb::eLanguageTypeUnknown) const;
+
+ bool SetLanguageValue(lldb::LanguageType new_language);
+
+ const FormatEntity::Entry *GetFormatEntity() const;
+
+ const RegularExpression *GetRegexValue() const;
+
+ int64_t GetSInt64Value(int64_t fail_value = 0) const;
+
+ bool SetSInt64Value(int64_t new_value);
+
+ llvm::StringRef GetStringValue(llvm::StringRef fail_value) const;
+ llvm::StringRef GetStringValue() const { return GetStringValue(llvm::StringRef()); }
+
+ bool SetStringValue(llvm::StringRef new_value);
+
+ uint64_t GetUInt64Value(uint64_t fail_value = 0) const;
+
+ bool SetUInt64Value(uint64_t new_value);
+
+ UUID GetUUIDValue() const;
+
+ bool SetUUIDValue(const UUID &uuid);
+
+ bool OptionWasSet() const { return m_value_was_set; }
+
+ void SetOptionWasSet() { m_value_was_set = true; }
+
+ void SetParent(const lldb::OptionValueSP &parent_sp) {
+ m_parent_wp = parent_sp;
+ }
+
+ void SetValueChangedCallback(OptionValueChangedCallback callback,
+ void *baton) {
+ assert(m_callback == nullptr);
+ m_callback = callback;
+ m_baton = baton;
+ }
+
+ void NotifyValueChanged() {
+ if (m_callback)
+ m_callback(m_baton, this);
+ }
+
+protected:
+ lldb::OptionValueWP m_parent_wp;
+ OptionValueChangedCallback m_callback;
+ void *m_baton;
+ bool m_value_was_set; // This can be used to see if a value has been set
+ // by a call to SetValueFromCString(). It is often
+ // handy to know if an option value was set from the
+ // command line or as a setting, versus if we just have
+ // the default value that was already populated in the
+ // option value.
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValue_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueArch.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueArch.h
new file mode 100644
index 0000000..f8f4068
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueArch.h
@@ -0,0 +1,84 @@
+//===-- OptionValueArch.h -----------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueArch_h_
+#define liblldb_OptionValueArch_h_
+
+#include "lldb/Interpreter/OptionValue.h"
+#include "lldb/Utility/ArchSpec.h"
+#include "lldb/Utility/CompletionRequest.h"
+
+namespace lldb_private {
+
+class OptionValueArch : public OptionValue {
+public:
+ OptionValueArch() : OptionValue(), m_current_value(), m_default_value() {}
+
+ OptionValueArch(const char *triple)
+ : OptionValue(), m_current_value(triple), m_default_value() {
+ m_default_value = m_current_value;
+ }
+
+ OptionValueArch(const ArchSpec &value)
+ : OptionValue(), m_current_value(value), m_default_value(value) {}
+
+ OptionValueArch(const ArchSpec ¤t_value, const ArchSpec &default_value)
+ : OptionValue(), m_current_value(current_value),
+ m_default_value(default_value) {}
+
+ ~OptionValueArch() override {}
+
+ // Virtual subclass pure virtual overrides
+
+ OptionValue::Type GetType() const override { return eTypeArch; }
+
+ void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) override;
+
+ Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign) override;
+ Status
+ SetValueFromString(const char *,
+ VarSetOperationType = eVarSetOperationAssign) = delete;
+
+ bool Clear() override {
+ m_current_value = m_default_value;
+ m_value_was_set = false;
+ return true;
+ }
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+ size_t AutoComplete(CommandInterpreter &interpreter,
+ lldb_private::CompletionRequest &request) override;
+
+ // Subclass specific functions
+
+ ArchSpec &GetCurrentValue() { return m_current_value; }
+
+ const ArchSpec &GetCurrentValue() const { return m_current_value; }
+
+ const ArchSpec &GetDefaultValue() const { return m_default_value; }
+
+ void SetCurrentValue(const ArchSpec &value, bool set_value_was_set) {
+ m_current_value = value;
+ if (set_value_was_set)
+ m_value_was_set = true;
+ }
+
+ void SetDefaultValue(const ArchSpec &value) { m_default_value = value; }
+
+protected:
+ ArchSpec m_current_value;
+ ArchSpec m_default_value;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueArch_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueArgs.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueArgs.h
new file mode 100644
index 0000000..0254b9a
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueArgs.h
@@ -0,0 +1,31 @@
+//===-- OptionValueArgs.h --------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueArgs_h_
+#define liblldb_OptionValueArgs_h_
+
+#include "lldb/Interpreter/OptionValueArray.h"
+
+namespace lldb_private {
+
+class OptionValueArgs : public OptionValueArray {
+public:
+ OptionValueArgs()
+ : OptionValueArray(
+ OptionValue::ConvertTypeToMask(OptionValue::eTypeString)) {}
+
+ ~OptionValueArgs() override {}
+
+ size_t GetArgs(Args &args);
+
+ Type GetType() const override { return eTypeArgs; }
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueArgs_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueArray.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueArray.h
new file mode 100644
index 0000000..10f3bf5
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueArray.h
@@ -0,0 +1,128 @@
+//===-- OptionValueArray.h --------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueArray_h_
+#define liblldb_OptionValueArray_h_
+
+#include <vector>
+
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueArray : public OptionValue {
+public:
+ OptionValueArray(uint32_t type_mask = UINT32_MAX, bool raw_value_dump = false)
+ : m_type_mask(type_mask), m_values(), m_raw_value_dump(raw_value_dump) {}
+
+ ~OptionValueArray() override {}
+
+ // Virtual subclass pure virtual overrides
+
+ OptionValue::Type GetType() const override { return eTypeArray; }
+
+ void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) override;
+
+ Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign) override;
+ Status
+ SetValueFromString(const char *,
+ VarSetOperationType = eVarSetOperationAssign) = delete;
+
+ bool Clear() override {
+ m_values.clear();
+ m_value_was_set = false;
+ return true;
+ }
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+ bool IsAggregateValue() const override { return true; }
+
+ lldb::OptionValueSP GetSubValue(const ExecutionContext *exe_ctx,
+ llvm::StringRef name, bool will_modify,
+ Status &error) const override;
+
+ // Subclass specific functions
+
+ size_t GetSize() const { return m_values.size(); }
+
+ lldb::OptionValueSP operator[](size_t idx) const {
+ lldb::OptionValueSP value_sp;
+ if (idx < m_values.size())
+ value_sp = m_values[idx];
+ return value_sp;
+ }
+
+ lldb::OptionValueSP GetValueAtIndex(size_t idx) const {
+ lldb::OptionValueSP value_sp;
+ if (idx < m_values.size())
+ value_sp = m_values[idx];
+ return value_sp;
+ }
+
+ bool AppendValue(const lldb::OptionValueSP &value_sp) {
+ // Make sure the value_sp object is allowed to contain values of the type
+ // passed in...
+ if (value_sp && (m_type_mask & value_sp->GetTypeAsMask())) {
+ m_values.push_back(value_sp);
+ return true;
+ }
+ return false;
+ }
+
+ bool InsertValue(size_t idx, const lldb::OptionValueSP &value_sp) {
+ // Make sure the value_sp object is allowed to contain values of the type
+ // passed in...
+ if (value_sp && (m_type_mask & value_sp->GetTypeAsMask())) {
+ if (idx < m_values.size())
+ m_values.insert(m_values.begin() + idx, value_sp);
+ else
+ m_values.push_back(value_sp);
+ return true;
+ }
+ return false;
+ }
+
+ bool ReplaceValue(size_t idx, const lldb::OptionValueSP &value_sp) {
+ // Make sure the value_sp object is allowed to contain values of the type
+ // passed in...
+ if (value_sp && (m_type_mask & value_sp->GetTypeAsMask())) {
+ if (idx < m_values.size()) {
+ m_values[idx] = value_sp;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ bool DeleteValue(size_t idx) {
+ if (idx < m_values.size()) {
+ m_values.erase(m_values.begin() + idx);
+ return true;
+ }
+ return false;
+ }
+
+ size_t GetArgs(Args &args) const;
+
+ Status SetArgs(const Args &args, VarSetOperationType op);
+
+protected:
+ typedef std::vector<lldb::OptionValueSP> collection;
+
+ uint32_t m_type_mask;
+ collection m_values;
+ bool m_raw_value_dump;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueArray_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueBoolean.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueBoolean.h
new file mode 100644
index 0000000..2fc97d4
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueBoolean.h
@@ -0,0 +1,88 @@
+//===-- OptionValueBoolean.h ------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueBoolean_h_
+#define liblldb_OptionValueBoolean_h_
+
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueBoolean : public OptionValue {
+public:
+ OptionValueBoolean(bool value)
+ : OptionValue(), m_current_value(value), m_default_value(value) {}
+ OptionValueBoolean(bool current_value, bool default_value)
+ : OptionValue(), m_current_value(current_value),
+ m_default_value(default_value) {}
+
+ ~OptionValueBoolean() override {}
+
+ // Virtual subclass pure virtual overrides
+
+ OptionValue::Type GetType() const override { return eTypeBoolean; }
+
+ void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) override;
+
+ Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign) override;
+ Status
+ SetValueFromString(const char *,
+ VarSetOperationType = eVarSetOperationAssign) = delete;
+
+ bool Clear() override {
+ m_current_value = m_default_value;
+ m_value_was_set = false;
+ return true;
+ }
+
+ size_t AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
+
+ // Subclass specific functions
+
+ /// Convert to bool operator.
+ ///
+ /// This allows code to check a OptionValueBoolean in conditions.
+ ///
+ /// \code
+ /// OptionValueBoolean bool_value(...);
+ /// if (bool_value)
+ /// { ...
+ /// \endcode
+ ///
+ /// \return
+ /// /b True this object contains a valid namespace decl, \b
+ /// false otherwise.
+ explicit operator bool() const { return m_current_value; }
+
+ const bool &operator=(bool b) {
+ m_current_value = b;
+ return m_current_value;
+ }
+
+ bool GetCurrentValue() const { return m_current_value; }
+
+ bool GetDefaultValue() const { return m_default_value; }
+
+ void SetCurrentValue(bool value) { m_current_value = value; }
+
+ void SetDefaultValue(bool value) { m_default_value = value; }
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+protected:
+ bool m_current_value;
+ bool m_default_value;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueBoolean_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueChar.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueChar.h
new file mode 100644
index 0000000..d866136
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueChar.h
@@ -0,0 +1,71 @@
+//===-- OptionValueChar.h ---------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueChar_h_
+#define liblldb_OptionValueChar_h_
+
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueChar : public OptionValue {
+public:
+ OptionValueChar(char value)
+ : OptionValue(), m_current_value(value), m_default_value(value) {}
+
+ OptionValueChar(char current_value, char default_value)
+ : OptionValue(), m_current_value(current_value),
+ m_default_value(default_value) {}
+
+ ~OptionValueChar() override {}
+
+ // Virtual subclass pure virtual overrides
+
+ OptionValue::Type GetType() const override { return eTypeChar; }
+
+ void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) override;
+
+ Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign) override;
+ Status
+ SetValueFromString(const char *,
+ VarSetOperationType = eVarSetOperationAssign) = delete;
+
+ bool Clear() override {
+ m_current_value = m_default_value;
+ m_value_was_set = false;
+ return true;
+ }
+
+ // Subclass specific functions
+
+ const char &operator=(char c) {
+ m_current_value = c;
+ return m_current_value;
+ }
+
+ char GetCurrentValue() const { return m_current_value; }
+
+ char GetDefaultValue() const { return m_default_value; }
+
+ void SetCurrentValue(char value) { m_current_value = value; }
+
+ void SetDefaultValue(char value) { m_default_value = value; }
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+protected:
+ char m_current_value;
+ char m_default_value;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueChar_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueDictionary.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueDictionary.h
new file mode 100644
index 0000000..8785d38
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueDictionary.h
@@ -0,0 +1,84 @@
+//===-- OptionValueDictionary.h ---------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueDictionary_h_
+#define liblldb_OptionValueDictionary_h_
+
+#include <map>
+
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueDictionary : public OptionValue {
+public:
+ OptionValueDictionary(uint32_t type_mask = UINT32_MAX,
+ bool raw_value_dump = true)
+ : OptionValue(), m_type_mask(type_mask), m_values(),
+ m_raw_value_dump(raw_value_dump) {}
+
+ ~OptionValueDictionary() override {}
+
+ // Virtual subclass pure virtual overrides
+
+ OptionValue::Type GetType() const override { return eTypeDictionary; }
+
+ void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) override;
+
+ Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign) override;
+
+ bool Clear() override {
+ m_values.clear();
+ m_value_was_set = false;
+ return true;
+ }
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+ bool IsAggregateValue() const override { return true; }
+
+ bool IsHomogenous() const {
+ return ConvertTypeMaskToType(m_type_mask) != eTypeInvalid;
+ }
+
+ // Subclass specific functions
+
+ size_t GetNumValues() const { return m_values.size(); }
+
+ lldb::OptionValueSP GetValueForKey(ConstString key) const;
+
+ lldb::OptionValueSP GetSubValue(const ExecutionContext *exe_ctx,
+ llvm::StringRef name, bool will_modify,
+ Status &error) const override;
+
+ Status SetSubValue(const ExecutionContext *exe_ctx, VarSetOperationType op,
+ llvm::StringRef name, llvm::StringRef value) override;
+
+ bool SetValueForKey(ConstString key,
+ const lldb::OptionValueSP &value_sp,
+ bool can_replace = true);
+
+ bool DeleteValueForKey(ConstString key);
+
+ size_t GetArgs(Args &args) const;
+
+ Status SetArgs(const Args &args, VarSetOperationType op);
+
+protected:
+ typedef std::map<ConstString, lldb::OptionValueSP> collection;
+ uint32_t m_type_mask;
+ collection m_values;
+ bool m_raw_value_dump;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueDictionary_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueEnumeration.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueEnumeration.h
new file mode 100644
index 0000000..71f3ab5
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueEnumeration.h
@@ -0,0 +1,86 @@
+//===-- OptionValueEnumeration.h --------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueEnumeration_h_
+#define liblldb_OptionValueEnumeration_h_
+
+#include "lldb/Core/UniqueCStringMap.h"
+#include "lldb/Interpreter/OptionValue.h"
+#include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/Status.h"
+#include "lldb/Utility/Stream.h"
+#include "lldb/Utility/StreamString.h"
+#include "lldb/lldb-private-types.h"
+
+namespace lldb_private {
+
+class OptionValueEnumeration : public OptionValue {
+public:
+ typedef int64_t enum_type;
+ struct EnumeratorInfo {
+ enum_type value;
+ const char *description;
+ };
+ typedef UniqueCStringMap<EnumeratorInfo> EnumerationMap;
+ typedef EnumerationMap::Entry EnumerationMapEntry;
+
+ OptionValueEnumeration(const OptionEnumValues &enumerators, enum_type value);
+
+ ~OptionValueEnumeration() override;
+
+ // Virtual subclass pure virtual overrides
+
+ OptionValue::Type GetType() const override { return eTypeEnum; }
+
+ void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) override;
+
+ Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign) override;
+ Status
+ SetValueFromString(const char *,
+ VarSetOperationType = eVarSetOperationAssign) = delete;
+
+ bool Clear() override {
+ m_current_value = m_default_value;
+ m_value_was_set = false;
+ return true;
+ }
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+ size_t AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
+
+ // Subclass specific functions
+
+ enum_type operator=(enum_type value) {
+ m_current_value = value;
+ return m_current_value;
+ }
+
+ enum_type GetCurrentValue() const { return m_current_value; }
+
+ enum_type GetDefaultValue() const { return m_default_value; }
+
+ void SetCurrentValue(enum_type value) { m_current_value = value; }
+
+ void SetDefaultValue(enum_type value) { m_default_value = value; }
+
+protected:
+ void SetEnumerations(const OptionEnumValues &enumerators);
+
+ enum_type m_current_value;
+ enum_type m_default_value;
+ EnumerationMap m_enumerations;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueEnumeration_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueFileSpec.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueFileSpec.h
new file mode 100644
index 0000000..aa1022a
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueFileSpec.h
@@ -0,0 +1,89 @@
+//===-- OptionValueFileSpec.h -----------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueFileSpec_h_
+#define liblldb_OptionValueFileSpec_h_
+
+#include "lldb/Interpreter/OptionValue.h"
+
+#include "lldb/Utility/FileSpec.h"
+#include "llvm/Support/Chrono.h"
+
+namespace lldb_private {
+
+class OptionValueFileSpec : public OptionValue {
+public:
+ OptionValueFileSpec(bool resolve = true);
+
+ OptionValueFileSpec(const FileSpec &value, bool resolve = true);
+
+ OptionValueFileSpec(const FileSpec ¤t_value,
+ const FileSpec &default_value, bool resolve = true);
+
+ ~OptionValueFileSpec() override {}
+
+ // Virtual subclass pure virtual overrides
+
+ OptionValue::Type GetType() const override { return eTypeFileSpec; }
+
+ void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) override;
+
+ Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign) override;
+ Status
+ SetValueFromString(const char *,
+ VarSetOperationType = eVarSetOperationAssign) = delete;
+
+ bool Clear() override {
+ m_current_value = m_default_value;
+ m_value_was_set = false;
+ m_data_sp.reset();
+ m_data_mod_time = llvm::sys::TimePoint<>();
+ return true;
+ }
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+ size_t AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
+
+ // Subclass specific functions
+
+ FileSpec &GetCurrentValue() { return m_current_value; }
+
+ const FileSpec &GetCurrentValue() const { return m_current_value; }
+
+ const FileSpec &GetDefaultValue() const { return m_default_value; }
+
+ void SetCurrentValue(const FileSpec &value, bool set_value_was_set) {
+ m_current_value = value;
+ if (set_value_was_set)
+ m_value_was_set = true;
+ m_data_sp.reset();
+ }
+
+ void SetDefaultValue(const FileSpec &value) { m_default_value = value; }
+
+ const lldb::DataBufferSP &GetFileContents();
+
+ void SetCompletionMask(uint32_t mask) { m_completion_mask = mask; }
+
+protected:
+ FileSpec m_current_value;
+ FileSpec m_default_value;
+ lldb::DataBufferSP m_data_sp;
+ llvm::sys::TimePoint<> m_data_mod_time;
+ uint32_t m_completion_mask;
+ bool m_resolve;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueFileSpec_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueFileSpecList.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueFileSpecList.h
new file mode 100644
index 0000000..5607437
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueFileSpecList.h
@@ -0,0 +1,77 @@
+//===-- OptionValueFileSpecList.h -------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueFileSpecList_h_
+#define liblldb_OptionValueFileSpecList_h_
+
+#include <mutex>
+
+#include "lldb/Core/FileSpecList.h"
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueFileSpecList : public OptionValue {
+public:
+ OptionValueFileSpecList() : OptionValue(), m_current_value() {}
+
+ OptionValueFileSpecList(const FileSpecList ¤t_value)
+ : OptionValue(), m_current_value(current_value) {}
+
+ ~OptionValueFileSpecList() override {}
+
+ // Virtual subclass pure virtual overrides
+
+ OptionValue::Type GetType() const override { return eTypeFileSpecList; }
+
+ void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) override;
+
+ Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign) override;
+ Status
+ SetValueFromString(const char *,
+ VarSetOperationType = eVarSetOperationAssign) = delete;
+
+ bool Clear() override {
+ std::lock_guard<std::recursive_mutex> lock(m_mutex);
+ m_current_value.Clear();
+ m_value_was_set = false;
+ return true;
+ }
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+ bool IsAggregateValue() const override { return true; }
+
+ // Subclass specific functions
+
+ FileSpecList GetCurrentValue() const {
+ std::lock_guard<std::recursive_mutex> lock(m_mutex);
+ return m_current_value;
+ }
+
+ void SetCurrentValue(const FileSpecList &value) {
+ std::lock_guard<std::recursive_mutex> lock(m_mutex);
+ m_current_value = value;
+ }
+
+ void AppendCurrentValue(const FileSpec &value) {
+ std::lock_guard<std::recursive_mutex> lock(m_mutex);
+ m_current_value.Append(value);
+ }
+
+protected:
+ mutable std::recursive_mutex m_mutex;
+ FileSpecList m_current_value;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueFileSpecList_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueFormat.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueFormat.h
new file mode 100644
index 0000000..020f4ae
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueFormat.h
@@ -0,0 +1,66 @@
+//===-- OptionValueFormat.h -------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueFormat_h_
+#define liblldb_OptionValueFormat_h_
+
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueFormat : public OptionValue {
+public:
+ OptionValueFormat(lldb::Format value)
+ : OptionValue(), m_current_value(value), m_default_value(value) {}
+
+ OptionValueFormat(lldb::Format current_value, lldb::Format default_value)
+ : OptionValue(), m_current_value(current_value),
+ m_default_value(default_value) {}
+
+ ~OptionValueFormat() override {}
+
+ // Virtual subclass pure virtual overrides
+
+ OptionValue::Type GetType() const override { return eTypeFormat; }
+
+ void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) override;
+
+ Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign) override;
+ Status
+ SetValueFromString(const char *,
+ VarSetOperationType = eVarSetOperationAssign) = delete;
+
+ bool Clear() override {
+ m_current_value = m_default_value;
+ m_value_was_set = false;
+ return true;
+ }
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+ // Subclass specific functions
+
+ lldb::Format GetCurrentValue() const { return m_current_value; }
+
+ lldb::Format GetDefaultValue() const { return m_default_value; }
+
+ void SetCurrentValue(lldb::Format value) { m_current_value = value; }
+
+ void SetDefaultValue(lldb::Format value) { m_default_value = value; }
+
+protected:
+ lldb::Format m_current_value;
+ lldb::Format m_default_value;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueFormat_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueFormatEntity.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueFormatEntity.h
new file mode 100644
index 0000000..b05be95
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueFormatEntity.h
@@ -0,0 +1,67 @@
+//===-- OptionValueFormatEntity.h --------------------------------*- C++-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueFormatEntity_h_
+#define liblldb_OptionValueFormatEntity_h_
+
+#include "lldb/Core/FormatEntity.h"
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueFormatEntity : public OptionValue {
+public:
+ OptionValueFormatEntity(const char *default_format);
+
+ ~OptionValueFormatEntity() override {}
+
+ // Virtual subclass pure virtual overrides
+
+ OptionValue::Type GetType() const override { return eTypeFormatEntity; }
+
+ void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) override;
+
+ Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign) override;
+ Status
+ SetValueFromString(const char *,
+ VarSetOperationType = eVarSetOperationAssign) = delete;
+
+ bool Clear() override;
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+ size_t AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
+
+ // Subclass specific functions
+
+ FormatEntity::Entry &GetCurrentValue() { return m_current_entry; }
+
+ const FormatEntity::Entry &GetCurrentValue() const { return m_current_entry; }
+
+ void SetCurrentValue(const FormatEntity::Entry &value) {
+ m_current_entry = value;
+ }
+
+ FormatEntity::Entry &GetDefaultValue() { return m_default_entry; }
+
+ const FormatEntity::Entry &GetDefaultValue() const { return m_default_entry; }
+
+protected:
+ std::string m_current_format;
+ std::string m_default_format;
+ FormatEntity::Entry m_current_entry;
+ FormatEntity::Entry m_default_entry;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueFormatEntity_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueLanguage.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueLanguage.h
new file mode 100644
index 0000000..505dc89
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueLanguage.h
@@ -0,0 +1,69 @@
+//===-- OptionValueLanguage.h -------------------------------------*- C++
+//-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueLanguage_h_
+#define liblldb_OptionValueLanguage_h_
+
+#include "lldb/Interpreter/OptionValue.h"
+#include "lldb/lldb-enumerations.h"
+
+namespace lldb_private {
+
+class OptionValueLanguage : public OptionValue {
+public:
+ OptionValueLanguage(lldb::LanguageType value)
+ : OptionValue(), m_current_value(value), m_default_value(value) {}
+
+ OptionValueLanguage(lldb::LanguageType current_value,
+ lldb::LanguageType default_value)
+ : OptionValue(), m_current_value(current_value),
+ m_default_value(default_value) {}
+
+ ~OptionValueLanguage() override {}
+
+ // Virtual subclass pure virtual overrides
+
+ OptionValue::Type GetType() const override { return eTypeLanguage; }
+
+ void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) override;
+
+ Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign) override;
+ Status
+ SetValueFromString(const char *,
+ VarSetOperationType = eVarSetOperationAssign) = delete;
+
+ bool Clear() override {
+ m_current_value = m_default_value;
+ m_value_was_set = false;
+ return true;
+ }
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+ // Subclass specific functions
+
+ lldb::LanguageType GetCurrentValue() const { return m_current_value; }
+
+ lldb::LanguageType GetDefaultValue() const { return m_default_value; }
+
+ void SetCurrentValue(lldb::LanguageType value) { m_current_value = value; }
+
+ void SetDefaultValue(lldb::LanguageType value) { m_default_value = value; }
+
+protected:
+ lldb::LanguageType m_current_value;
+ lldb::LanguageType m_default_value;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueLanguage_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValuePathMappings.h b/linux-x64/clang/include/lldb/Interpreter/OptionValuePathMappings.h
new file mode 100644
index 0000000..35c2af4
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValuePathMappings.h
@@ -0,0 +1,61 @@
+//===-- OptionValuePathMappings.h -------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValuePathMappings_h_
+#define liblldb_OptionValuePathMappings_h_
+
+#include "lldb/Interpreter/OptionValue.h"
+#include "lldb/Target/PathMappingList.h"
+
+namespace lldb_private {
+
+class OptionValuePathMappings : public OptionValue {
+public:
+ OptionValuePathMappings(bool notify_changes)
+ : OptionValue(), m_path_mappings(), m_notify_changes(notify_changes) {}
+
+ ~OptionValuePathMappings() override {}
+
+ // Virtual subclass pure virtual overrides
+
+ OptionValue::Type GetType() const override { return eTypePathMap; }
+
+ void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) override;
+
+ Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign) override;
+ Status
+ SetValueFromString(const char *,
+ VarSetOperationType = eVarSetOperationAssign) = delete;
+
+ bool Clear() override {
+ m_path_mappings.Clear(m_notify_changes);
+ m_value_was_set = false;
+ return true;
+ }
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+ bool IsAggregateValue() const override { return true; }
+
+ // Subclass specific functions
+
+ PathMappingList &GetCurrentValue() { return m_path_mappings; }
+
+ const PathMappingList &GetCurrentValue() const { return m_path_mappings; }
+
+protected:
+ PathMappingList m_path_mappings;
+ bool m_notify_changes;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValuePathMappings_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueProperties.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueProperties.h
new file mode 100644
index 0000000..bea2b3c
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueProperties.h
@@ -0,0 +1,222 @@
+//===-- OptionValueProperties.h ---------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueProperties_h_
+#define liblldb_OptionValueProperties_h_
+
+#include <vector>
+
+#include "lldb/Core/FormatEntity.h"
+#include "lldb/Core/UniqueCStringMap.h"
+#include "lldb/Interpreter/OptionValue.h"
+#include "lldb/Interpreter/Property.h"
+#include "lldb/Utility/ConstString.h"
+
+namespace lldb_private {
+
+class OptionValueProperties
+ : public OptionValue,
+ public std::enable_shared_from_this<OptionValueProperties> {
+public:
+ OptionValueProperties()
+ : OptionValue(), m_name(), m_properties(), m_name_to_index() {}
+
+ OptionValueProperties(ConstString name);
+
+ OptionValueProperties(const OptionValueProperties &global_properties);
+
+ ~OptionValueProperties() override = default;
+
+ Type GetType() const override { return eTypeProperties; }
+
+ bool Clear() override;
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+ Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign) override;
+
+ void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) override;
+
+ ConstString GetName() const override { return m_name; }
+
+ virtual Status DumpPropertyValue(const ExecutionContext *exe_ctx,
+ Stream &strm, llvm::StringRef property_path,
+ uint32_t dump_mask);
+
+ virtual void DumpAllDescriptions(CommandInterpreter &interpreter,
+ Stream &strm) const;
+
+ void Apropos(llvm::StringRef keyword,
+ std::vector<const Property *> &matching_properties) const;
+
+ void Initialize(const PropertyDefinitions &setting_definitions);
+
+ // bool
+ // GetQualifiedName (Stream &strm);
+
+ // Subclass specific functions
+
+ virtual size_t GetNumProperties() const;
+
+ // Get the index of a property given its exact name in this property
+ // collection, "name" can't be a path to a property path that refers to a
+ // property within a property
+ virtual uint32_t GetPropertyIndex(ConstString name) const;
+
+ // Get a property by exact name exists in this property collection, name can
+ // not be a path to a property path that refers to a property within a
+ // property
+ virtual const Property *GetProperty(const ExecutionContext *exe_ctx,
+ bool will_modify,
+ ConstString name) const;
+
+ virtual const Property *GetPropertyAtIndex(const ExecutionContext *exe_ctx,
+ bool will_modify,
+ uint32_t idx) const;
+
+ // Property can be be a property path like
+ // "target.process.extra-startup-command"
+ virtual const Property *GetPropertyAtPath(const ExecutionContext *exe_ctx,
+ bool will_modify,
+ llvm::StringRef property_path) const;
+
+ virtual lldb::OptionValueSP
+ GetPropertyValueAtIndex(const ExecutionContext *exe_ctx, bool will_modify,
+ uint32_t idx) const;
+
+ virtual lldb::OptionValueSP GetValueForKey(const ExecutionContext *exe_ctx,
+ ConstString key,
+ bool value_will_be_modified) const;
+
+ lldb::OptionValueSP GetSubValue(const ExecutionContext *exe_ctx,
+ llvm::StringRef name,
+ bool value_will_be_modified,
+ Status &error) const override;
+
+ Status SetSubValue(const ExecutionContext *exe_ctx, VarSetOperationType op,
+ llvm::StringRef path, llvm::StringRef value) override;
+
+ virtual bool PredicateMatches(const ExecutionContext *exe_ctx,
+ llvm::StringRef predicate) const {
+ return false;
+ }
+
+ OptionValueArch *
+ GetPropertyAtIndexAsOptionValueArch(const ExecutionContext *exe_ctx,
+ uint32_t idx) const;
+
+ OptionValueLanguage *
+ GetPropertyAtIndexAsOptionValueLanguage(const ExecutionContext *exe_ctx,
+ uint32_t idx) const;
+
+ bool GetPropertyAtIndexAsArgs(const ExecutionContext *exe_ctx, uint32_t idx,
+ Args &args) const;
+
+ bool SetPropertyAtIndexFromArgs(const ExecutionContext *exe_ctx, uint32_t idx,
+ const Args &args);
+
+ bool GetPropertyAtIndexAsBoolean(const ExecutionContext *exe_ctx,
+ uint32_t idx, bool fail_value) const;
+
+ bool SetPropertyAtIndexAsBoolean(const ExecutionContext *exe_ctx,
+ uint32_t idx, bool new_value);
+
+ OptionValueDictionary *
+ GetPropertyAtIndexAsOptionValueDictionary(const ExecutionContext *exe_ctx,
+ uint32_t idx) const;
+
+ int64_t GetPropertyAtIndexAsEnumeration(const ExecutionContext *exe_ctx,
+ uint32_t idx,
+ int64_t fail_value) const;
+
+ bool SetPropertyAtIndexAsEnumeration(const ExecutionContext *exe_ctx,
+ uint32_t idx, int64_t new_value);
+
+ const FormatEntity::Entry *
+ GetPropertyAtIndexAsFormatEntity(const ExecutionContext *exe_ctx,
+ uint32_t idx);
+
+ const RegularExpression *
+ GetPropertyAtIndexAsOptionValueRegex(const ExecutionContext *exe_ctx,
+ uint32_t idx) const;
+
+ OptionValueSInt64 *
+ GetPropertyAtIndexAsOptionValueSInt64(const ExecutionContext *exe_ctx,
+ uint32_t idx) const;
+
+ int64_t GetPropertyAtIndexAsSInt64(const ExecutionContext *exe_ctx,
+ uint32_t idx, int64_t fail_value) const;
+
+ bool SetPropertyAtIndexAsSInt64(const ExecutionContext *exe_ctx, uint32_t idx,
+ int64_t new_value);
+
+ uint64_t GetPropertyAtIndexAsUInt64(const ExecutionContext *exe_ctx,
+ uint32_t idx, uint64_t fail_value) const;
+
+ bool SetPropertyAtIndexAsUInt64(const ExecutionContext *exe_ctx, uint32_t idx,
+ uint64_t new_value);
+
+ llvm::StringRef GetPropertyAtIndexAsString(const ExecutionContext *exe_ctx,
+ uint32_t idx,
+ llvm::StringRef fail_value) const;
+
+ bool SetPropertyAtIndexAsString(const ExecutionContext *exe_ctx, uint32_t idx,
+ llvm::StringRef new_value);
+
+ OptionValueString *
+ GetPropertyAtIndexAsOptionValueString(const ExecutionContext *exe_ctx,
+ bool will_modify, uint32_t idx) const;
+
+ OptionValueFileSpec *
+ GetPropertyAtIndexAsOptionValueFileSpec(const ExecutionContext *exe_ctx,
+ bool will_modify, uint32_t idx) const;
+
+ FileSpec GetPropertyAtIndexAsFileSpec(const ExecutionContext *exe_ctx,
+ uint32_t idx) const;
+
+ bool SetPropertyAtIndexAsFileSpec(const ExecutionContext *exe_ctx,
+ uint32_t idx, const FileSpec &file_spec);
+
+ OptionValuePathMappings *GetPropertyAtIndexAsOptionValuePathMappings(
+ const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const;
+
+ OptionValueFileSpecList *GetPropertyAtIndexAsOptionValueFileSpecList(
+ const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const;
+
+ void AppendProperty(ConstString name, ConstString desc,
+ bool is_global, const lldb::OptionValueSP &value_sp);
+
+ lldb::OptionValuePropertiesSP GetSubProperty(const ExecutionContext *exe_ctx,
+ ConstString name);
+
+ void SetValueChangedCallback(uint32_t property_idx,
+ OptionValueChangedCallback callback,
+ void *baton);
+
+protected:
+ Property *ProtectedGetPropertyAtIndex(uint32_t idx) {
+ return ((idx < m_properties.size()) ? &m_properties[idx] : nullptr);
+ }
+
+ const Property *ProtectedGetPropertyAtIndex(uint32_t idx) const {
+ return ((idx < m_properties.size()) ? &m_properties[idx] : nullptr);
+ }
+
+ typedef UniqueCStringMap<size_t> NameToIndex;
+
+ ConstString m_name;
+ std::vector<Property> m_properties;
+ NameToIndex m_name_to_index;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueProperties_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueRegex.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueRegex.h
new file mode 100644
index 0000000..f5b2557
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueRegex.h
@@ -0,0 +1,66 @@
+//===-- OptionValueRegex.h --------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueRegex_h_
+#define liblldb_OptionValueRegex_h_
+
+#include "lldb/Interpreter/OptionValue.h"
+#include "lldb/Utility/RegularExpression.h"
+
+namespace lldb_private {
+
+class OptionValueRegex : public OptionValue {
+public:
+ OptionValueRegex(const char *value = nullptr)
+ : OptionValue(), m_regex(llvm::StringRef::withNullAsEmpty(value)) {}
+
+ ~OptionValueRegex() override = default;
+
+ // Virtual subclass pure virtual overrides
+
+ OptionValue::Type GetType() const override { return eTypeRegex; }
+
+ void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) override;
+
+ Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign) override;
+ Status
+ SetValueFromString(const char *,
+ VarSetOperationType = eVarSetOperationAssign) = delete;
+
+ bool Clear() override {
+ m_regex.Clear();
+ m_value_was_set = false;
+ return true;
+ }
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+ // Subclass specific functions
+ const RegularExpression *GetCurrentValue() const {
+ return (m_regex.IsValid() ? &m_regex : nullptr);
+ }
+
+ void SetCurrentValue(const char *value) {
+ if (value && value[0])
+ m_regex.Compile(llvm::StringRef(value));
+ else
+ m_regex.Clear();
+ }
+
+ bool IsValid() const { return m_regex.IsValid(); }
+
+protected:
+ RegularExpression m_regex;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueRegex_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueSInt64.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueSInt64.h
new file mode 100644
index 0000000..c2e8ff4
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueSInt64.h
@@ -0,0 +1,105 @@
+//===-- OptionValueSInt64.h --------------------------------------*- C++
+//-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueSInt64_h_
+#define liblldb_OptionValueSInt64_h_
+
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueSInt64 : public OptionValue {
+public:
+ OptionValueSInt64()
+ : OptionValue(), m_current_value(0), m_default_value(0),
+ m_min_value(INT64_MIN), m_max_value(INT64_MAX) {}
+
+ OptionValueSInt64(int64_t value)
+ : OptionValue(), m_current_value(value), m_default_value(value),
+ m_min_value(INT64_MIN), m_max_value(INT64_MAX) {}
+
+ OptionValueSInt64(int64_t current_value, int64_t default_value)
+ : OptionValue(), m_current_value(current_value),
+ m_default_value(default_value), m_min_value(INT64_MIN),
+ m_max_value(INT64_MAX) {}
+
+ OptionValueSInt64(const OptionValueSInt64 &rhs)
+ : OptionValue(rhs), m_current_value(rhs.m_current_value),
+ m_default_value(rhs.m_default_value), m_min_value(rhs.m_min_value),
+ m_max_value(rhs.m_max_value) {}
+
+ ~OptionValueSInt64() override {}
+
+ // Virtual subclass pure virtual overrides
+
+ OptionValue::Type GetType() const override { return eTypeSInt64; }
+
+ void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) override;
+
+ Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign) override;
+ Status
+ SetValueFromString(const char *,
+ VarSetOperationType = eVarSetOperationAssign) = delete;
+
+ bool Clear() override {
+ m_current_value = m_default_value;
+ m_value_was_set = false;
+ return true;
+ }
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+ // Subclass specific functions
+
+ const int64_t &operator=(int64_t value) {
+ m_current_value = value;
+ return m_current_value;
+ }
+
+ int64_t GetCurrentValue() const { return m_current_value; }
+
+ int64_t GetDefaultValue() const { return m_default_value; }
+
+ bool SetCurrentValue(int64_t value) {
+ if (value >= m_min_value && value <= m_max_value) {
+ m_current_value = value;
+ return true;
+ }
+ return false;
+ }
+
+ bool SetDefaultValue(int64_t value) {
+ if (value >= m_min_value && value <= m_max_value) {
+ m_default_value = value;
+ return true;
+ }
+ return false;
+ }
+
+ void SetMinimumValue(int64_t v) { m_min_value = v; }
+
+ int64_t GetMinimumValue() const { return m_min_value; }
+
+ void SetMaximumValue(int64_t v) { m_max_value = v; }
+
+ int64_t GetMaximumValue() const { return m_max_value; }
+
+protected:
+ int64_t m_current_value;
+ int64_t m_default_value;
+ int64_t m_min_value;
+ int64_t m_max_value;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueSInt64_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueString.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueString.h
new file mode 100644
index 0000000..d9e76d8
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueString.h
@@ -0,0 +1,139 @@
+//===-- OptionValueString.h -------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueString_h_
+#define liblldb_OptionValueString_h_
+
+#include <string>
+
+#include "lldb/Utility/Flags.h"
+
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueString : public OptionValue {
+public:
+ typedef Status (*ValidatorCallback)(const char *string, void *baton);
+
+ enum Options { eOptionEncodeCharacterEscapeSequences = (1u << 0) };
+
+ OptionValueString()
+ : OptionValue(), m_current_value(), m_default_value(), m_options(),
+ m_validator(), m_validator_baton() {}
+
+ OptionValueString(ValidatorCallback validator, void *baton = nullptr)
+ : OptionValue(), m_current_value(), m_default_value(), m_options(),
+ m_validator(validator), m_validator_baton(baton) {}
+
+ OptionValueString(const char *value)
+ : OptionValue(), m_current_value(), m_default_value(), m_options(),
+ m_validator(), m_validator_baton() {
+ if (value && value[0]) {
+ m_current_value.assign(value);
+ m_default_value.assign(value);
+ }
+ }
+
+ OptionValueString(const char *current_value, const char *default_value)
+ : OptionValue(), m_current_value(), m_default_value(), m_options(),
+ m_validator(), m_validator_baton() {
+ if (current_value && current_value[0])
+ m_current_value.assign(current_value);
+ if (default_value && default_value[0])
+ m_default_value.assign(default_value);
+ }
+
+ OptionValueString(const char *value, ValidatorCallback validator,
+ void *baton = nullptr)
+ : OptionValue(), m_current_value(), m_default_value(), m_options(),
+ m_validator(validator), m_validator_baton(baton) {
+ if (value && value[0]) {
+ m_current_value.assign(value);
+ m_default_value.assign(value);
+ }
+ }
+
+ OptionValueString(const char *current_value, const char *default_value,
+ ValidatorCallback validator, void *baton = nullptr)
+ : OptionValue(), m_current_value(), m_default_value(), m_options(),
+ m_validator(validator), m_validator_baton(baton) {
+ if (current_value && current_value[0])
+ m_current_value.assign(current_value);
+ if (default_value && default_value[0])
+ m_default_value.assign(default_value);
+ }
+
+ ~OptionValueString() override = default;
+
+ // Virtual subclass pure virtual overrides
+
+ OptionValue::Type GetType() const override { return eTypeString; }
+
+ void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) override;
+
+ Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign) override;
+ Status
+ SetValueFromString(const char *,
+ VarSetOperationType = eVarSetOperationAssign) = delete;
+
+ bool Clear() override {
+ m_current_value = m_default_value;
+ m_value_was_set = false;
+ return true;
+ }
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+ // Subclass specific functions
+
+ Flags &GetOptions() { return m_options; }
+
+ const Flags &GetOptions() const { return m_options; }
+
+ const char *operator=(const char *value) {
+ SetCurrentValue(llvm::StringRef::withNullAsEmpty(value));
+ return m_current_value.c_str();
+ }
+
+ const char *GetCurrentValue() const { return m_current_value.c_str(); }
+ llvm::StringRef GetCurrentValueAsRef() const { return m_current_value; }
+
+ const char *GetDefaultValue() const { return m_default_value.c_str(); }
+ llvm::StringRef GetDefaultValueAsRef() const { return m_default_value; }
+
+ Status SetCurrentValue(const char *) = delete;
+ Status SetCurrentValue(llvm::StringRef value);
+
+ Status AppendToCurrentValue(const char *value);
+
+ void SetDefaultValue(const char *value) {
+ if (value && value[0])
+ m_default_value.assign(value);
+ else
+ m_default_value.clear();
+ }
+
+ bool IsCurrentValueEmpty() const { return m_current_value.empty(); }
+
+ bool IsDefaultValueEmpty() const { return m_default_value.empty(); }
+
+protected:
+ std::string m_current_value;
+ std::string m_default_value;
+ Flags m_options;
+ ValidatorCallback m_validator;
+ void *m_validator_baton;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueString_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueUInt64.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueUInt64.h
new file mode 100644
index 0000000..5978cdb
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueUInt64.h
@@ -0,0 +1,82 @@
+//===-- OptionValueUInt64.h --------------------------------------*- C++
+//-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueUInt64_h_
+#define liblldb_OptionValueUInt64_h_
+
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueUInt64 : public OptionValue {
+public:
+ OptionValueUInt64() : OptionValue(), m_current_value(0), m_default_value(0) {}
+
+ OptionValueUInt64(uint64_t value)
+ : OptionValue(), m_current_value(value), m_default_value(value) {}
+
+ OptionValueUInt64(uint64_t current_value, uint64_t default_value)
+ : OptionValue(), m_current_value(current_value),
+ m_default_value(default_value) {}
+
+ ~OptionValueUInt64() override {}
+
+ // Decode a uint64_t from "value_cstr" return a OptionValueUInt64 object
+ // inside of a lldb::OptionValueSP object if all goes well. If the string
+ // isn't a uint64_t value or any other error occurs, return an empty
+ // lldb::OptionValueSP and fill error in with the correct stuff.
+ static lldb::OptionValueSP Create(const char *, Status &) = delete;
+ static lldb::OptionValueSP Create(llvm::StringRef value_str, Status &error);
+ // Virtual subclass pure virtual overrides
+
+ OptionValue::Type GetType() const override { return eTypeUInt64; }
+
+ void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) override;
+
+ Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign) override;
+ Status
+ SetValueFromString(const char *,
+ VarSetOperationType = eVarSetOperationAssign) = delete;
+
+ bool Clear() override {
+ m_current_value = m_default_value;
+ m_value_was_set = false;
+ return true;
+ }
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+ // Subclass specific functions
+
+ const uint64_t &operator=(uint64_t value) {
+ m_current_value = value;
+ return m_current_value;
+ }
+
+ operator uint64_t() const { return m_current_value; }
+
+ uint64_t GetCurrentValue() const { return m_current_value; }
+
+ uint64_t GetDefaultValue() const { return m_default_value; }
+
+ void SetCurrentValue(uint64_t value) { m_current_value = value; }
+
+ void SetDefaultValue(uint64_t value) { m_default_value = value; }
+
+protected:
+ uint64_t m_current_value;
+ uint64_t m_default_value;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueUInt64_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueUUID.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueUUID.h
new file mode 100644
index 0000000..7273e35
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueUUID.h
@@ -0,0 +1,64 @@
+//===-- OptionValueUUID.h --------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueUUID_h_
+#define liblldb_OptionValueUUID_h_
+
+#include "lldb/Utility/UUID.h"
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueUUID : public OptionValue {
+public:
+ OptionValueUUID() : OptionValue(), m_uuid() {}
+
+ OptionValueUUID(const UUID &uuid) : OptionValue(), m_uuid(uuid) {}
+
+ ~OptionValueUUID() override {}
+
+ // Virtual subclass pure virtual overrides
+
+ OptionValue::Type GetType() const override { return eTypeUUID; }
+
+ void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) override;
+
+ Status
+ SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op = eVarSetOperationAssign) override;
+ Status
+ SetValueFromString(const char *,
+ VarSetOperationType = eVarSetOperationAssign) = delete;
+
+ bool Clear() override {
+ m_uuid.Clear();
+ m_value_was_set = false;
+ return true;
+ }
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+ // Subclass specific functions
+
+ UUID &GetCurrentValue() { return m_uuid; }
+
+ const UUID &GetCurrentValue() const { return m_uuid; }
+
+ void SetCurrentValue(const UUID &value) { m_uuid = value; }
+
+ size_t AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
+
+protected:
+ UUID m_uuid;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueUUID_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValues.h b/linux-x64/clang/include/lldb/Interpreter/OptionValues.h
new file mode 100644
index 0000000..d90b286
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValues.h
@@ -0,0 +1,33 @@
+//===-- OptionValues.h ------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValues_h_
+#define liblldb_OptionValues_h_
+
+#include "lldb/Interpreter/OptionValue.h"
+#include "lldb/Interpreter/OptionValueArch.h"
+#include "lldb/Interpreter/OptionValueArgs.h"
+#include "lldb/Interpreter/OptionValueArray.h"
+#include "lldb/Interpreter/OptionValueBoolean.h"
+#include "lldb/Interpreter/OptionValueChar.h"
+#include "lldb/Interpreter/OptionValueDictionary.h"
+#include "lldb/Interpreter/OptionValueEnumeration.h"
+#include "lldb/Interpreter/OptionValueFileSpec.h"
+#include "lldb/Interpreter/OptionValueFileSpecList.h"
+#include "lldb/Interpreter/OptionValueFormat.h"
+#include "lldb/Interpreter/OptionValueFormatEntity.h"
+#include "lldb/Interpreter/OptionValueLanguage.h"
+#include "lldb/Interpreter/OptionValuePathMappings.h"
+#include "lldb/Interpreter/OptionValueProperties.h"
+#include "lldb/Interpreter/OptionValueRegex.h"
+#include "lldb/Interpreter/OptionValueSInt64.h"
+#include "lldb/Interpreter/OptionValueString.h"
+#include "lldb/Interpreter/OptionValueUInt64.h"
+#include "lldb/Interpreter/OptionValueUUID.h"
+
+#endif // liblldb_OptionValues_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/Options.h b/linux-x64/clang/include/lldb/Interpreter/Options.h
new file mode 100644
index 0000000..a008d51
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/Options.h
@@ -0,0 +1,338 @@
+//===-- Options.h -----------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_Options_h_
+#define liblldb_Options_h_
+
+#include <set>
+#include <vector>
+
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/CompletionRequest.h"
+#include "lldb/Utility/Status.h"
+#include "lldb/lldb-defines.h"
+#include "lldb/lldb-private.h"
+
+#include "llvm/ADT/ArrayRef.h"
+
+namespace lldb_private {
+
+struct Option;
+
+typedef std::vector<std::tuple<std::string, int, std::string>> OptionArgVector;
+typedef std::shared_ptr<OptionArgVector> OptionArgVectorSP;
+
+struct OptionArgElement {
+ enum { eUnrecognizedArg = -1, eBareDash = -2, eBareDoubleDash = -3 };
+
+ OptionArgElement(int defs_index, int pos, int arg_pos)
+ : opt_defs_index(defs_index), opt_pos(pos), opt_arg_pos(arg_pos) {}
+
+ int opt_defs_index;
+ int opt_pos;
+ int opt_arg_pos;
+};
+
+typedef std::vector<OptionArgElement> OptionElementVector;
+
+static inline bool isprint8(int ch) {
+ if (ch & 0xffffff00u)
+ return false;
+ return isprint(ch);
+}
+
+/// \class Options Options.h "lldb/Interpreter/Options.h"
+/// A command line option parsing protocol class.
+///
+/// Options is designed to be subclassed to contain all needed options for a
+/// given command. The options can be parsed by calling the Parse function.
+///
+/// The options are specified using the format defined for the libc options
+/// parsing function getopt_long_only: \code
+/// #include <getopt.h>
+/// int getopt_long_only(int argc, char * const *argv, const char
+/// *optstring, const struct option *longopts, int *longindex);
+/// \endcode
+///
+class Options {
+public:
+ Options();
+
+ virtual ~Options();
+
+ void BuildGetoptTable();
+
+ void BuildValidOptionSets();
+
+ uint32_t NumCommandOptions();
+
+ /// Get the option definitions to use when parsing Args options.
+ ///
+ /// \see Args::ParseOptions (Options&)
+ /// \see man getopt_long_only
+ Option *GetLongOptions();
+
+ // This gets passed the short option as an integer...
+ void OptionSeen(int short_option);
+
+ bool VerifyOptions(CommandReturnObject &result);
+
+ // Verify that the options given are in the options table and can be used
+ // together, but there may be some required options that are missing (used to
+ // verify options that get folded into command aliases).
+ bool VerifyPartialOptions(CommandReturnObject &result);
+
+ void OutputFormattedUsageText(Stream &strm,
+ const OptionDefinition &option_def,
+ uint32_t output_max_columns);
+
+ void GenerateOptionUsage(Stream &strm, CommandObject *cmd,
+ uint32_t screen_width);
+
+ bool SupportsLongOption(const char *long_option);
+
+ // The following two pure virtual functions must be defined by every class
+ // that inherits from this class.
+
+ virtual llvm::ArrayRef<OptionDefinition> GetDefinitions() {
+ return llvm::ArrayRef<OptionDefinition>();
+ }
+
+ // Call this prior to parsing any options. This call will call the subclass
+ // OptionParsingStarting() and will avoid the need for all
+ // OptionParsingStarting() function instances from having to call the
+ // Option::OptionParsingStarting() like they did before. This was error prone
+ // and subclasses shouldn't have to do it.
+ void NotifyOptionParsingStarting(ExecutionContext *execution_context);
+
+ /// Parse the provided arguments.
+ ///
+ /// The parsed options are set via calls to SetOptionValue. In case of a
+ /// successful parse, the function returns a copy of the input arguments
+ /// with the parsed options removed. Otherwise, it returns an error.
+ ///
+ /// param[in] platform_sp
+ /// The platform used for option validation. This is necessary
+ /// because an empty execution_context is not enough to get us
+ /// to a reasonable platform. If the platform isn't given,
+ /// we'll try to get it from the execution context. If we can't
+ /// get it from the execution context, we'll skip validation.
+ ///
+ /// param[in] require_validation
+ /// When true, it will fail option parsing if validation could
+ /// not occur due to not having a platform.
+ llvm::Expected<Args> Parse(const Args &args,
+ ExecutionContext *execution_context,
+ lldb::PlatformSP platform_sp,
+ bool require_validation);
+
+ llvm::Expected<Args> ParseAlias(const Args &args,
+ OptionArgVector *option_arg_vector,
+ std::string &input_line);
+
+ OptionElementVector ParseForCompletion(const Args &args,
+ uint32_t cursor_index);
+
+ Status NotifyOptionParsingFinished(ExecutionContext *execution_context);
+
+ /// Set the value of an option.
+ ///
+ /// \param[in] option_idx
+ /// The index into the "struct option" array that was returned
+ /// by Options::GetLongOptions().
+ ///
+ /// \param[in] option_arg
+ /// The argument value for the option that the user entered, or
+ /// nullptr if there is no argument for the current option.
+ ///
+ /// \param[in] execution_context
+ /// The execution context to use for evaluating the option.
+ /// May be nullptr if the option is to be evaluated outside any
+ /// particular context.
+ ///
+ /// \see Args::ParseOptions (Options&)
+ /// \see man getopt_long_only
+ virtual Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
+ ExecutionContext *execution_context) = 0;
+
+ /// Handles the generic bits of figuring out whether we are in an option,
+ /// and if so completing it.
+ ///
+ /// \param[in/out] request
+ /// The completion request that we need to act upon.
+ ///
+ /// \param[in] interpreter
+ /// The interpreter that's doing the completing.
+ ///
+ /// FIXME: This is the wrong return value, since we also need to
+ /// make a distinction between total number of matches, and the window the
+ /// user wants returned.
+ ///
+ /// \return
+ /// \btrue if we were in an option, \bfalse otherwise.
+ bool HandleOptionCompletion(lldb_private::CompletionRequest &request,
+ OptionElementVector &option_map,
+ CommandInterpreter &interpreter);
+
+ /// Handles the generic bits of figuring out whether we are in an option,
+ /// and if so completing it.
+ ///
+ /// \param[in/out] request
+ /// The completion request that we need to act upon.
+ ///
+ /// \param[in] interpreter
+ /// The command interpreter doing the completion.
+ ///
+ /// FIXME: This is the wrong return value, since we also need to
+ /// make a distinction between total number of matches, and the window the
+ /// user wants returned.
+ ///
+ /// \return
+ /// \btrue if we were in an option, \bfalse otherwise.
+ virtual bool
+ HandleOptionArgumentCompletion(lldb_private::CompletionRequest &request,
+ OptionElementVector &opt_element_vector,
+ int opt_element_index,
+ CommandInterpreter &interpreter);
+
+protected:
+ // This is a set of options expressed as indexes into the options table for
+ // this Option.
+ typedef std::set<int> OptionSet;
+ typedef std::vector<OptionSet> OptionSetVector;
+
+ std::vector<Option> m_getopt_table;
+ OptionSet m_seen_options;
+ OptionSetVector m_required_options;
+ OptionSetVector m_optional_options;
+
+ OptionSetVector &GetRequiredOptions() {
+ BuildValidOptionSets();
+ return m_required_options;
+ }
+
+ OptionSetVector &GetOptionalOptions() {
+ BuildValidOptionSets();
+ return m_optional_options;
+ }
+
+ bool IsASubset(const OptionSet &set_a, const OptionSet &set_b);
+
+ size_t OptionsSetDiff(const OptionSet &set_a, const OptionSet &set_b,
+ OptionSet &diffs);
+
+ void OptionsSetUnion(const OptionSet &set_a, const OptionSet &set_b,
+ OptionSet &union_set);
+
+ // Subclasses must reset their option values prior to starting a new option
+ // parse. Each subclass must override this function and revert all option
+ // settings to default values.
+ virtual void OptionParsingStarting(ExecutionContext *execution_context) = 0;
+
+ virtual Status OptionParsingFinished(ExecutionContext *execution_context) {
+ // If subclasses need to know when the options are done being parsed they
+ // can implement this function to do extra checking
+ Status error;
+ return error;
+ }
+};
+
+class OptionGroup {
+public:
+ OptionGroup() = default;
+
+ virtual ~OptionGroup() = default;
+
+ virtual llvm::ArrayRef<OptionDefinition> GetDefinitions() = 0;
+
+ virtual Status SetOptionValue(uint32_t option_idx,
+ llvm::StringRef option_value,
+ ExecutionContext *execution_context) = 0;
+
+ virtual void OptionParsingStarting(ExecutionContext *execution_context) = 0;
+
+ virtual Status OptionParsingFinished(ExecutionContext *execution_context) {
+ // If subclasses need to know when the options are done being parsed they
+ // can implement this function to do extra checking
+ Status error;
+ return error;
+ }
+};
+
+class OptionGroupOptions : public Options {
+public:
+ OptionGroupOptions()
+ : Options(), m_option_defs(), m_option_infos(), m_did_finalize(false) {}
+
+ ~OptionGroupOptions() override = default;
+
+ /// Append options from a OptionGroup class.
+ ///
+ /// Append all options from \a group using the exact same option groups that
+ /// each option is defined with.
+ ///
+ /// \param[in] group
+ /// A group of options to take option values from and copy their
+ /// definitions into this class.
+ void Append(OptionGroup *group);
+
+ /// Append options from a OptionGroup class.
+ ///
+ /// Append options from \a group that have a usage mask that has any bits in
+ /// "src_mask" set. After the option definition is copied into the options
+ /// definitions in this class, set the usage_mask to "dst_mask".
+ ///
+ /// \param[in] group
+ /// A group of options to take option values from and copy their
+ /// definitions into this class.
+ ///
+ /// \param[in] src_mask
+ /// When copying options from \a group, you might only want some of
+ /// the options to be appended to this group. This mask allows you
+ /// to control which options from \a group get added. It also allows
+ /// you to specify the same options from \a group multiple times
+ /// for different option sets.
+ ///
+ /// \param[in] dst_mask
+ /// Set the usage mask for any copied options to \a dst_mask after
+ /// copying the option definition.
+ void Append(OptionGroup *group, uint32_t src_mask, uint32_t dst_mask);
+
+ void Finalize();
+
+ bool DidFinalize() { return m_did_finalize; }
+
+ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
+ ExecutionContext *execution_context) override;
+
+ void OptionParsingStarting(ExecutionContext *execution_context) override;
+
+ Status OptionParsingFinished(ExecutionContext *execution_context) override;
+
+ llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
+ assert(m_did_finalize);
+ return m_option_defs;
+ }
+
+ const OptionGroup *GetGroupWithOption(char short_opt);
+
+ struct OptionInfo {
+ OptionInfo(OptionGroup *g, uint32_t i) : option_group(g), option_index(i) {}
+ OptionGroup *option_group; // The group that this option came from
+ uint32_t option_index; // The original option index from the OptionGroup
+ };
+ typedef std::vector<OptionInfo> OptionInfos;
+
+ std::vector<OptionDefinition> m_option_defs;
+ OptionInfos m_option_infos;
+ bool m_did_finalize;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_Options_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/Property.h b/linux-x64/clang/include/lldb/Interpreter/Property.h
new file mode 100644
index 0000000..797aee4
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/Property.h
@@ -0,0 +1,79 @@
+//===-- Property.h ----------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_Property_h_
+#define liblldb_Property_h_
+
+#include "lldb/Interpreter/OptionValue.h"
+#include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/Flags.h"
+#include "lldb/lldb-defines.h"
+#include "lldb/lldb-private-types.h"
+
+#include <string>
+
+namespace lldb_private {
+
+// A structure that can be used to create a global table for all properties.
+// Property class instances can be constructed using one of these.
+struct PropertyDefinition {
+ const char *name;
+ OptionValue::Type type;
+ bool global; // false == this setting is a global setting by default
+ uintptr_t default_uint_value;
+ const char *default_cstr_value;
+ OptionEnumValues enum_values;
+ const char *description;
+};
+
+using PropertyDefinitions = llvm::ArrayRef<PropertyDefinition>;
+
+class Property {
+public:
+ Property(const PropertyDefinition &definition);
+
+ Property(ConstString name, ConstString desc, bool is_global,
+ const lldb::OptionValueSP &value_sp);
+
+ llvm::StringRef GetName() const { return m_name.GetStringRef(); }
+ llvm::StringRef GetDescription() const {
+ return m_description.GetStringRef();
+ }
+
+ const lldb::OptionValueSP &GetValue() const { return m_value_sp; }
+
+ void SetOptionValue(const lldb::OptionValueSP &value_sp) {
+ m_value_sp = value_sp;
+ }
+
+ bool IsValid() const { return (bool)m_value_sp; }
+
+ bool IsGlobal() const { return m_is_global; }
+
+ void Dump(const ExecutionContext *exe_ctx, Stream &strm,
+ uint32_t dump_mask) const;
+
+ bool DumpQualifiedName(Stream &strm) const;
+
+ void DumpDescription(CommandInterpreter &interpreter, Stream &strm,
+ uint32_t output_width,
+ bool display_qualified_name) const;
+
+ void SetValueChangedCallback(OptionValueChangedCallback callback,
+ void *baton);
+
+protected:
+ ConstString m_name;
+ ConstString m_description;
+ lldb::OptionValueSP m_value_sp;
+ bool m_is_global;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_Property_h_
diff --git a/linux-x64/clang/include/lldb/Interpreter/ScriptInterpreter.h b/linux-x64/clang/include/lldb/Interpreter/ScriptInterpreter.h
new file mode 100644
index 0000000..c8fa390
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/ScriptInterpreter.h
@@ -0,0 +1,477 @@
+//===-- ScriptInterpreter.h -------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_ScriptInterpreter_h_
+#define liblldb_ScriptInterpreter_h_
+
+#include "lldb/lldb-private.h"
+
+#include "lldb/Breakpoint/BreakpointOptions.h"
+#include "lldb/Core/PluginInterface.h"
+#include "lldb/Core/SearchFilter.h"
+#include "lldb/Utility/Broadcaster.h"
+#include "lldb/Utility/Status.h"
+#include "lldb/Utility/StructuredData.h"
+
+#include "lldb/Host/PseudoTerminal.h"
+
+namespace lldb_private {
+
+class ScriptInterpreterLocker {
+public:
+ ScriptInterpreterLocker() = default;
+
+ virtual ~ScriptInterpreterLocker() = default;
+
+private:
+ DISALLOW_COPY_AND_ASSIGN(ScriptInterpreterLocker);
+};
+
+class ScriptInterpreter : public PluginInterface {
+public:
+ enum ScriptReturnType {
+ eScriptReturnTypeCharPtr,
+ eScriptReturnTypeBool,
+ eScriptReturnTypeShortInt,
+ eScriptReturnTypeShortIntUnsigned,
+ eScriptReturnTypeInt,
+ eScriptReturnTypeIntUnsigned,
+ eScriptReturnTypeLongInt,
+ eScriptReturnTypeLongIntUnsigned,
+ eScriptReturnTypeLongLong,
+ eScriptReturnTypeLongLongUnsigned,
+ eScriptReturnTypeFloat,
+ eScriptReturnTypeDouble,
+ eScriptReturnTypeChar,
+ eScriptReturnTypeCharStrOrNone,
+ eScriptReturnTypeOpaqueObject
+ };
+
+ ScriptInterpreter(Debugger &debugger, lldb::ScriptLanguage script_lang);
+
+ ~ScriptInterpreter() override;
+
+ struct ExecuteScriptOptions {
+ public:
+ ExecuteScriptOptions()
+ : m_enable_io(true), m_set_lldb_globals(true), m_maskout_errors(true) {}
+
+ bool GetEnableIO() const { return m_enable_io; }
+
+ bool GetSetLLDBGlobals() const { return m_set_lldb_globals; }
+
+ bool GetMaskoutErrors() const { return m_maskout_errors; }
+
+ ExecuteScriptOptions &SetEnableIO(bool enable) {
+ m_enable_io = enable;
+ return *this;
+ }
+
+ ExecuteScriptOptions &SetSetLLDBGlobals(bool set) {
+ m_set_lldb_globals = set;
+ return *this;
+ }
+
+ ExecuteScriptOptions &SetMaskoutErrors(bool maskout) {
+ m_maskout_errors = maskout;
+ return *this;
+ }
+
+ private:
+ bool m_enable_io;
+ bool m_set_lldb_globals;
+ bool m_maskout_errors;
+ };
+
+ virtual bool Interrupt() { return false; }
+
+ virtual bool ExecuteOneLine(
+ llvm::StringRef command, CommandReturnObject *result,
+ const ExecuteScriptOptions &options = ExecuteScriptOptions()) = 0;
+
+ virtual void ExecuteInterpreterLoop() = 0;
+
+ virtual bool ExecuteOneLineWithReturn(
+ llvm::StringRef in_string, ScriptReturnType return_type, void *ret_value,
+ const ExecuteScriptOptions &options = ExecuteScriptOptions()) {
+ return true;
+ }
+
+ virtual Status ExecuteMultipleLines(
+ const char *in_string,
+ const ExecuteScriptOptions &options = ExecuteScriptOptions()) {
+ Status error;
+ error.SetErrorString("not implemented");
+ return error;
+ }
+
+ virtual Status
+ ExportFunctionDefinitionToInterpreter(StringList &function_def) {
+ Status error;
+ error.SetErrorString("not implemented");
+ return error;
+ }
+
+ virtual Status GenerateBreakpointCommandCallbackData(StringList &input,
+ std::string &output) {
+ Status error;
+ error.SetErrorString("not implemented");
+ return error;
+ }
+
+ virtual bool GenerateWatchpointCommandCallbackData(StringList &input,
+ std::string &output) {
+ return false;
+ }
+
+ virtual bool GenerateTypeScriptFunction(const char *oneliner,
+ std::string &output,
+ const void *name_token = nullptr) {
+ return false;
+ }
+
+ virtual bool GenerateTypeScriptFunction(StringList &input,
+ std::string &output,
+ const void *name_token = nullptr) {
+ return false;
+ }
+
+ virtual bool GenerateScriptAliasFunction(StringList &input,
+ std::string &output) {
+ return false;
+ }
+
+ virtual bool GenerateTypeSynthClass(StringList &input, std::string &output,
+ const void *name_token = nullptr) {
+ return false;
+ }
+
+ virtual bool GenerateTypeSynthClass(const char *oneliner, std::string &output,
+ const void *name_token = nullptr) {
+ return false;
+ }
+
+ virtual StructuredData::ObjectSP
+ CreateSyntheticScriptedProvider(const char *class_name,
+ lldb::ValueObjectSP valobj) {
+ return StructuredData::ObjectSP();
+ }
+
+ virtual StructuredData::GenericSP
+ CreateScriptCommandObject(const char *class_name) {
+ return StructuredData::GenericSP();
+ }
+
+ virtual StructuredData::GenericSP
+ CreateFrameRecognizer(const char *class_name) {
+ return StructuredData::GenericSP();
+ }
+
+ virtual lldb::ValueObjectListSP GetRecognizedArguments(
+ const StructuredData::ObjectSP &implementor,
+ lldb::StackFrameSP frame_sp) {
+ return lldb::ValueObjectListSP();
+ }
+
+ virtual StructuredData::GenericSP
+ OSPlugin_CreatePluginObject(const char *class_name,
+ lldb::ProcessSP process_sp) {
+ return StructuredData::GenericSP();
+ }
+
+ virtual StructuredData::DictionarySP
+ OSPlugin_RegisterInfo(StructuredData::ObjectSP os_plugin_object_sp) {
+ return StructuredData::DictionarySP();
+ }
+
+ virtual StructuredData::ArraySP
+ OSPlugin_ThreadsInfo(StructuredData::ObjectSP os_plugin_object_sp) {
+ return StructuredData::ArraySP();
+ }
+
+ virtual StructuredData::StringSP
+ OSPlugin_RegisterContextData(StructuredData::ObjectSP os_plugin_object_sp,
+ lldb::tid_t thread_id) {
+ return StructuredData::StringSP();
+ }
+
+ virtual StructuredData::DictionarySP
+ OSPlugin_CreateThread(StructuredData::ObjectSP os_plugin_object_sp,
+ lldb::tid_t tid, lldb::addr_t context) {
+ return StructuredData::DictionarySP();
+ }
+
+ virtual StructuredData::ObjectSP
+ CreateScriptedThreadPlan(const char *class_name,
+ lldb::ThreadPlanSP thread_plan_sp) {
+ return StructuredData::ObjectSP();
+ }
+
+ virtual bool
+ ScriptedThreadPlanExplainsStop(StructuredData::ObjectSP implementor_sp,
+ Event *event, bool &script_error) {
+ script_error = true;
+ return true;
+ }
+
+ virtual bool
+ ScriptedThreadPlanShouldStop(StructuredData::ObjectSP implementor_sp,
+ Event *event, bool &script_error) {
+ script_error = true;
+ return true;
+ }
+
+ virtual bool
+ ScriptedThreadPlanIsStale(StructuredData::ObjectSP implementor_sp,
+ bool &script_error) {
+ script_error = true;
+ return true;
+ }
+
+ virtual lldb::StateType
+ ScriptedThreadPlanGetRunState(StructuredData::ObjectSP implementor_sp,
+ bool &script_error) {
+ script_error = true;
+ return lldb::eStateStepping;
+ }
+
+ virtual StructuredData::GenericSP
+ CreateScriptedBreakpointResolver(const char *class_name,
+ StructuredDataImpl *args_data,
+ lldb::BreakpointSP &bkpt_sp) {
+ return StructuredData::GenericSP();
+ }
+
+ virtual bool
+ ScriptedBreakpointResolverSearchCallback(StructuredData::GenericSP implementor_sp,
+ SymbolContext *sym_ctx)
+ {
+ return false;
+ }
+
+ virtual lldb::SearchDepth
+ ScriptedBreakpointResolverSearchDepth(StructuredData::GenericSP implementor_sp)
+ {
+ return lldb::eSearchDepthModule;
+ }
+
+ virtual StructuredData::ObjectSP
+ LoadPluginModule(const FileSpec &file_spec, lldb_private::Status &error) {
+ return StructuredData::ObjectSP();
+ }
+
+ virtual StructuredData::DictionarySP
+ GetDynamicSettings(StructuredData::ObjectSP plugin_module_sp, Target *target,
+ const char *setting_name, lldb_private::Status &error) {
+ return StructuredData::DictionarySP();
+ }
+
+ virtual Status GenerateFunction(const char *signature,
+ const StringList &input) {
+ Status error;
+ error.SetErrorString("unimplemented");
+ return error;
+ }
+
+ virtual void CollectDataForBreakpointCommandCallback(
+ std::vector<BreakpointOptions *> &options, CommandReturnObject &result);
+
+ virtual void
+ CollectDataForWatchpointCommandCallback(WatchpointOptions *wp_options,
+ CommandReturnObject &result);
+
+ /// Set the specified text as the callback for the breakpoint.
+ Status
+ SetBreakpointCommandCallback(std::vector<BreakpointOptions *> &bp_options_vec,
+ const char *callback_text);
+
+ virtual Status SetBreakpointCommandCallback(BreakpointOptions *bp_options,
+ const char *callback_text) {
+ Status error;
+ error.SetErrorString("unimplemented");
+ return error;
+ }
+
+ /// This one is for deserialization:
+ virtual Status SetBreakpointCommandCallback(
+ BreakpointOptions *bp_options,
+ std::unique_ptr<BreakpointOptions::CommandData> &data_up) {
+ Status error;
+ error.SetErrorString("unimplemented");
+ return error;
+ }
+
+ void SetBreakpointCommandCallbackFunction(
+ std::vector<BreakpointOptions *> &bp_options_vec,
+ const char *function_name);
+
+ /// Set a one-liner as the callback for the breakpoint.
+ virtual void
+ SetBreakpointCommandCallbackFunction(BreakpointOptions *bp_options,
+ const char *function_name) {}
+
+ /// Set a one-liner as the callback for the watchpoint.
+ virtual void SetWatchpointCommandCallback(WatchpointOptions *wp_options,
+ const char *oneliner) {}
+
+ virtual bool GetScriptedSummary(const char *function_name,
+ lldb::ValueObjectSP valobj,
+ StructuredData::ObjectSP &callee_wrapper_sp,
+ const TypeSummaryOptions &options,
+ std::string &retval) {
+ return false;
+ }
+
+ virtual void Clear() {
+ // Clean up any ref counts to SBObjects that might be in global variables
+ }
+
+ virtual size_t
+ CalculateNumChildren(const StructuredData::ObjectSP &implementor,
+ uint32_t max) {
+ return 0;
+ }
+
+ virtual lldb::ValueObjectSP
+ GetChildAtIndex(const StructuredData::ObjectSP &implementor, uint32_t idx) {
+ return lldb::ValueObjectSP();
+ }
+
+ virtual int
+ GetIndexOfChildWithName(const StructuredData::ObjectSP &implementor,
+ const char *child_name) {
+ return UINT32_MAX;
+ }
+
+ virtual bool
+ UpdateSynthProviderInstance(const StructuredData::ObjectSP &implementor) {
+ return false;
+ }
+
+ virtual bool MightHaveChildrenSynthProviderInstance(
+ const StructuredData::ObjectSP &implementor) {
+ return true;
+ }
+
+ virtual lldb::ValueObjectSP
+ GetSyntheticValue(const StructuredData::ObjectSP &implementor) {
+ return nullptr;
+ }
+
+ virtual ConstString
+ GetSyntheticTypeName(const StructuredData::ObjectSP &implementor) {
+ return ConstString();
+ }
+
+ virtual bool
+ RunScriptBasedCommand(const char *impl_function, llvm::StringRef args,
+ ScriptedCommandSynchronicity synchronicity,
+ lldb_private::CommandReturnObject &cmd_retobj,
+ Status &error,
+ const lldb_private::ExecutionContext &exe_ctx) {
+ return false;
+ }
+
+ virtual bool RunScriptBasedCommand(
+ StructuredData::GenericSP impl_obj_sp, llvm::StringRef args,
+ ScriptedCommandSynchronicity synchronicity,
+ lldb_private::CommandReturnObject &cmd_retobj, Status &error,
+ const lldb_private::ExecutionContext &exe_ctx) {
+ return false;
+ }
+
+ virtual bool RunScriptFormatKeyword(const char *impl_function,
+ Process *process, std::string &output,
+ Status &error) {
+ error.SetErrorString("unimplemented");
+ return false;
+ }
+
+ virtual bool RunScriptFormatKeyword(const char *impl_function, Thread *thread,
+ std::string &output, Status &error) {
+ error.SetErrorString("unimplemented");
+ return false;
+ }
+
+ virtual bool RunScriptFormatKeyword(const char *impl_function, Target *target,
+ std::string &output, Status &error) {
+ error.SetErrorString("unimplemented");
+ return false;
+ }
+
+ virtual bool RunScriptFormatKeyword(const char *impl_function,
+ StackFrame *frame, std::string &output,
+ Status &error) {
+ error.SetErrorString("unimplemented");
+ return false;
+ }
+
+ virtual bool RunScriptFormatKeyword(const char *impl_function,
+ ValueObject *value, std::string &output,
+ Status &error) {
+ error.SetErrorString("unimplemented");
+ return false;
+ }
+
+ virtual bool GetDocumentationForItem(const char *item, std::string &dest) {
+ dest.clear();
+ return false;
+ }
+
+ virtual bool
+ GetShortHelpForCommandObject(StructuredData::GenericSP cmd_obj_sp,
+ std::string &dest) {
+ dest.clear();
+ return false;
+ }
+
+ virtual uint32_t
+ GetFlagsForCommandObject(StructuredData::GenericSP cmd_obj_sp) {
+ return 0;
+ }
+
+ virtual bool GetLongHelpForCommandObject(StructuredData::GenericSP cmd_obj_sp,
+ std::string &dest) {
+ dest.clear();
+ return false;
+ }
+
+ virtual bool CheckObjectExists(const char *name) { return false; }
+
+ virtual bool
+ LoadScriptingModule(const char *filename, bool can_reload, bool init_session,
+ lldb_private::Status &error,
+ StructuredData::ObjectSP *module_sp = nullptr) {
+ error.SetErrorString("loading unimplemented");
+ return false;
+ }
+
+ virtual bool IsReservedWord(const char *word) { return false; }
+
+ virtual std::unique_ptr<ScriptInterpreterLocker> AcquireInterpreterLock();
+
+ const char *GetScriptInterpreterPtyName();
+
+ int GetMasterFileDescriptor();
+
+ static std::string LanguageToString(lldb::ScriptLanguage language);
+
+ static lldb::ScriptLanguage StringToLanguage(const llvm::StringRef &string);
+
+ virtual void ResetOutputFileHandle(FILE *new_fh) {} // By default, do nothing.
+
+ lldb::ScriptLanguage GetLanguage() { return m_script_lang; }
+
+protected:
+ Debugger &m_debugger;
+ lldb::ScriptLanguage m_script_lang;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_ScriptInterpreter_h_