diff options
Diffstat (limited to 'include/lldb/Interpreter/CommandInterpreter.h')
-rw-r--r-- | include/lldb/Interpreter/CommandInterpreter.h | 82 |
1 files changed, 38 insertions, 44 deletions
diff --git a/include/lldb/Interpreter/CommandInterpreter.h b/include/lldb/Interpreter/CommandInterpreter.h index 1962050dffcb..dd5c189d0ab9 100644 --- a/include/lldb/Interpreter/CommandInterpreter.h +++ b/include/lldb/Interpreter/CommandInterpreter.h @@ -14,6 +14,7 @@ // C++ Includes // Other libraries and framework includes // Project includes +#include "lldb/lldb-forward.h" #include "lldb/lldb-private.h" #include "lldb/Core/Broadcaster.h" #include "lldb/Core/Debugger.h" @@ -199,8 +200,6 @@ class CommandInterpreter : public IOHandlerDelegate { public: - - typedef std::map<std::string, OptionArgVectorSP> OptionArgMap; enum @@ -228,11 +227,17 @@ public: eCommandTypesAllThem = 0xFFFF // all commands }; + CommandInterpreter(Debugger &debugger, + lldb::ScriptLanguage script_language, + bool synchronous_execution); + + ~CommandInterpreter() override; + // These two functions fill out the Broadcaster interface: static ConstString &GetStaticBroadcasterClass (); - virtual ConstString &GetBroadcasterClass() const + ConstString &GetBroadcasterClass() const override { return GetStaticBroadcasterClass(); } @@ -241,13 +246,6 @@ public: SourceInitFile (bool in_cwd, CommandReturnObject &result); - CommandInterpreter (Debugger &debugger, - lldb::ScriptLanguage script_language, - bool synchronous_execution); - - virtual - ~CommandInterpreter (); - bool AddCommand (const char *name, const lldb::CommandObjectSP &cmd_sp, @@ -267,8 +265,8 @@ public: bool include_aliases); CommandObject * - GetCommandObject (const char *cmd, - StringList *matches = NULL); + GetCommandObject(const char *cmd, + StringList *matches = nullptr); bool CommandExists (const char *cmd); @@ -305,7 +303,6 @@ public: OptionArgVectorSP GetAliasOptions (const char *alias_name); - bool ProcessAliasOptionsArgs (lldb::CommandObjectSP &cmd_obj_sp, const char *options_args, @@ -325,20 +322,20 @@ public: CommandReturnObject &result); bool - HandleCommand (const char *command_line, - LazyBool add_to_history, - CommandReturnObject &result, - ExecutionContext *override_context = NULL, - bool repeat_on_empty_command = true, - bool no_context_switching = false); + 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); //------------------------------------------------------------------ /// 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 NULL in which case the default + /// @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, @@ -358,8 +355,8 @@ public: /// /// @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 NULL in which case the default + /// @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, @@ -393,7 +390,6 @@ public: // 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, @@ -406,7 +402,6 @@ public: // Help command can call it for the first argument. // word_complete tells whether the completions are considered a "complete" response (so the // completer should complete the quote & put a space after the word. - int HandleCompletionMatches (Args &input, int &cursor_index, @@ -416,7 +411,6 @@ public: bool &word_complete, StringList &matches); - int GetCommandNamesMatchingPartialString (const char *cmd_cstr, bool include_aliases, @@ -496,7 +490,6 @@ public: void SetScriptLanguage (lldb::ScriptLanguage lang); - bool HasCommands (); @@ -520,7 +513,10 @@ public: GetOptionArgumentPosition (const char *in_string); ScriptInterpreter * - GetScriptInterpreter (bool can_create = true); + GetScriptInterpreter(bool can_create = true); + + void + SetScriptInterpreter(); void SkipLLDBInitFiles (bool skip_lldbinit_files) @@ -647,7 +643,7 @@ public: } lldb::IOHandlerSP - GetIOHandler(bool force_create = false, CommandInterpreterRunOptions *options = NULL); + GetIOHandler(bool force_create = false, CommandInterpreterRunOptions *options = nullptr); bool GetStoppedForCrash () const @@ -655,26 +651,29 @@ public: return m_stopped_for_crash; } + bool + GetSpaceReplPrompts () const; + protected: friend class Debugger; //------------------------------------------------------------------ // IOHandlerDelegate functions //------------------------------------------------------------------ - virtual void - IOHandlerInputComplete (IOHandler &io_handler, - std::string &line); + void + IOHandlerInputComplete(IOHandler &io_handler, + std::string &line) override; - virtual ConstString - IOHandlerGetControlSequence (char ch) + ConstString + IOHandlerGetControlSequence(char ch) override { if (ch == 'd') return ConstString("quit\n"); return ConstString(); } - virtual bool - IOHandlerInterrupt (IOHandler &io_handler); + bool + IOHandlerInterrupt(IOHandler &io_handler) override; size_t GetProcessOutput (); @@ -683,11 +682,9 @@ protected: SetSynchronous (bool value); lldb::CommandObjectSP - GetCommandSP (const char *cmd, bool include_aliases = true, bool exact = true, StringList *matches = NULL); - + GetCommandSP(const char *cmd, bool include_aliases = true, bool exact = true, StringList *matches = nullptr); private: - Error PreprocessCommand (std::string &command); @@ -697,7 +694,6 @@ private: CommandObject * ResolveCommandImpl(std::string &command_line, CommandReturnObject &result); - 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; @@ -709,7 +705,7 @@ private: OptionArgMap m_alias_options; // Stores any options (with or without arguments) that go with any alias. CommandHistory m_command_history; std::string m_repeat_command; // Stores the command that will be executed for an empty command string. - std::unique_ptr<ScriptInterpreter> m_script_interpreter_ap; + lldb::ScriptInterpreterSP m_script_interpreter_sp; lldb::IOHandlerSP m_command_io_handler_sp; char m_comment_char; bool m_batch_command_mode; @@ -719,10 +715,8 @@ private: uint32_t m_num_errors; bool m_quit_requested; bool m_stopped_for_crash; - }; - } // namespace lldb_private -#endif // liblldb_CommandInterpreter_h_ +#endif // liblldb_CommandInterpreter_h_ |