Update prebuilt Clang to r416183b from Android.
https://android.googlesource.com/platform/prebuilts/clang/host/
linux-x86/+/06a71ddac05c22edb2d10b590e1769b3f8619bef
clang 12.0.5 (based on r416183b) from build 7284624.
Change-Id: I277a316abcf47307562d8b748b84870f31a72866
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/linux-x64/clang/include/lldb/Interpreter/CommandAlias.h b/linux-x64/clang/include/lldb/Interpreter/CommandAlias.h
index c2a7a38..26826db 100644
--- a/linux-x64/clang/include/lldb/Interpreter/CommandAlias.h
+++ b/linux-x64/clang/include/lldb/Interpreter/CommandAlias.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_CommandAlias_h_
-#define liblldb_CommandAlias_h_
+#ifndef LLDB_INTERPRETER_COMMANDALIAS_H
+#define LLDB_INTERPRETER_COMMANDALIAS_H
#include <memory>
@@ -36,11 +36,11 @@
bool WantsCompletion() override;
- int HandleCompletion(CompletionRequest &request) override;
+ void HandleCompletion(CompletionRequest &request) override;
- int HandleArgumentCompletion(
- CompletionRequest &request,
- OptionElementVector &opt_element_vector) override;
+ void
+ HandleArgumentCompletion(CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override;
Options *GetOptions() override;
@@ -81,4 +81,4 @@
};
} // namespace lldb_private
-#endif // liblldb_CommandAlias_h_
+#endif // LLDB_INTERPRETER_COMMANDALIAS_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/CommandCompletions.h b/linux-x64/clang/include/lldb/Interpreter/CommandCompletions.h
index 3d09db5..c80bde0 100644
--- a/linux-x64/clang/include/lldb/Interpreter/CommandCompletions.h
+++ b/linux-x64/clang/include/lldb/Interpreter/CommandCompletions.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef lldb_CommandCompletions_h_
-#define lldb_CommandCompletions_h_
+#ifndef LLDB_INTERPRETER_COMMANDCOMPLETIONS_H
+#define LLDB_INTERPRETER_COMMANDCOMPLETIONS_H
#include <set>
@@ -23,13 +23,6 @@
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),
@@ -41,15 +34,26 @@
ePlatformPluginCompletion = (1u << 6),
eArchitectureCompletion = (1u << 7),
eVariablePathCompletion = (1u << 8),
+ eRegisterCompletion = (1u << 9),
+ eBreakpointCompletion = (1u << 10),
+ eProcessPluginCompletion = (1u << 11),
+ eDisassemblyFlavorCompletion = (1u << 12),
+ eTypeLanguageCompletion = (1u << 13),
+ eFrameIndexCompletion = (1u << 14),
+ eModuleUUIDCompletion = (1u << 15),
+ eStopHookIDCompletion = (1u << 16),
+ eThreadIndexCompletion = (1u << 17),
+ eWatchPointIDCompletion = (1u << 18),
+ eBreakpointNameCompletion = (1u << 19),
+ eProcessIDCompletion = (1u << 20),
+ eProcessNameCompletion = (1u << 21),
+ eRemoteDiskFileCompletion = (1u << 22),
+ eRemoteDiskDirectoryCompletion = (1u << 23),
+ eTypeCategoryNameCompletion = (1u << 24),
// 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;
+ eCustomCompletion = (1u << 24)
};
static bool InvokeCommonCompletionCallbacks(
@@ -57,147 +61,98 @@
lldb_private::CompletionRequest &request, SearchFilter *searcher);
// These are the generic completer functions:
- static int DiskFiles(CommandInterpreter &interpreter,
- CompletionRequest &request, SearchFilter *searcher);
+ static void DiskFiles(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
- static int DiskFiles(const llvm::Twine &partial_file_name,
- StringList &matches, TildeExpressionResolver &Resolver);
+ static void DiskFiles(const llvm::Twine &partial_file_name,
+ StringList &matches, TildeExpressionResolver &Resolver);
- static int DiskDirectories(CommandInterpreter &interpreter,
- CompletionRequest &request,
- SearchFilter *searcher);
+ static void DiskDirectories(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher);
- static int DiskDirectories(const llvm::Twine &partial_file_name,
- StringList &matches,
- TildeExpressionResolver &Resolver);
+ static void DiskDirectories(const llvm::Twine &partial_file_name,
+ StringList &matches,
+ TildeExpressionResolver &Resolver);
- static int SourceFiles(CommandInterpreter &interpreter,
- CompletionRequest &request, SearchFilter *searcher);
+ static void RemoteDiskFiles(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher);
- static int Modules(CommandInterpreter &interpreter,
- CompletionRequest &request, SearchFilter *searcher);
+ static void RemoteDiskDirectories(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher);
- static int Symbols(CommandInterpreter &interpreter,
- CompletionRequest &request, SearchFilter *searcher);
+ static void SourceFiles(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
- static int SettingsNames(CommandInterpreter &interpreter,
+ static void Modules(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
+
+ static void ModuleUUIDs(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
+
+ static void Symbols(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
+
+ static void SettingsNames(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
+
+ static void PlatformPluginNames(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher);
+
+ static void ArchitectureNames(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher);
+
+ static void VariablePath(CommandInterpreter &interpreter,
CompletionRequest &request, SearchFilter *searcher);
- static int PlatformPluginNames(CommandInterpreter &interpreter,
+ static void Registers(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
+
+ static void Breakpoints(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
+
+ static void BreakpointNames(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher);
+
+ static void ProcessPluginNames(CommandInterpreter &interpreter,
CompletionRequest &request,
SearchFilter *searcher);
- static int ArchitectureNames(CommandInterpreter &interpreter,
- CompletionRequest &request,
- SearchFilter *searcher);
+ static void ProcessIDs(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
- static int VariablePath(CommandInterpreter &interpreter,
+ static void ProcessNames(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
+
+ static void DisassemblyFlavors(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher);
+
+ static void TypeLanguages(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
+
+ static void FrameIndexes(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
+
+ static void StopHookIDs(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);
+ static void ThreadIndexes(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
- ~Completer() override;
+ static void WatchPointIDs(CommandInterpreter &interpreter,
+ CompletionRequest &request, SearchFilter *searcher);
- 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[];
+ static void TypeCategoryNames(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher);
};
} // namespace lldb_private
-#endif // lldb_CommandCompletions_h_
+#endif // LLDB_INTERPRETER_COMMANDCOMPLETIONS_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/CommandHistory.h b/linux-x64/clang/include/lldb/Interpreter/CommandHistory.h
index c1386f8..fbb4224 100644
--- a/linux-x64/clang/include/lldb/Interpreter/CommandHistory.h
+++ b/linux-x64/clang/include/lldb/Interpreter/CommandHistory.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_CommandHistory_h_
-#define liblldb_CommandHistory_h_
+#ifndef LLDB_INTERPRETER_COMMANDHISTORY_H
+#define LLDB_INTERPRETER_COMMANDHISTORY_H
#include <mutex>
#include <string>
@@ -46,7 +46,8 @@
static const char g_repeat_char = '!';
private:
- DISALLOW_COPY_AND_ASSIGN(CommandHistory);
+ CommandHistory(const CommandHistory &) = delete;
+ const CommandHistory &operator=(const CommandHistory &) = delete;
typedef std::vector<std::string> History;
mutable std::recursive_mutex m_mutex;
@@ -55,4 +56,4 @@
} // namespace lldb_private
-#endif // liblldb_CommandHistory_h_
+#endif // LLDB_INTERPRETER_COMMANDHISTORY_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/CommandInterpreter.h b/linux-x64/clang/include/lldb/Interpreter/CommandInterpreter.h
index c3dd660..c4f9dd2 100644
--- a/linux-x64/clang/include/lldb/Interpreter/CommandInterpreter.h
+++ b/linux-x64/clang/include/lldb/Interpreter/CommandInterpreter.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_CommandInterpreter_h_
-#define liblldb_CommandInterpreter_h_
+#ifndef LLDB_INTERPRETER_COMMANDINTERPRETER_H
+#define LLDB_INTERPRETER_COMMANDINTERPRETER_H
#include "lldb/Core/Debugger.h"
#include "lldb/Core/IOHandler.h"
@@ -20,12 +20,39 @@
#include "lldb/Utility/CompletionRequest.h"
#include "lldb/Utility/Event.h"
#include "lldb/Utility/Log.h"
+#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/StringList.h"
#include "lldb/lldb-forward.h"
#include "lldb/lldb-private.h"
#include <mutex>
namespace lldb_private {
+class CommandInterpreter;
+
+class CommandInterpreterRunResult {
+public:
+ CommandInterpreterRunResult()
+ : m_num_errors(0), m_result(lldb::eCommandInterpreterResultSuccess) {}
+
+ uint32_t GetNumErrors() const { return m_num_errors; }
+
+ lldb::CommandInterpreterResult GetResult() const { return m_result; }
+
+ bool IsResult(lldb::CommandInterpreterResult result) {
+ return m_result == result;
+ }
+
+protected:
+ friend CommandInterpreter;
+
+ void IncrementNumberOfErrors() { m_num_errors++; }
+
+ void SetResult(lldb::CommandInterpreterResult result) { m_result = result; }
+
+private:
+ int m_num_errors;
+ lldb::CommandInterpreterResult m_result;
+};
class CommandInterpreterRunOptions {
public:
@@ -51,7 +78,7 @@
/// \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.
+ /// if 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.
@@ -144,6 +171,20 @@
m_add_to_history = add_to_history ? eLazyBoolYes : eLazyBoolNo;
}
+ bool GetAutoHandleEvents() const {
+ return DefaultToYes(m_auto_handle_events);
+ }
+
+ void SetAutoHandleEvents(bool auto_handle_events) {
+ m_auto_handle_events = auto_handle_events ? eLazyBoolYes : eLazyBoolNo;
+ }
+
+ bool GetSpawnThread() const { return DefaultToNo(m_spawn_thread); }
+
+ void SetSpawnThread(bool spawn_thread) {
+ m_spawn_thread = spawn_thread ? eLazyBoolYes : eLazyBoolNo;
+ }
+
LazyBool m_stop_on_continue;
LazyBool m_stop_on_error;
LazyBool m_stop_on_crash;
@@ -152,6 +193,8 @@
LazyBool m_print_results;
LazyBool m_print_errors;
LazyBool m_add_to_history;
+ LazyBool m_auto_handle_events;
+ LazyBool m_spawn_thread;
private:
static bool DefaultToYes(LazyBool flag) {
@@ -213,7 +256,7 @@
}
void SourceInitFileCwd(CommandReturnObject &result);
- void SourceInitFileHome(CommandReturnObject &result);
+ void SourceInitFileHome(CommandReturnObject &result, bool is_repl = false);
bool AddCommand(llvm::StringRef name, const lldb::CommandObjectSP &cmd_sp,
bool can_replace);
@@ -222,7 +265,7 @@
bool can_replace);
lldb::CommandObjectSP GetCommandSPExact(llvm::StringRef cmd,
- bool include_aliases) const;
+ bool include_aliases = false) const;
CommandObject *GetCommandObject(llvm::StringRef cmd,
StringList *matches = nullptr,
@@ -308,31 +351,16 @@
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);
+ /// Returns the auto-suggestion string that should be added to the given
+ /// command line.
+ llvm::Optional<std::string> GetAutoSuggestionForCommand(llvm::StringRef line);
- // 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);
+ // This handles command line completion.
+ void HandleCompletion(CompletionRequest &request);
+
+ // 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.
+ void HandleCompletionMatches(CompletionRequest &request);
int GetCommandNamesMatchingPartialString(const char *cmd_cstr,
bool include_aliases,
@@ -445,15 +473,16 @@
bool IsActive();
- void RunCommandInterpreter(bool auto_handle_events, bool spawn_thread,
- CommandInterpreterRunOptions &options);
+ CommandInterpreterRunResult
+ RunCommandInterpreter(CommandInterpreterRunOptions &options);
+
void GetLLDBCommandsFromIOHandler(const char *prompt,
IOHandlerDelegate &delegate,
- bool asynchronously, void *baton);
+ void *baton = nullptr);
void GetPythonCommandsFromIOHandler(const char *prompt,
IOHandlerDelegate &delegate,
- bool asynchronously, void *baton);
+ void *baton = nullptr);
const char *GetCommandPrefix();
@@ -461,14 +490,26 @@
bool GetExpandRegexAliases() const;
bool GetPromptOnQuit() const;
+ void SetPromptOnQuit(bool enable);
- void SetPromptOnQuit(bool b);
+ bool GetSaveSessionOnQuit() const;
+ void SetSaveSessionOnQuit(bool enable);
bool GetEchoCommands() const;
- void SetEchoCommands(bool b);
+ void SetEchoCommands(bool enable);
bool GetEchoCommentCommands() const;
- void SetEchoCommentCommands(bool b);
+ void SetEchoCommentCommands(bool enable);
+
+ const CommandObject::CommandMap &GetUserCommands() const {
+ return m_user_dict;
+ }
+
+ const CommandObject::CommandMap &GetCommands() const {
+ return m_command_dict;
+ }
+
+ const CommandObject::CommandMap &GetAliases() const { return m_alias_dict; }
/// Specify if the command interpreter should allow that the user can
/// specify a custom exit code when calling 'quit'.
@@ -492,18 +533,26 @@
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;
+ /// Save the current debugger session transcript to a file on disk.
+ /// \param output_file
+ /// The file path to which the session transcript will be written. Since
+ /// the argument is optional, an arbitrary temporary file will be create
+ /// when no argument is passed.
+ /// \param result
+ /// This is used to pass function output and error messages.
+ /// \return \b true if the session transcript was successfully written to
+ /// disk, \b false otherwise.
+ bool SaveTranscript(CommandReturnObject &result,
+ llvm::Optional<std::string> output_file = llvm::None);
+
+ FileSpec GetCurrentSourceDir();
+
protected:
friend class Debugger;
@@ -519,7 +568,9 @@
bool IOHandlerInterrupt(IOHandler &io_handler) override;
- size_t GetProcessOutput();
+ void GetProcessOutput();
+
+ bool DidProcessStopAbnormally() const;
void SetSynchronous(bool value);
@@ -588,19 +639,25 @@
ChildrenTruncatedWarningStatus m_truncation_warning; // Whether we truncated
// children and whether
// the user has been told
+
+ // FIXME: Stop using this to control adding to the history and then replace
+ // this with m_command_source_dirs.size().
uint32_t m_command_source_depth;
+ /// A stack of directory paths. When not empty, the last one is the directory
+ /// of the file that's currently sourced.
+ std::vector<FileSpec> m_command_source_dirs;
std::vector<uint32_t> m_command_source_flags;
- uint32_t m_num_errors;
- bool m_quit_requested;
- bool m_stopped_for_crash;
+ CommandInterpreterRunResult m_result;
// 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;
+
+ StreamString m_transcript_stream;
};
} // namespace lldb_private
-#endif // liblldb_CommandInterpreter_h_
+#endif // LLDB_INTERPRETER_COMMANDINTERPRETER_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/CommandObject.h b/linux-x64/clang/include/lldb/Interpreter/CommandObject.h
index 31f7f12..d5ad969 100644
--- a/linux-x64/clang/include/lldb/Interpreter/CommandObject.h
+++ b/linux-x64/clang/include/lldb/Interpreter/CommandObject.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_CommandObject_h_
-#define liblldb_CommandObject_h_
+#ifndef LLDB_INTERPRETER_COMMANDOBJECT_H
+#define LLDB_INTERPRETER_COMMANDOBJECT_H
#include <map>
#include <string>
@@ -40,7 +40,7 @@
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)) {
+ if (add_all || (iter->first.find(std::string(cmd_str), 0) == 0)) {
++number_added;
matches.AppendString(iter->first.c_str());
if (descriptions)
@@ -90,14 +90,15 @@
{
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.
- {}
+ /// This arg might be associated only with some particular option set(s). By
+ /// default the arg associates to all option sets.
+ uint32_t arg_opt_set_association;
+
+ CommandArgumentData(lldb::CommandArgumentType type = lldb::eArgTypeNone,
+ ArgumentRepetitionType repetition = eArgRepeatPlain,
+ uint32_t opt_set = LLDB_OPT_SET_ALL)
+ : arg_type(type), arg_repetition(repetition),
+ arg_opt_set_association(opt_set) {}
};
typedef std::vector<CommandArgumentData>
@@ -226,38 +227,20 @@
/// option. Don't override this method, override HandleArgumentCompletion
/// instead unless you have special reasons.
///
- /// \param[in/out] request
+ /// \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);
+ virtual void 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.)
+ /// The input array contains a parsed version of the line.
+ ///
/// We've constructed the map of options and their arguments as well if that
/// is helpful for the completion.
///
- /// \param[in/out] request
+ /// \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
+ virtual void
HandleArgumentCompletion(CompletionRequest &request,
- OptionElementVector &opt_element_vector) {
- return 0;
- }
+ OptionElementVector &opt_element_vector) {}
bool HelpTextContainsWord(llvm::StringRef search_word,
bool search_short_help = true,
@@ -279,8 +262,8 @@
/// Get the command that appropriate for a "repeat" of the current command.
///
- /// \param[in] current_command_line
- /// The complete current command line.
+ /// \param[in] current_command_args
+ /// The command arguments.
///
/// \return
/// nullptr if there is no special repeat command - it will use the
@@ -348,8 +331,9 @@
// 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();
+ Target &GetSelectedOrDummyTarget(bool prefer_dummy = false);
+ Target &GetSelectedTarget();
+ 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
@@ -428,4 +412,4 @@
} // namespace lldb_private
-#endif // liblldb_CommandObject_h_
+#endif // LLDB_INTERPRETER_COMMANDOBJECT_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/CommandObjectMultiword.h b/linux-x64/clang/include/lldb/Interpreter/CommandObjectMultiword.h
index 660e9d4..f330a74 100644
--- a/linux-x64/clang/include/lldb/Interpreter/CommandObjectMultiword.h
+++ b/linux-x64/clang/include/lldb/Interpreter/CommandObjectMultiword.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_CommandObjectMultiword_h_
-#define liblldb_CommandObjectMultiword_h_
+#ifndef LLDB_INTERPRETER_COMMANDOBJECTMULTIWORD_H
+#define LLDB_INTERPRETER_COMMANDOBJECTMULTIWORD_H
#include "lldb/Interpreter/CommandObject.h"
#include "lldb/Utility/CompletionRequest.h"
@@ -50,7 +50,7 @@
bool WantsRawCommandString() override { return false; }
- int HandleCompletion(CompletionRequest &request) override;
+ void HandleCompletion(CompletionRequest &request) override;
const char *GetRepeatCommand(Args ¤t_command_args,
uint32_t index) override;
@@ -82,6 +82,10 @@
// for this object.
virtual CommandObject *GetProxyCommandObject() = 0;
+ llvm::StringRef GetSyntax() override;
+
+ llvm::StringRef GetHelp() override;
+
llvm::StringRef GetHelpLong() override;
bool IsRemovable() const override;
@@ -112,15 +116,20 @@
Options *GetOptions() override;
- int HandleCompletion(CompletionRequest &request) override;
+ void HandleCompletion(CompletionRequest &request) override;
- int HandleArgumentCompletion(
- CompletionRequest &request,
- OptionElementVector &opt_element_vector) override;
+ void
+ HandleArgumentCompletion(CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override;
const char *GetRepeatCommand(Args ¤t_command_args,
uint32_t index) override;
+ /// \return
+ /// An error message to be displayed when the command is executed (i.e.
+ /// Execute is called) and \a GetProxyCommandObject returned null.
+ virtual llvm::StringRef GetUnsupportedError();
+
bool Execute(const char *args_string, CommandReturnObject &result) override;
protected:
@@ -131,4 +140,4 @@
} // namespace lldb_private
-#endif // liblldb_CommandObjectMultiword_h_
+#endif // LLDB_INTERPRETER_COMMANDOBJECTMULTIWORD_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/CommandObjectRegexCommand.h b/linux-x64/clang/include/lldb/Interpreter/CommandObjectRegexCommand.h
deleted file mode 100644
index 7f06e26..0000000
--- a/linux-x64/clang/include/lldb/Interpreter/CommandObjectRegexCommand.h
+++ /dev/null
@@ -1,59 +0,0 @@
-//===-- 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
index 5483c15..218cc87 100644
--- a/linux-x64/clang/include/lldb/Interpreter/CommandOptionValidators.h
+++ b/linux-x64/clang/include/lldb/Interpreter/CommandOptionValidators.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_CommandOptionValidators_h_
-#define liblldb_CommandOptionValidators_h_
+#ifndef LLDB_INTERPRETER_COMMANDOPTIONVALIDATORS_H
+#define LLDB_INTERPRETER_COMMANDOPTIONVALIDATORS_H
#include "lldb/lldb-private-types.h"
@@ -25,4 +25,4 @@
} // namespace lldb_private
-#endif // liblldb_CommandOptionValidators_h_
+#endif // LLDB_INTERPRETER_COMMANDOPTIONVALIDATORS_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/CommandReturnObject.h b/linux-x64/clang/include/lldb/Interpreter/CommandReturnObject.h
index a5f6126..a7c2eea 100644
--- a/linux-x64/clang/include/lldb/Interpreter/CommandReturnObject.h
+++ b/linux-x64/clang/include/lldb/Interpreter/CommandReturnObject.h
@@ -6,10 +6,9 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_CommandReturnObject_h_
-#define liblldb_CommandReturnObject_h_
+#ifndef LLDB_INTERPRETER_COMMANDRETURNOBJECT_H
+#define LLDB_INTERPRETER_COMMANDRETURNOBJECT_H
-#include "lldb/Core/STLUtils.h"
#include "lldb/Core/StreamFile.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/StreamTee.h"
@@ -17,6 +16,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/FormatVariadic.h"
+#include "llvm/Support/WithColor.h"
#include <memory>
@@ -24,21 +24,21 @@
class CommandReturnObject {
public:
- CommandReturnObject();
+ CommandReturnObject(bool colors);
~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 std::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 std::static_pointer_cast<StreamString>(stream_sp)->GetString();
return llvm::StringRef();
}
@@ -46,7 +46,7 @@
// 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());
+ stream_sp = std::make_shared<StreamString>();
m_out_stream.SetStreamAtIndex(eStreamStringIndex, stream_sp);
}
return m_out_stream;
@@ -56,19 +56,19 @@
// 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());
+ stream_sp = std::make_shared<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));
+ void SetImmediateOutputFile(lldb::FileSP file_sp) {
+ lldb::StreamSP stream_sp(new StreamFile(file_sp));
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));
+ void SetImmediateErrorFile(lldb::FileSP file_sp) {
+ lldb::StreamSP stream_sp(new StreamFile(file_sp));
m_err_stream.SetStreamAtIndex(eImmediateStreamIndex, stream_sp);
}
@@ -144,14 +144,6 @@
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 };
@@ -162,16 +154,8 @@
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_
+#endif // LLDB_INTERPRETER_COMMANDRETURNOBJECT_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupArchitecture.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupArchitecture.h
index 4b7f9fe..1eadf45 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionGroupArchitecture.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupArchitecture.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionGroupArchitecture_h_
-#define liblldb_OptionGroupArchitecture_h_
+#ifndef LLDB_INTERPRETER_OPTIONGROUPARCHITECTURE_H
+#define LLDB_INTERPRETER_OPTIONGROUPARCHITECTURE_H
#include "lldb/Interpreter/Options.h"
#include "lldb/Utility/ArchSpec.h"
@@ -42,4 +42,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionGroupArchitecture_h_
+#endif // LLDB_INTERPRETER_OPTIONGROUPARCHITECTURE_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupBoolean.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupBoolean.h
index 7749045..061e313 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionGroupBoolean.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupBoolean.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionGroupBoolean_h_
-#define liblldb_OptionGroupBoolean_h_
+#ifndef LLDB_INTERPRETER_OPTIONGROUPBOOLEAN_H
+#define LLDB_INTERPRETER_OPTIONGROUPBOOLEAN_H
#include "lldb/Interpreter/OptionValueBoolean.h"
#include "lldb/Interpreter/Options.h"
@@ -48,4 +48,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionGroupBoolean_h_
+#endif // LLDB_INTERPRETER_OPTIONGROUPBOOLEAN_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupFile.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupFile.h
index cce3714..374cf10 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionGroupFile.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupFile.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionGroupFile_h_
-#define liblldb_OptionGroupFile_h_
+#ifndef LLDB_INTERPRETER_OPTIONGROUPFILE_H
+#define LLDB_INTERPRETER_OPTIONGROUPFILE_H
#include "lldb/Interpreter/OptionValueFileSpec.h"
#include "lldb/Interpreter/OptionValueFileSpecList.h"
@@ -78,4 +78,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionGroupFile_h_
+#endif // LLDB_INTERPRETER_OPTIONGROUPFILE_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupFormat.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupFormat.h
index 1b5020a..62c6f97 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionGroupFormat.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupFormat.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionGroupFormat_h_
-#define liblldb_OptionGroupFormat_h_
+#ifndef LLDB_INTERPRETER_OPTIONGROUPFORMAT_H
+#define LLDB_INTERPRETER_OPTIONGROUPFORMAT_H
#include "lldb/Interpreter/OptionValueFormat.h"
#include "lldb/Interpreter/OptionValueSInt64.h"
@@ -78,4 +78,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionGroupFormat_h_
+#endif // LLDB_INTERPRETER_OPTIONGROUPFORMAT_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupOutputFile.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupOutputFile.h
index 82d68b7..a71998f 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionGroupOutputFile.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupOutputFile.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionGroupOutputFile_h_
-#define liblldb_OptionGroupOutputFile_h_
+#ifndef LLDB_INTERPRETER_OPTIONGROUPOUTPUTFILE_H
+#define LLDB_INTERPRETER_OPTIONGROUPOUTPUTFILE_H
#include "lldb/Interpreter/OptionValueBoolean.h"
#include "lldb/Interpreter/OptionValueFileSpec.h"
@@ -45,4 +45,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionGroupOutputFile_h_
+#endif // LLDB_INTERPRETER_OPTIONGROUPOUTPUTFILE_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupPlatform.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupPlatform.h
index ea5a3f3..99945e5 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionGroupPlatform.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupPlatform.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionGroupPlatform_h_
-#define liblldb_OptionGroupPlatform_h_
+#ifndef LLDB_INTERPRETER_OPTIONGROUPPLATFORM_H
+#define LLDB_INTERPRETER_OPTIONGROUPPLATFORM_H
#include "lldb/Interpreter/Options.h"
#include "lldb/Utility/ConstString.h"
@@ -70,4 +70,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionGroupPlatform_h_
+#endif // LLDB_INTERPRETER_OPTIONGROUPPLATFORM_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h
new file mode 100644
index 0000000..d4c924a
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h
@@ -0,0 +1,63 @@
+//===-- OptionGroupPythonClassWithDict.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_OPTIONGROUPPYTHONCLASSWITHDICT_H
+#define LLDB_INTERPRETER_OPTIONGROUPPYTHONCLASSWITHDICT_H
+
+#include "lldb/lldb-types.h"
+#include "lldb/Interpreter/Options.h"
+#include "lldb/Utility/StructuredData.h"
+
+namespace lldb_private {
+
+// Use this Option group if you have a python class that implements some
+// Python extension point, and you pass a SBStructuredData to the class
+// __init__ method.
+// class_option specifies the class name
+// the key and value options are read in in pairs, and a
+// StructuredData::Dictionary is constructed with those pairs.
+class OptionGroupPythonClassWithDict : public OptionGroup {
+public:
+ OptionGroupPythonClassWithDict(const char *class_use,
+ bool is_class = true,
+ int class_option = 'C',
+ int key_option = 'k',
+ int value_option = 'v');
+
+ ~OptionGroupPythonClassWithDict() override;
+
+ llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
+ return llvm::ArrayRef<OptionDefinition>(m_option_definition);
+ }
+
+ 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;
+ Status OptionParsingFinished(ExecutionContext *execution_context) override;
+
+ const StructuredData::DictionarySP GetStructuredData() {
+ return m_dict_sp;
+ }
+ const std::string &GetName() {
+ return m_name;
+ }
+
+protected:
+ std::string m_name;
+ std::string m_current_key;
+ StructuredData::DictionarySP m_dict_sp;
+ std::string m_class_usage_text, m_key_usage_text, m_value_usage_text;
+ bool m_is_class;
+ OptionDefinition m_option_definition[4];
+};
+
+} // namespace lldb_private
+
+#endif // LLDB_INTERPRETER_OPTIONGROUPPYTHONCLASSWITHDICT_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupString.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupString.h
index ce10589..1a3b5bd 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionGroupString.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupString.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionGroupString_h_
-#define liblldb_OptionGroupString_h_
+#ifndef LLDB_INTERPRETER_OPTIONGROUPSTRING_H
+#define LLDB_INTERPRETER_OPTIONGROUPSTRING_H
#include "lldb/Interpreter/OptionValueString.h"
#include "lldb/Interpreter/Options.h"
@@ -45,4 +45,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionGroupString_h_
+#endif // LLDB_INTERPRETER_OPTIONGROUPSTRING_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupUInt64.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupUInt64.h
index 12f08a3..783c4b6 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionGroupUInt64.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupUInt64.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionGroupUInt64_h_
-#define liblldb_OptionGroupUInt64_h_
+#ifndef LLDB_INTERPRETER_OPTIONGROUPUINT64_H
+#define LLDB_INTERPRETER_OPTIONGROUPUINT64_H
#include "lldb/Interpreter/OptionValueUInt64.h"
#include "lldb/Interpreter/Options.h"
@@ -46,4 +46,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionGroupUInt64_h_
+#endif // LLDB_INTERPRETER_OPTIONGROUPUINT64_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupUUID.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupUUID.h
index 22fc3a1..b1c779f 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionGroupUUID.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupUUID.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionGroupUUID_h_
-#define liblldb_OptionGroupUUID_h_
+#ifndef LLDB_INTERPRETER_OPTIONGROUPUUID_H
+#define LLDB_INTERPRETER_OPTIONGROUPUUID_H
#include "lldb/Interpreter/OptionValueUUID.h"
#include "lldb/Interpreter/Options.h"
@@ -38,4 +38,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionGroupUUID_h_
+#endif // LLDB_INTERPRETER_OPTIONGROUPUUID_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h
index 5a1bbc9..1ad5332 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionGroupValueObjectDisplay_h_
-#define liblldb_OptionGroupValueObjectDisplay_h_
+#ifndef LLDB_INTERPRETER_OPTIONGROUPVALUEOBJECTDISPLAY_H
+#define LLDB_INTERPRETER_OPTIONGROUPVALUEOBJECTDISPLAY_H
#include "lldb/Core/ValueObject.h"
#include "lldb/Interpreter/Options.h"
@@ -55,4 +55,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionGroupValueObjectDisplay_h_
+#endif // LLDB_INTERPRETER_OPTIONGROUPVALUEOBJECTDISPLAY_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupVariable.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupVariable.h
index 0c042f4..252ca3b 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionGroupVariable.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupVariable.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionGroupVariable_h_
-#define liblldb_OptionGroupVariable_h_
+#ifndef LLDB_INTERPRETER_OPTIONGROUPVARIABLE_H
+#define LLDB_INTERPRETER_OPTIONGROUPVARIABLE_H
#include "lldb/Interpreter/OptionValueString.h"
#include "lldb/Interpreter/Options.h"
@@ -41,9 +41,10 @@
OptionValueString summary_string; // a summary string
private:
- DISALLOW_COPY_AND_ASSIGN(OptionGroupVariable);
+ OptionGroupVariable(const OptionGroupVariable &) = delete;
+ const OptionGroupVariable &operator=(const OptionGroupVariable &) = delete;
};
} // namespace lldb_private
-#endif // liblldb_OptionGroupVariable_h_
+#endif // LLDB_INTERPRETER_OPTIONGROUPVARIABLE_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionGroupWatchpoint.h b/linux-x64/clang/include/lldb/Interpreter/OptionGroupWatchpoint.h
index 3729c00..6a6c863 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionGroupWatchpoint.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionGroupWatchpoint.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionGroupWatchpoint_h_
-#define liblldb_OptionGroupWatchpoint_h_
+#ifndef LLDB_INTERPRETER_OPTIONGROUPWATCHPOINT_H
+#define LLDB_INTERPRETER_OPTIONGROUPWATCHPOINT_H
#include "lldb/Interpreter/Options.h"
@@ -46,9 +46,11 @@
bool watch_type_specified;
private:
- DISALLOW_COPY_AND_ASSIGN(OptionGroupWatchpoint);
+ OptionGroupWatchpoint(const OptionGroupWatchpoint &) = delete;
+ const OptionGroupWatchpoint &
+ operator=(const OptionGroupWatchpoint &) = delete;
};
} // namespace lldb_private
-#endif // liblldb_OptionGroupWatchpoint_h_
+#endif // LLDB_INTERPRETER_OPTIONGROUPWATCHPOINT_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValue.h b/linux-x64/clang/include/lldb/Interpreter/OptionValue.h
index 0b85bc1..a8176e3 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValue.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValue.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValue_h_
-#define liblldb_OptionValue_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUE_H
+#define LLDB_INTERPRETER_OPTIONVALUE_H
#include "lldb/Core/FormatEntity.h"
#include "lldb/Utility/CompletionRequest.h"
@@ -31,6 +31,7 @@
eTypeChar,
eTypeDictionary,
eTypeEnum,
+ eTypeFileLineColumn,
eTypeFileSpec,
eTypeFileSpecList,
eTypeFormat,
@@ -58,12 +59,7 @@
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) {}
+ OptionValue() : m_value_was_set(false) {}
virtual ~OptionValue() = default;
@@ -89,12 +85,12 @@
SetValueFromString(llvm::StringRef value,
VarSetOperationType op = eVarSetOperationAssign);
- virtual bool Clear() = 0;
+ virtual void Clear() = 0;
virtual lldb::OptionValueSP DeepCopy() const = 0;
- virtual size_t AutoComplete(CommandInterpreter &interpreter,
- CompletionRequest &request);
+ virtual void AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request);
// Subclasses can override these functions
virtual lldb::OptionValueSP GetSubValue(const ExecutionContext *exe_ctx,
@@ -140,6 +136,8 @@
return eTypeDictionary;
case 1u << eTypeEnum:
return eTypeEnum;
+ case 1u << eTypeFileLineColumn:
+ return eTypeFileLineColumn;
case 1u << eTypeFileSpec:
return eTypeFileSpec;
case 1u << eTypeFileSpecList:
@@ -308,22 +306,19 @@
m_parent_wp = parent_sp;
}
- void SetValueChangedCallback(OptionValueChangedCallback callback,
- void *baton) {
- assert(m_callback == nullptr);
- m_callback = callback;
- m_baton = baton;
+ void SetValueChangedCallback(std::function<void()> callback) {
+ assert(!m_callback);
+ m_callback = std::move(callback);
}
void NotifyValueChanged() {
if (m_callback)
- m_callback(m_baton, this);
+ m_callback();
}
protected:
lldb::OptionValueWP m_parent_wp;
- OptionValueChangedCallback m_callback;
- void *m_baton;
+ std::function<void()> m_callback;
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
@@ -334,4 +329,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValue_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUE_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueArch.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueArch.h
index f8f4068..809261e 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValueArch.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueArch.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValueArch_h_
-#define liblldb_OptionValueArch_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUEARCH_H
+#define LLDB_INTERPRETER_OPTIONVALUEARCH_H
#include "lldb/Interpreter/OptionValue.h"
#include "lldb/Utility/ArchSpec.h"
@@ -47,16 +47,15 @@
SetValueFromString(const char *,
VarSetOperationType = eVarSetOperationAssign) = delete;
- bool Clear() override {
+ void 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;
+ void AutoComplete(CommandInterpreter &interpreter,
+ lldb_private::CompletionRequest &request) override;
// Subclass specific functions
@@ -81,4 +80,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValueArch_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUEARCH_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueArgs.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueArgs.h
index 0254b9a..25f7fdd 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValueArgs.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueArgs.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValueArgs_h_
-#define liblldb_OptionValueArgs_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUEARGS_H
+#define LLDB_INTERPRETER_OPTIONVALUEARGS_H
#include "lldb/Interpreter/OptionValueArray.h"
@@ -28,4 +28,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValueArgs_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUEARGS_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueArray.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueArray.h
index 10f3bf5..4546bbb 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValueArray.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueArray.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValueArray_h_
-#define liblldb_OptionValueArray_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUEARRAY_H
+#define LLDB_INTERPRETER_OPTIONVALUEARRAY_H
#include <vector>
@@ -36,10 +36,9 @@
SetValueFromString(const char *,
VarSetOperationType = eVarSetOperationAssign) = delete;
- bool Clear() override {
+ void Clear() override {
m_values.clear();
m_value_was_set = false;
- return true;
}
lldb::OptionValueSP DeepCopy() const override;
@@ -125,4 +124,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValueArray_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUEARRAY_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueBoolean.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueBoolean.h
index 2fc97d4..1af14a4 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValueBoolean.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueBoolean.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValueBoolean_h_
-#define liblldb_OptionValueBoolean_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUEBOOLEAN_H
+#define LLDB_INTERPRETER_OPTIONVALUEBOOLEAN_H
#include "lldb/Interpreter/OptionValue.h"
@@ -37,14 +37,13 @@
SetValueFromString(const char *,
VarSetOperationType = eVarSetOperationAssign) = delete;
- bool Clear() override {
+ void Clear() override {
m_current_value = m_default_value;
m_value_was_set = false;
- return true;
}
- size_t AutoComplete(CommandInterpreter &interpreter,
- CompletionRequest &request) override;
+ void AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
// Subclass specific functions
@@ -85,4 +84,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValueBoolean_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUEBOOLEAN_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueChar.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueChar.h
index d866136..a8ecf50 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValueChar.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueChar.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValueChar_h_
-#define liblldb_OptionValueChar_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUECHAR_H
+#define LLDB_INTERPRETER_OPTIONVALUECHAR_H
#include "lldb/Interpreter/OptionValue.h"
@@ -38,10 +38,9 @@
SetValueFromString(const char *,
VarSetOperationType = eVarSetOperationAssign) = delete;
- bool Clear() override {
+ void Clear() override {
m_current_value = m_default_value;
m_value_was_set = false;
- return true;
}
// Subclass specific functions
@@ -68,4 +67,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValueChar_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUECHAR_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueDictionary.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueDictionary.h
index 8785d38..dab1c3e 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValueDictionary.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueDictionary.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValueDictionary_h_
-#define liblldb_OptionValueDictionary_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUEDICTIONARY_H
+#define LLDB_INTERPRETER_OPTIONVALUEDICTIONARY_H
#include <map>
@@ -35,10 +35,9 @@
SetValueFromString(llvm::StringRef value,
VarSetOperationType op = eVarSetOperationAssign) override;
- bool Clear() override {
+ void Clear() override {
m_values.clear();
m_value_was_set = false;
- return true;
}
lldb::OptionValueSP DeepCopy() const override;
@@ -81,4 +80,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValueDictionary_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUEDICTIONARY_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueEnumeration.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueEnumeration.h
index 71f3ab5..12c6473 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValueEnumeration.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueEnumeration.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValueEnumeration_h_
-#define liblldb_OptionValueEnumeration_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUEENUMERATION_H
+#define LLDB_INTERPRETER_OPTIONVALUEENUMERATION_H
#include "lldb/Core/UniqueCStringMap.h"
#include "lldb/Interpreter/OptionValue.h"
@@ -47,16 +47,15 @@
SetValueFromString(const char *,
VarSetOperationType = eVarSetOperationAssign) = delete;
- bool Clear() override {
+ void 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;
+ void AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
// Subclass specific functions
@@ -83,4 +82,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValueEnumeration_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUEENUMERATION_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueFileColonLine.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueFileColonLine.h
new file mode 100644
index 0000000..713deea
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueFileColonLine.h
@@ -0,0 +1,64 @@
+//===-- OptionValueFileColonLine.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_OPTIONVALUEFILECOLONLINE_H
+#define LLDB_INTERPRETER_OPTIONVALUEFILECOLONLINE_H
+
+#include "lldb/Interpreter/OptionValue.h"
+
+#include "lldb/Utility/FileSpec.h"
+#include "llvm/Support/Chrono.h"
+
+namespace lldb_private {
+
+class OptionValueFileColonLine : public OptionValue {
+public:
+ OptionValueFileColonLine();
+ OptionValueFileColonLine(const llvm::StringRef input);
+
+ ~OptionValueFileColonLine() override {}
+
+ OptionValue::Type GetType() const override { return eTypeFileLineColumn; }
+
+ 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;
+
+ void Clear() override {
+ m_file_spec.Clear();
+ m_line_number = LLDB_INVALID_LINE_NUMBER;
+ m_column_number = LLDB_INVALID_COLUMN_NUMBER;
+ }
+
+ lldb::OptionValueSP DeepCopy() const override;
+
+ void AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
+
+ FileSpec &GetFileSpec() { return m_file_spec; }
+ uint32_t GetLineNumber() { return m_line_number; }
+ uint32_t GetColumnNumber() { return m_column_number; }
+
+ void SetCompletionMask(uint32_t mask) { m_completion_mask = mask; }
+
+protected:
+ FileSpec m_file_spec;
+ uint32_t m_line_number;
+ uint32_t m_column_number;
+ uint32_t m_completion_mask;
+};
+
+} // namespace lldb_private
+
+#endif // LLDB_INTERPRETER_OPTIONVALUEFILECOLONLINE_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueFileSpec.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueFileSpec.h
index aa1022a..4fde3f6 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValueFileSpec.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueFileSpec.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValueFileSpec_h_
-#define liblldb_OptionValueFileSpec_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUEFILESPEC_H
+#define LLDB_INTERPRETER_OPTIONVALUEFILESPEC_H
#include "lldb/Interpreter/OptionValue.h"
@@ -41,18 +41,17 @@
SetValueFromString(const char *,
VarSetOperationType = eVarSetOperationAssign) = delete;
- bool Clear() override {
+ void 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;
+ void AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
// Subclass specific functions
@@ -86,4 +85,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValueFileSpec_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUEFILESPEC_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueFileSpecList.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueFileSpecList.h
index 5607437..3877352 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValueFileSpecList.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueFileSpecList.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValueFileSpecList_h_
-#define liblldb_OptionValueFileSpecList_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUEFILESPECLIST_H
+#define LLDB_INTERPRETER_OPTIONVALUEFILESPECLIST_H
#include <mutex>
@@ -39,11 +39,10 @@
SetValueFromString(const char *,
VarSetOperationType = eVarSetOperationAssign) = delete;
- bool Clear() override {
+ void 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;
@@ -74,4 +73,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValueFileSpecList_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUEFILESPECLIST_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueFormat.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueFormat.h
index 020f4ae..5a83ff3 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValueFormat.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueFormat.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValueFormat_h_
-#define liblldb_OptionValueFormat_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUEFORMAT_H
+#define LLDB_INTERPRETER_OPTIONVALUEFORMAT_H
#include "lldb/Interpreter/OptionValue.h"
@@ -38,10 +38,9 @@
SetValueFromString(const char *,
VarSetOperationType = eVarSetOperationAssign) = delete;
- bool Clear() override {
+ void Clear() override {
m_current_value = m_default_value;
m_value_was_set = false;
- return true;
}
lldb::OptionValueSP DeepCopy() const override;
@@ -63,4 +62,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValueFormat_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUEFORMAT_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueFormatEntity.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueFormatEntity.h
index b05be95..7c2f9fb 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValueFormatEntity.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueFormatEntity.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValueFormatEntity_h_
-#define liblldb_OptionValueFormatEntity_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUEFORMATENTITY_H
+#define LLDB_INTERPRETER_OPTIONVALUEFORMATENTITY_H
#include "lldb/Core/FormatEntity.h"
#include "lldb/Interpreter/OptionValue.h"
@@ -34,12 +34,12 @@
SetValueFromString(const char *,
VarSetOperationType = eVarSetOperationAssign) = delete;
- bool Clear() override;
+ void Clear() override;
lldb::OptionValueSP DeepCopy() const override;
- size_t AutoComplete(CommandInterpreter &interpreter,
- CompletionRequest &request) override;
+ void AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
// Subclass specific functions
@@ -64,4 +64,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValueFormatEntity_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUEFORMATENTITY_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueLanguage.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueLanguage.h
index 505dc89..1293652 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValueLanguage.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueLanguage.h
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValueLanguage_h_
-#define liblldb_OptionValueLanguage_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUELANGUAGE_H
+#define LLDB_INTERPRETER_OPTIONVALUELANGUAGE_H
#include "lldb/Interpreter/OptionValue.h"
#include "lldb/lldb-enumerations.h"
@@ -41,10 +41,9 @@
SetValueFromString(const char *,
VarSetOperationType = eVarSetOperationAssign) = delete;
- bool Clear() override {
+ void Clear() override {
m_current_value = m_default_value;
m_value_was_set = false;
- return true;
}
lldb::OptionValueSP DeepCopy() const override;
@@ -66,4 +65,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValueLanguage_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUELANGUAGE_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValuePathMappings.h b/linux-x64/clang/include/lldb/Interpreter/OptionValuePathMappings.h
index 35c2af4..6d1a081 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValuePathMappings.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValuePathMappings.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValuePathMappings_h_
-#define liblldb_OptionValuePathMappings_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUEPATHMAPPINGS_H
+#define LLDB_INTERPRETER_OPTIONVALUEPATHMAPPINGS_H
#include "lldb/Interpreter/OptionValue.h"
#include "lldb/Target/PathMappingList.h"
@@ -35,10 +35,9 @@
SetValueFromString(const char *,
VarSetOperationType = eVarSetOperationAssign) = delete;
- bool Clear() override {
+ void Clear() override {
m_path_mappings.Clear(m_notify_changes);
m_value_was_set = false;
- return true;
}
lldb::OptionValueSP DeepCopy() const override;
@@ -58,4 +57,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValuePathMappings_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUEPATHMAPPINGS_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueProperties.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueProperties.h
index bea2b3c..d60afde 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValueProperties.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueProperties.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValueProperties_h_
-#define liblldb_OptionValueProperties_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUEPROPERTIES_H
+#define LLDB_INTERPRETER_OPTIONVALUEPROPERTIES_H
#include <vector>
@@ -34,7 +34,7 @@
Type GetType() const override { return eTypeProperties; }
- bool Clear() override;
+ void Clear() override;
lldb::OptionValueSP DeepCopy() const override;
@@ -104,11 +104,6 @@
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;
@@ -198,8 +193,7 @@
ConstString name);
void SetValueChangedCallback(uint32_t property_idx,
- OptionValueChangedCallback callback,
- void *baton);
+ std::function<void()> callback);
protected:
Property *ProtectedGetPropertyAtIndex(uint32_t idx) {
@@ -219,4 +213,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValueProperties_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUEPROPERTIES_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueRegex.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueRegex.h
index f5b2557..4751a1d 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValueRegex.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueRegex.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValueRegex_h_
-#define liblldb_OptionValueRegex_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUEREGEX_H
+#define LLDB_INTERPRETER_OPTIONVALUEREGEX_H
#include "lldb/Interpreter/OptionValue.h"
#include "lldb/Utility/RegularExpression.h"
@@ -17,7 +17,8 @@
class OptionValueRegex : public OptionValue {
public:
OptionValueRegex(const char *value = nullptr)
- : OptionValue(), m_regex(llvm::StringRef::withNullAsEmpty(value)) {}
+ : OptionValue(), m_regex(llvm::StringRef::withNullAsEmpty(value)),
+ m_default_regex_str(llvm::StringRef::withNullAsEmpty(value).str()) {}
~OptionValueRegex() override = default;
@@ -35,10 +36,9 @@
SetValueFromString(const char *,
VarSetOperationType = eVarSetOperationAssign) = delete;
- bool Clear() override {
- m_regex.Clear();
+ void Clear() override {
+ m_regex = RegularExpression(m_default_regex_str);
m_value_was_set = false;
- return true;
}
lldb::OptionValueSP DeepCopy() const override;
@@ -50,17 +50,18 @@
void SetCurrentValue(const char *value) {
if (value && value[0])
- m_regex.Compile(llvm::StringRef(value));
+ m_regex = RegularExpression(llvm::StringRef(value));
else
- m_regex.Clear();
+ m_regex = RegularExpression();
}
bool IsValid() const { return m_regex.IsValid(); }
protected:
RegularExpression m_regex;
+ std::string m_default_regex_str;
};
} // namespace lldb_private
-#endif // liblldb_OptionValueRegex_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUEREGEX_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueSInt64.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueSInt64.h
index c2e8ff4..87917c1 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValueSInt64.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueSInt64.h
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValueSInt64_h_
-#define liblldb_OptionValueSInt64_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUESINT64_H
+#define LLDB_INTERPRETER_OPTIONVALUESINT64_H
#include "lldb/Interpreter/OptionValue.h"
@@ -50,10 +50,9 @@
SetValueFromString(const char *,
VarSetOperationType = eVarSetOperationAssign) = delete;
- bool Clear() override {
+ void Clear() override {
m_current_value = m_default_value;
m_value_was_set = false;
- return true;
}
lldb::OptionValueSP DeepCopy() const override;
@@ -102,4 +101,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValueSInt64_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUESINT64_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueString.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueString.h
index d9e76d8..ed44dae 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValueString.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueString.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValueString_h_
-#define liblldb_OptionValueString_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUESTRING_H
+#define LLDB_INTERPRETER_OPTIONVALUESTRING_H
#include <string>
@@ -85,10 +85,9 @@
SetValueFromString(const char *,
VarSetOperationType = eVarSetOperationAssign) = delete;
- bool Clear() override {
+ void Clear() override {
m_current_value = m_default_value;
m_value_was_set = false;
- return true;
}
lldb::OptionValueSP DeepCopy() const override;
@@ -136,4 +135,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValueString_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUESTRING_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueUInt64.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueUInt64.h
index 5978cdb..1164fb8 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValueUInt64.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueUInt64.h
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValueUInt64_h_
-#define liblldb_OptionValueUInt64_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUEUINT64_H
+#define LLDB_INTERPRETER_OPTIONVALUEUINT64_H
#include "lldb/Interpreter/OptionValue.h"
@@ -47,10 +47,9 @@
SetValueFromString(const char *,
VarSetOperationType = eVarSetOperationAssign) = delete;
- bool Clear() override {
+ void Clear() override {
m_current_value = m_default_value;
m_value_was_set = false;
- return true;
}
lldb::OptionValueSP DeepCopy() const override;
@@ -79,4 +78,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValueUInt64_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUEUINT64_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValueUUID.h b/linux-x64/clang/include/lldb/Interpreter/OptionValueUUID.h
index 7273e35..1f663e9 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValueUUID.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValueUUID.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValueUUID_h_
-#define liblldb_OptionValueUUID_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUEUUID_H
+#define LLDB_INTERPRETER_OPTIONVALUEUUID_H
#include "lldb/Utility/UUID.h"
#include "lldb/Interpreter/OptionValue.h"
@@ -36,10 +36,9 @@
SetValueFromString(const char *,
VarSetOperationType = eVarSetOperationAssign) = delete;
- bool Clear() override {
+ void Clear() override {
m_uuid.Clear();
m_value_was_set = false;
- return true;
}
lldb::OptionValueSP DeepCopy() const override;
@@ -52,8 +51,8 @@
void SetCurrentValue(const UUID &value) { m_uuid = value; }
- size_t AutoComplete(CommandInterpreter &interpreter,
- CompletionRequest &request) override;
+ void AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
protected:
UUID m_uuid;
@@ -61,4 +60,4 @@
} // namespace lldb_private
-#endif // liblldb_OptionValueUUID_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUEUUID_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/OptionValues.h b/linux-x64/clang/include/lldb/Interpreter/OptionValues.h
index d90b286..6efc9e1 100644
--- a/linux-x64/clang/include/lldb/Interpreter/OptionValues.h
+++ b/linux-x64/clang/include/lldb/Interpreter/OptionValues.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_OptionValues_h_
-#define liblldb_OptionValues_h_
+#ifndef LLDB_INTERPRETER_OPTIONVALUES_H
+#define LLDB_INTERPRETER_OPTIONVALUES_H
#include "lldb/Interpreter/OptionValue.h"
#include "lldb/Interpreter/OptionValueArch.h"
@@ -17,6 +17,7 @@
#include "lldb/Interpreter/OptionValueChar.h"
#include "lldb/Interpreter/OptionValueDictionary.h"
#include "lldb/Interpreter/OptionValueEnumeration.h"
+#include "lldb/Interpreter/OptionValueFileColonLine.h"
#include "lldb/Interpreter/OptionValueFileSpec.h"
#include "lldb/Interpreter/OptionValueFileSpecList.h"
#include "lldb/Interpreter/OptionValueFormat.h"
@@ -30,4 +31,4 @@
#include "lldb/Interpreter/OptionValueUInt64.h"
#include "lldb/Interpreter/OptionValueUUID.h"
-#endif // liblldb_OptionValues_h_
+#endif // LLDB_INTERPRETER_OPTIONVALUES_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/Options.h b/linux-x64/clang/include/lldb/Interpreter/Options.h
index a008d51..9738cce 100644
--- a/linux-x64/clang/include/lldb/Interpreter/Options.h
+++ b/linux-x64/clang/include/lldb/Interpreter/Options.h
@@ -6,14 +6,15 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_Options_h_
-#define liblldb_Options_h_
+#ifndef LLDB_INTERPRETER_OPTIONS_H
+#define LLDB_INTERPRETER_OPTIONS_H
#include <set>
#include <vector>
#include "lldb/Utility/Args.h"
#include "lldb/Utility/CompletionRequest.h"
+#include "lldb/Utility/OptionDefinition.h"
#include "lldb/Utility/Status.h"
#include "lldb/lldb-defines.h"
#include "lldb/lldb-private.h"
@@ -40,12 +41,6 @@
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.
///
@@ -163,7 +158,7 @@
/// Handles the generic bits of figuring out whether we are in an option,
/// and if so completing it.
///
- /// \param[in/out] request
+ /// \param[in,out] request
/// The completion request that we need to act upon.
///
/// \param[in] interpreter
@@ -182,19 +177,12 @@
/// Handles the generic bits of figuring out whether we are in an option,
/// and if so completing it.
///
- /// \param[in/out] request
+ /// \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
+ virtual void
HandleOptionArgumentCompletion(lldb_private::CompletionRequest &request,
OptionElementVector &opt_element_vector,
int opt_element_index,
@@ -335,4 +323,4 @@
} // namespace lldb_private
-#endif // liblldb_Options_h_
+#endif // LLDB_INTERPRETER_OPTIONS_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/Property.h b/linux-x64/clang/include/lldb/Interpreter/Property.h
index 797aee4..97ec7ca 100644
--- a/linux-x64/clang/include/lldb/Interpreter/Property.h
+++ b/linux-x64/clang/include/lldb/Interpreter/Property.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_Property_h_
-#define liblldb_Property_h_
+#ifndef LLDB_INTERPRETER_PROPERTY_H
+#define LLDB_INTERPRETER_PROPERTY_H
#include "lldb/Interpreter/OptionValue.h"
#include "lldb/Utility/ConstString.h"
@@ -64,8 +64,7 @@
uint32_t output_width,
bool display_qualified_name) const;
- void SetValueChangedCallback(OptionValueChangedCallback callback,
- void *baton);
+ void SetValueChangedCallback(std::function<void()> callback);
protected:
ConstString m_name;
@@ -76,4 +75,4 @@
} // namespace lldb_private
-#endif // liblldb_Property_h_
+#endif // LLDB_INTERPRETER_PROPERTY_H
diff --git a/linux-x64/clang/include/lldb/Interpreter/ScriptInterpreter.h b/linux-x64/clang/include/lldb/Interpreter/ScriptInterpreter.h
index c8fa390..4abd1ca 100644
--- a/linux-x64/clang/include/lldb/Interpreter/ScriptInterpreter.h
+++ b/linux-x64/clang/include/lldb/Interpreter/ScriptInterpreter.h
@@ -6,19 +6,19 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_ScriptInterpreter_h_
-#define liblldb_ScriptInterpreter_h_
-
-#include "lldb/lldb-private.h"
+#ifndef LLDB_INTERPRETER_SCRIPTINTERPRETER_H
+#define LLDB_INTERPRETER_SCRIPTINTERPRETER_H
#include "lldb/Breakpoint/BreakpointOptions.h"
+#include "lldb/Core/Communication.h"
#include "lldb/Core/PluginInterface.h"
#include "lldb/Core/SearchFilter.h"
+#include "lldb/Core/StreamFile.h"
+#include "lldb/Host/PseudoTerminal.h"
#include "lldb/Utility/Broadcaster.h"
#include "lldb/Utility/Status.h"
#include "lldb/Utility/StructuredData.h"
-
-#include "lldb/Host/PseudoTerminal.h"
+#include "lldb/lldb-private.h"
namespace lldb_private {
@@ -29,7 +29,38 @@
virtual ~ScriptInterpreterLocker() = default;
private:
- DISALLOW_COPY_AND_ASSIGN(ScriptInterpreterLocker);
+ ScriptInterpreterLocker(const ScriptInterpreterLocker &) = delete;
+ const ScriptInterpreterLocker &
+ operator=(const ScriptInterpreterLocker &) = delete;
+};
+
+class ScriptInterpreterIORedirect {
+public:
+ /// Create an IO redirect. If IO is enabled, this will redirects the output
+ /// to the command return object if set or to the debugger otherwise. If IO
+ /// is disabled, it will redirect all IO to /dev/null.
+ static llvm::Expected<std::unique_ptr<ScriptInterpreterIORedirect>>
+ Create(bool enable_io, Debugger &debugger, CommandReturnObject *result);
+
+ ~ScriptInterpreterIORedirect();
+
+ lldb::FileSP GetInputFile() const { return m_input_file_sp; }
+ lldb::FileSP GetOutputFile() const { return m_output_file_sp->GetFileSP(); }
+ lldb::FileSP GetErrorFile() const { return m_error_file_sp->GetFileSP(); }
+
+ /// Flush our output and error file handles.
+ void Flush();
+
+private:
+ ScriptInterpreterIORedirect(std::unique_ptr<File> input,
+ std::unique_ptr<File> output);
+ ScriptInterpreterIORedirect(Debugger &debugger, CommandReturnObject *result);
+
+ lldb::FileSP m_input_file_sp;
+ lldb::StreamFileSP m_output_file_sp;
+ lldb::StreamFileSP m_error_file_sp;
+ Communication m_communication;
+ bool m_disconnect;
};
class ScriptInterpreter : public PluginInterface {
@@ -65,6 +96,9 @@
bool GetSetLLDBGlobals() const { return m_set_lldb_globals; }
+ // If this is true then any exceptions raised by the script will be
+ // cleared with PyErr_Clear(). If false then they will be left for
+ // the caller to clean up
bool GetMaskoutErrors() const { return m_maskout_errors; }
ExecuteScriptOptions &SetEnableIO(bool enable) {
@@ -117,8 +151,10 @@
return error;
}
- virtual Status GenerateBreakpointCommandCallbackData(StringList &input,
- std::string &output) {
+ virtual Status GenerateBreakpointCommandCallbackData(
+ StringList &input,
+ std::string &output,
+ bool has_extra_args) {
Status error;
error.SetErrorString("not implemented");
return error;
@@ -208,6 +244,8 @@
virtual StructuredData::ObjectSP
CreateScriptedThreadPlan(const char *class_name,
+ StructuredDataImpl *args_data,
+ std::string &error_str,
lldb::ThreadPlanSP thread_plan_sp) {
return StructuredData::ObjectSP();
}
@@ -260,6 +298,23 @@
return lldb::eSearchDepthModule;
}
+ virtual StructuredData::GenericSP
+ CreateScriptedStopHook(lldb::TargetSP target_sp, const char *class_name,
+ StructuredDataImpl *args_data, Status &error) {
+ error.SetErrorString("Creating scripted stop-hooks with the current "
+ "script interpreter is not supported.");
+ return StructuredData::GenericSP();
+ }
+
+ // This dispatches to the handle_stop method of the stop-hook class. It
+ // returns a "should_stop" bool.
+ virtual bool
+ ScriptedStopHookHandleStop(StructuredData::GenericSP implementor_sp,
+ ExecutionContext &exc_ctx,
+ lldb::StreamSP stream_sp) {
+ return true;
+ }
+
virtual StructuredData::ObjectSP
LoadPluginModule(const FileSpec &file_spec, lldb_private::Status &error) {
return StructuredData::ObjectSP();
@@ -306,14 +361,20 @@
return error;
}
- void SetBreakpointCommandCallbackFunction(
+ Status SetBreakpointCommandCallbackFunction(
std::vector<BreakpointOptions *> &bp_options_vec,
- const char *function_name);
+ const char *function_name, StructuredData::ObjectSP extra_args_sp);
- /// Set a one-liner as the callback for the breakpoint.
- virtual void
- SetBreakpointCommandCallbackFunction(BreakpointOptions *bp_options,
- const char *function_name) {}
+ /// Set a script function as the callback for the breakpoint.
+ virtual Status
+ SetBreakpointCommandCallbackFunction(
+ BreakpointOptions *bp_options,
+ const char *function_name,
+ StructuredData::ObjectSP extra_args_sp) {
+ Status error;
+ error.SetErrorString("unimplemented");
+ return error;
+ }
/// Set a one-liner as the callback for the watchpoint.
virtual void SetWatchpointCommandCallback(WatchpointOptions *wp_options,
@@ -444,12 +505,10 @@
virtual bool CheckObjectExists(const char *name) { return false; }
virtual bool
- LoadScriptingModule(const char *filename, bool can_reload, bool init_session,
+ LoadScriptingModule(const char *filename, bool init_session,
lldb_private::Status &error,
- StructuredData::ObjectSP *module_sp = nullptr) {
- error.SetErrorString("loading unimplemented");
- return false;
- }
+ StructuredData::ObjectSP *module_sp = nullptr,
+ FileSpec extra_search_dir = {});
virtual bool IsReservedWord(const char *word) { return false; }
@@ -457,14 +516,16 @@
const char *GetScriptInterpreterPtyName();
- int GetMasterFileDescriptor();
+ virtual llvm::Expected<unsigned>
+ GetMaxPositionalArgumentsForCallable(const llvm::StringRef &callable_name) {
+ return llvm::createStringError(
+ llvm::inconvertibleErrorCode(), "Unimplemented function");
+ }
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:
@@ -474,4 +535,4 @@
} // namespace lldb_private
-#endif // liblldb_ScriptInterpreter_h_
+#endif // LLDB_INTERPRETER_SCRIPTINTERPRETER_H