Eugene.Zelenko created this revision. Eugene.Zelenko added reviewers: brucem, labath, clayborg. Eugene.Zelenko added a subscriber: lldb-commits. Eugene.Zelenko set the repository for this revision to rL LLVM.
This is second attempt based on current code. I checked this patch on my own build on RHEL 6. Please check it in if it's OK, because I don't have SVN write access. Repository: rL LLVM http://reviews.llvm.org/D13602 Files: include/lldb/Host/MonitoringProcessLauncher.h include/lldb/Host/posix/HostProcessPosix.h include/lldb/Interpreter/CommandCompletions.h include/lldb/Interpreter/CommandInterpreter.h include/lldb/Interpreter/CommandObject.h include/lldb/Interpreter/CommandObjectMultiword.h include/lldb/Interpreter/CommandObjectRegexCommand.h include/lldb/Interpreter/CommandOptionValidators.h include/lldb/Interpreter/OptionGroupArchitecture.h include/lldb/Interpreter/OptionGroupBoolean.h include/lldb/Interpreter/OptionGroupFile.h include/lldb/Interpreter/OptionGroupFormat.h include/lldb/Interpreter/OptionGroupOutputFile.h include/lldb/Interpreter/OptionGroupPlatform.h include/lldb/Interpreter/OptionGroupString.h include/lldb/Interpreter/OptionGroupUInt64.h include/lldb/Interpreter/OptionGroupUUID.h include/lldb/Interpreter/OptionGroupValueObjectDisplay.h include/lldb/Interpreter/OptionGroupVariable.h include/lldb/Interpreter/OptionGroupWatchpoint.h include/lldb/Interpreter/Options.h include/lldb/Interpreter/ScriptInterpreter.h
Index: include/lldb/Host/posix/HostProcessPosix.h =================================================================== --- include/lldb/Host/posix/HostProcessPosix.h +++ include/lldb/Host/posix/HostProcessPosix.h @@ -24,7 +24,7 @@ public: HostProcessPosix(); HostProcessPosix(lldb::process_t process); - virtual ~HostProcessPosix(); + ~HostProcessPosix() override; virtual Error Signal(int signo) const; static Error Signal(lldb::process_t process, int signo); @@ -37,6 +37,7 @@ HostThread StartMonitoring(HostProcess::MonitorCallback callback, void *callback_baton, bool monitor_signals) override; }; -} -#endif +} // namespace lldb_private + +#endif // lldb_Host_HostProcesPosix_h_ Index: include/lldb/Host/MonitoringProcessLauncher.h =================================================================== --- include/lldb/Host/MonitoringProcessLauncher.h +++ include/lldb/Host/MonitoringProcessLauncher.h @@ -20,11 +20,12 @@ public: explicit MonitoringProcessLauncher(std::unique_ptr<ProcessLauncher> delegate_launcher); - virtual HostProcess LaunchProcess(const ProcessLaunchInfo &launch_info, Error &error); + HostProcess LaunchProcess(const ProcessLaunchInfo &launch_info, Error &error) override; private: std::unique_ptr<ProcessLauncher> m_delegate_launcher; }; -} -#endif +} // namespace lldb_private + +#endif // lldb_Host_MonitoringProcessLauncher_h_ Index: include/lldb/Interpreter/ScriptInterpreter.h =================================================================== --- include/lldb/Interpreter/ScriptInterpreter.h +++ include/lldb/Interpreter/ScriptInterpreter.h @@ -10,6 +10,10 @@ #ifndef liblldb_ScriptInterpreter_h_ #define liblldb_ScriptInterpreter_h_ +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes #include "lldb/lldb-private.h" #include "lldb/Core/Broadcaster.h" @@ -19,20 +23,16 @@ #include "lldb/Utility/PseudoTerminal.h" - namespace lldb_private { class ScriptInterpreterLocker { public: - ScriptInterpreterLocker () - { - } + ScriptInterpreterLocker() = default; - virtual ~ScriptInterpreterLocker () - { - } + virtual ~ScriptInterpreterLocker() = default; + private: DISALLOW_COPY_AND_ASSIGN (ScriptInterpreterLocker); }; @@ -40,7 +40,6 @@ class ScriptInterpreter : public PluginInterface { public: - typedef enum { eScriptReturnTypeCharPtr, @@ -62,7 +61,7 @@ ScriptInterpreter (CommandInterpreter &interpreter, lldb::ScriptLanguage script_lang); - virtual ~ScriptInterpreter (); + ~ScriptInterpreter() override; struct ExecuteScriptOptions { @@ -324,7 +323,6 @@ SetBreakpointCommandCallbackFunction (BreakpointOptions *bp_options, const char *function_name) { - return; } /// Set a one-liner as the callback for the watchpoint. @@ -332,7 +330,6 @@ SetWatchpointCommandCallback (WatchpointOptions *wp_options, const char *oneliner) { - return; } virtual bool @@ -459,7 +456,7 @@ virtual bool GetDocumentationForItem (const char* item, std::string& dest) { - dest.clear(); + dest.clear(); return false; } @@ -514,8 +511,8 @@ int GetMasterFileDescriptor (); - CommandInterpreter & - GetCommandInterpreter (); + CommandInterpreter & + GetCommandInterpreter(); static std::string LanguageToString (lldb::ScriptLanguage language); @@ -530,4 +527,4 @@ } // namespace lldb_private -#endif // #ifndef liblldb_ScriptInterpreter_h_ +#endif // liblldb_ScriptInterpreter_h_ Index: include/lldb/Interpreter/OptionGroupArchitecture.h =================================================================== --- include/lldb/Interpreter/OptionGroupArchitecture.h +++ include/lldb/Interpreter/OptionGroupArchitecture.h @@ -29,24 +29,22 @@ OptionGroupArchitecture (); - virtual - ~OptionGroupArchitecture (); + ~OptionGroupArchitecture() override; + uint32_t + GetNumDefinitions() override; - virtual uint32_t - GetNumDefinitions (); + const OptionDefinition* + GetDefinitions() override; - virtual const OptionDefinition* - GetDefinitions (); + Error + SetOptionValue(CommandInterpreter &interpreter, + uint32_t option_idx, + const char *option_value) override; - virtual Error - SetOptionValue (CommandInterpreter &interpreter, - uint32_t option_idx, - const char *option_value); + void + OptionParsingStarting(CommandInterpreter &interpreter) override; - virtual void - OptionParsingStarting (CommandInterpreter &interpreter); - bool GetArchitecture (Platform *platform, ArchSpec &arch); @@ -55,6 +53,7 @@ { return !m_arch_str.empty(); } + const char * GetArchitectureName () { @@ -70,4 +69,4 @@ } // namespace lldb_private -#endif // liblldb_OptionGroupArchitecture_h_ +#endif // liblldb_OptionGroupArchitecture_h_ Index: include/lldb/Interpreter/OptionGroupWatchpoint.h =================================================================== --- include/lldb/Interpreter/OptionGroupWatchpoint.h +++ include/lldb/Interpreter/OptionGroupWatchpoint.h @@ -25,29 +25,27 @@ class OptionGroupWatchpoint : public OptionGroup { public: - + OptionGroupWatchpoint (); + + ~OptionGroupWatchpoint() override; + static bool IsWatchSizeSupported(uint32_t watch_size); - OptionGroupWatchpoint (); - - virtual - ~OptionGroupWatchpoint (); + uint32_t + GetNumDefinitions() override; - virtual uint32_t - GetNumDefinitions (); + const OptionDefinition* + GetDefinitions() override; - virtual const OptionDefinition* - GetDefinitions (); + Error + SetOptionValue(CommandInterpreter &interpreter, + uint32_t option_idx, + const char *option_arg) override; - virtual Error - SetOptionValue (CommandInterpreter &interpreter, - uint32_t option_idx, - const char *option_arg); + void + OptionParsingStarting(CommandInterpreter &interpreter) override; - virtual void - OptionParsingStarting (CommandInterpreter &interpreter); - // Note: // eWatchRead == LLDB_WATCH_TYPE_READ; and // eWatchWrite == LLDB_WATCH_TYPE_WRITE @@ -68,4 +66,4 @@ } // namespace lldb_private -#endif // liblldb_OptionGroupWatchpoint_h_ +#endif // liblldb_OptionGroupWatchpoint_h_ Index: include/lldb/Interpreter/CommandObjectMultiword.h =================================================================== --- include/lldb/Interpreter/CommandObjectMultiword.h +++ include/lldb/Interpreter/CommandObjectMultiword.h @@ -36,51 +36,60 @@ const char *syntax = NULL, uint32_t flags = 0); - virtual - ~CommandObjectMultiword (); + ~CommandObjectMultiword() override; - virtual bool - IsMultiwordObject () { return true; } + bool + IsMultiwordObject() override + { + return true; + } - virtual bool - LoadSubCommand (const char *cmd_name, - const lldb::CommandObjectSP& command_obj); + bool + LoadSubCommand(const char *cmd_name, + const lldb::CommandObjectSP& command_obj) override; - virtual void - GenerateHelpText (Stream &output_stream); + void + GenerateHelpText(Stream &output_stream) override; - virtual lldb::CommandObjectSP - GetSubcommandSP (const char *sub_cmd, StringList *matches = NULL); + lldb::CommandObjectSP + GetSubcommandSP(const char *sub_cmd, StringList *matches = NULL) override; - virtual CommandObject * - GetSubcommandObject (const char *sub_cmd, StringList *matches = NULL); + CommandObject * + GetSubcommandObject(const char *sub_cmd, StringList *matches = NULL) override; - virtual void - AproposAllSubCommands (const char *prefix, - const char *search_word, - StringList &commands_found, - StringList &commands_help); + void + AproposAllSubCommands(const char *prefix, + const char *search_word, + StringList &commands_found, + StringList &commands_help) override; - virtual bool - WantsRawCommandString() { return false; } + bool + WantsRawCommandString() override + { + return false; + } - virtual int - HandleCompletion (Args &input, - int &cursor_index, - int &cursor_char_position, - int match_start_point, - int max_return_elements, - bool &word_complete, - StringList &matches); + int + HandleCompletion(Args &input, + int &cursor_index, + int &cursor_char_position, + int match_start_point, + int max_return_elements, + bool &word_complete, + StringList &matches) override; - virtual const char *GetRepeatCommand (Args ¤t_command_args, uint32_t index); + const char * + GetRepeatCommand (Args ¤t_command_args, uint32_t index) override; - virtual bool - Execute (const char *args_string, - CommandReturnObject &result); + bool + Execute(const char *args_string, + CommandReturnObject &result) override; - virtual bool - IsRemovable() const { return m_can_be_removed; } + bool + IsRemovable() const override + { + return m_can_be_removed; + } void SetRemovable (bool removable) @@ -93,7 +102,6 @@ CommandObject::CommandMap m_subcommand_dict; bool m_can_be_removed; }; - class CommandObjectProxy : public CommandObject { @@ -104,84 +112,80 @@ const char *syntax = NULL, uint32_t flags = 0); - virtual - ~CommandObjectProxy (); + ~CommandObjectProxy() override; // Subclasses must provide a command object that will be transparently // used for this object. virtual CommandObject * GetProxyCommandObject() = 0; - virtual const char * - GetHelpLong (); + const char * + GetHelpLong() override; - virtual bool - IsRemovable() const; + bool + IsRemovable() const override; - virtual bool - IsMultiwordObject (); + bool + IsMultiwordObject() override; - virtual lldb::CommandObjectSP - GetSubcommandSP (const char *sub_cmd, StringList *matches = NULL); + lldb::CommandObjectSP + GetSubcommandSP(const char *sub_cmd, StringList *matches = NULL) override; - virtual CommandObject * - GetSubcommandObject (const char *sub_cmd, StringList *matches = NULL); + CommandObject * + GetSubcommandObject(const char *sub_cmd, StringList *matches = NULL) override; - virtual void - AproposAllSubCommands (const char *prefix, - const char *search_word, - StringList &commands_found, - StringList &commands_help); + void + AproposAllSubCommands(const char *prefix, + const char *search_word, + StringList &commands_found, + StringList &commands_help) override; - virtual bool - LoadSubCommand (const char *cmd_name, - const lldb::CommandObjectSP& command_obj); + bool + LoadSubCommand(const char *cmd_name, + const lldb::CommandObjectSP& command_obj) override; - virtual bool - WantsRawCommandString(); + bool + WantsRawCommandString() override; - virtual bool - WantsCompletion(); + bool + WantsCompletion() override; - virtual Options * - GetOptions (); - + Options * + GetOptions() override; - virtual int - HandleCompletion (Args &input, - int &cursor_index, - int &cursor_char_position, - int match_start_point, - int max_return_elements, - bool &word_complete, - StringList &matches); + int + HandleCompletion(Args &input, + int &cursor_index, + int &cursor_char_position, + int match_start_point, + int max_return_elements, + bool &word_complete, + StringList &matches) override; - virtual int - HandleArgumentCompletion (Args &input, - int &cursor_index, - int &cursor_char_position, - OptionElementVector &opt_element_vector, - int match_start_point, - int max_return_elements, - bool &word_complete, - StringList &matches); + int + HandleArgumentCompletion(Args &input, + int &cursor_index, + int &cursor_char_position, + OptionElementVector &opt_element_vector, + int match_start_point, + int max_return_elements, + bool &word_complete, + StringList &matches) override; - virtual const char * - GetRepeatCommand (Args ¤t_command_args, - uint32_t index); + const char * + GetRepeatCommand(Args ¤t_command_args, + uint32_t index) override; - virtual bool - Execute (const char *args_string, - CommandReturnObject &result); + bool + Execute(const char *args_string, + CommandReturnObject &result) override; protected: - // These two want to iterate over the subcommand dictionary. friend class CommandInterpreter; friend class CommandObjectSyntax; - }; } // namespace lldb_private -#endif // liblldb_CommandObjectMultiword_h_ +#endif // liblldb_CommandObjectMultiword_h_ Index: include/lldb/Interpreter/OptionGroupString.h =================================================================== --- include/lldb/Interpreter/OptionGroupString.h +++ include/lldb/Interpreter/OptionGroupString.h @@ -25,7 +25,6 @@ class OptionGroupString : public OptionGroup { public: - OptionGroupString (uint32_t usage_mask, bool required, const char *long_option, @@ -35,29 +34,27 @@ const char *usage_text, const char *default_value); - virtual - ~OptionGroupString (); - - - virtual uint32_t - GetNumDefinitions () + ~OptionGroupString() override; + + uint32_t + GetNumDefinitions() override { return 1; } - virtual const OptionDefinition* - GetDefinitions () + const OptionDefinition* + GetDefinitions() override { return &m_option_definition; } - virtual Error - SetOptionValue (CommandInterpreter &interpreter, - uint32_t option_idx, - const char *option_value); + Error + SetOptionValue(CommandInterpreter &interpreter, + uint32_t option_idx, + const char *option_value) override; - virtual void - OptionParsingStarting (CommandInterpreter &interpreter); + void + OptionParsingStarting(CommandInterpreter &interpreter) override; OptionValueString & GetOptionValue () @@ -74,9 +71,8 @@ protected: OptionValueString m_value; OptionDefinition m_option_definition; - }; } // namespace lldb_private -#endif // liblldb_OptionGroupString_h_ +#endif // liblldb_OptionGroupString_h_ Index: include/lldb/Interpreter/OptionGroupOutputFile.h =================================================================== --- include/lldb/Interpreter/OptionGroupOutputFile.h +++ include/lldb/Interpreter/OptionGroupOutputFile.h @@ -26,27 +26,24 @@ class OptionGroupOutputFile : public OptionGroup { public: - OptionGroupOutputFile (); - virtual - ~OptionGroupOutputFile (); + ~OptionGroupOutputFile() override; + uint32_t + GetNumDefinitions() override; - virtual uint32_t - GetNumDefinitions (); + const OptionDefinition* + GetDefinitions() override; - virtual const OptionDefinition* - GetDefinitions (); + Error + SetOptionValue(CommandInterpreter &interpreter, + uint32_t option_idx, + const char *option_value) override; - virtual Error - SetOptionValue (CommandInterpreter &interpreter, - uint32_t option_idx, - const char *option_value); + void + OptionParsingStarting(CommandInterpreter &interpreter) override; - virtual void - OptionParsingStarting (CommandInterpreter &interpreter); - const OptionValueFileSpec & GetFile () { @@ -68,9 +65,8 @@ protected: OptionValueFileSpec m_file; OptionValueBoolean m_append; - }; } // namespace lldb_private -#endif // liblldb_OptionGroupOutputFile_h_ +#endif // liblldb_OptionGroupOutputFile_h_ Index: include/lldb/Interpreter/CommandObject.h =================================================================== --- include/lldb/Interpreter/CommandObject.h +++ include/lldb/Interpreter/CommandObject.h @@ -10,11 +10,15 @@ #ifndef liblldb_CommandObject_h_ #define liblldb_CommandObject_h_ +// C Includes +// C++ Includes #include <map> #include <set> #include <string> #include <vector> +// Other libraries and framework includes +// Project includes #include "lldb/lldb-private.h" #include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/CommandCompletions.h" @@ -28,7 +32,6 @@ class CommandObject { public: - typedef const char *(ArgumentHelpCallbackFunction) (); struct ArgumentHelpCallback @@ -46,7 +49,6 @@ { return (help_callback != NULL); } - }; struct ArgumentTableEntry // Entries in the main argument information table @@ -85,7 +87,6 @@ virtual ~CommandObject (); - static const char * GetArgumentTypeAsCString (const lldb::CommandArgumentType arg_type); @@ -326,7 +327,6 @@ /// @return /// The number of completions. //------------------------------------------------------------------ - virtual int HandleArgumentCompletion (Args &input, int &cursor_index, @@ -488,13 +488,11 @@ // to the specified command argument entry. static void AddIDsArgumentData(CommandArgumentEntry &arg, lldb::CommandArgumentType ID, lldb::CommandArgumentType IDRange); - }; class CommandObjectParsed : public CommandObject { public: - CommandObjectParsed (CommandInterpreter &interpreter, const char *name, const char *help = NULL, @@ -502,25 +500,26 @@ uint32_t flags = 0) : CommandObject (interpreter, name, help, syntax, flags) {} - virtual - ~CommandObjectParsed () {} + ~CommandObjectParsed() override = default; - virtual bool - Execute (const char *args_string, CommandReturnObject &result); + bool + Execute(const char *args_string, CommandReturnObject &result) override; protected: virtual bool DoExecute (Args& command, CommandReturnObject &result) = 0; - virtual bool - WantsRawCommandString() { return false; } + bool + WantsRawCommandString() override + { + return false; + } }; class CommandObjectRaw : public CommandObject { public: - CommandObjectRaw (CommandInterpreter &interpreter, const char *name, const char *help = NULL, @@ -528,22 +527,22 @@ uint32_t flags = 0) : CommandObject (interpreter, name, help, syntax, flags) {} - virtual - ~CommandObjectRaw () {} + ~CommandObjectRaw() override = default; - virtual bool - Execute (const char *args_string, CommandReturnObject &result); + bool + Execute(const char *args_string, CommandReturnObject &result) override; protected: virtual bool DoExecute (const char *command, CommandReturnObject &result) = 0; - virtual bool - WantsRawCommandString() { return true; } + bool + WantsRawCommandString() override + { + return true; + } }; - } // namespace lldb_private - -#endif // liblldb_CommandObject_h_ +#endif // liblldb_CommandObject_h_ Index: include/lldb/Interpreter/CommandInterpreter.h =================================================================== --- include/lldb/Interpreter/CommandInterpreter.h +++ include/lldb/Interpreter/CommandInterpreter.h @@ -200,8 +200,6 @@ public IOHandlerDelegate { public: - - typedef std::map<std::string, OptionArgVectorSP> OptionArgMap; enum @@ -229,11 +227,17 @@ 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(); } @@ -242,13 +246,6 @@ 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, @@ -306,7 +303,6 @@ OptionArgVectorSP GetAliasOptions (const char *alias_name); - bool ProcessAliasOptionsArgs (lldb::CommandObjectSP &cmd_obj_sp, const char *options_args, @@ -394,7 +390,6 @@ // 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, @@ -407,7 +402,6 @@ // 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, @@ -417,7 +411,6 @@ bool &word_complete, StringList &matches); - int GetCommandNamesMatchingPartialString (const char *cmd_cstr, bool include_aliases, @@ -497,7 +490,6 @@ void SetScriptLanguage (lldb::ScriptLanguage lang); - bool HasCommands (); @@ -665,20 +657,20 @@ //------------------------------------------------------------------ // 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 (); @@ -688,10 +680,8 @@ lldb::CommandObjectSP GetCommandSP (const char *cmd, bool include_aliases = true, bool exact = true, StringList *matches = NULL); - private: - Error PreprocessCommand (std::string &command); @@ -701,7 +691,6 @@ 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; @@ -723,10 +712,8 @@ 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_ Index: include/lldb/Interpreter/CommandOptionValidators.h =================================================================== --- include/lldb/Interpreter/CommandOptionValidators.h +++ include/lldb/Interpreter/CommandOptionValidators.h @@ -10,6 +10,10 @@ #ifndef liblldb_CommandOptionValidators_h_ #define liblldb_CommandOptionValidators_h_ +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes #include "lldb/lldb-private-types.h" namespace lldb_private { @@ -19,12 +23,11 @@ class PosixPlatformCommandOptionValidator : public OptionValidator { - virtual bool IsValid(Platform &platform, const ExecutionContext &target) const; - virtual const char* ShortConditionString() const; - virtual const char* LongConditionString() const; + bool IsValid(Platform &platform, const ExecutionContext &target) const override; + const char* ShortConditionString() const override; + const char* LongConditionString() const override; }; } // namespace lldb_private - -#endif // liblldb_CommandOptionValidators_h_ +#endif // liblldb_CommandOptionValidators_h_ Index: include/lldb/Interpreter/OptionGroupUInt64.h =================================================================== --- include/lldb/Interpreter/OptionGroupUInt64.h +++ include/lldb/Interpreter/OptionGroupUInt64.h @@ -18,6 +18,7 @@ #include "lldb/Interpreter/OptionValueUInt64.h" namespace lldb_private { + //------------------------------------------------------------------------- // OptionGroupUInt64 //------------------------------------------------------------------------- @@ -25,7 +26,6 @@ class OptionGroupUInt64 : public OptionGroup { public: - OptionGroupUInt64 (uint32_t usage_mask, bool required, const char *long_option, @@ -35,29 +35,27 @@ const char *usage_text, uint64_t default_value); - virtual - ~OptionGroupUInt64 (); - - - virtual uint32_t - GetNumDefinitions () + ~OptionGroupUInt64() override; + + uint32_t + GetNumDefinitions() override { return 1; } - virtual const OptionDefinition* - GetDefinitions () + const OptionDefinition* + GetDefinitions() override { return &m_option_definition; } - virtual Error - SetOptionValue (CommandInterpreter &interpreter, - uint32_t option_idx, - const char *option_value); + Error + SetOptionValue(CommandInterpreter &interpreter, + uint32_t option_idx, + const char *option_value) override; - virtual void - OptionParsingStarting (CommandInterpreter &interpreter); + void + OptionParsingStarting(CommandInterpreter &interpreter) override; OptionValueUInt64 & GetOptionValue () @@ -74,9 +72,8 @@ protected: OptionValueUInt64 m_value; OptionDefinition m_option_definition; - }; } // namespace lldb_private -#endif // liblldb_OptionGroupUInt64_h_ +#endif // liblldb_OptionGroupUInt64_h_ Index: include/lldb/Interpreter/OptionGroupFormat.h =================================================================== --- include/lldb/Interpreter/OptionGroupFormat.h +++ include/lldb/Interpreter/OptionGroupFormat.h @@ -37,24 +37,22 @@ uint64_t default_byte_size = UINT64_MAX, // Pass UINT64_MAX to disable the "--size" option uint64_t default_count = UINT64_MAX); // Pass UINT64_MAX to disable the "--count" option - virtual - ~OptionGroupFormat (); + ~OptionGroupFormat() override; + uint32_t + GetNumDefinitions() override; - virtual uint32_t - GetNumDefinitions (); + const OptionDefinition* + GetDefinitions() override; - virtual const OptionDefinition* - GetDefinitions (); + Error + SetOptionValue(CommandInterpreter &interpreter, + uint32_t option_idx, + const char *option_value) override; - virtual Error - SetOptionValue (CommandInterpreter &interpreter, - uint32_t option_idx, - const char *option_value); + void + OptionParsingStarting(CommandInterpreter &interpreter) override; - virtual void - OptionParsingStarting (CommandInterpreter &interpreter); - lldb::Format GetFormat () const { @@ -112,7 +110,6 @@ } protected: - bool ParserGDBFormatLetter (CommandInterpreter &interpreter, char format_letter, @@ -124,10 +121,9 @@ OptionValueUInt64 m_count; char m_prev_gdb_format; char m_prev_gdb_size; - bool m_has_gdb_format; }; } // namespace lldb_private -#endif // liblldb_OptionGroupFormat_h_ +#endif // liblldb_OptionGroupFormat_h_ Index: include/lldb/Interpreter/Options.h =================================================================== --- include/lldb/Interpreter/Options.h +++ include/lldb/Interpreter/Options.h @@ -11,7 +11,6 @@ #define liblldb_Options_h_ // C Includes - // C++ Includes #include <set> #include <vector> @@ -32,7 +31,6 @@ return isprint(ch); } - //---------------------------------------------------------------------- /// @class Options Options.h "lldb/Interpreter/Options.h" /// @brief A command line option parsing protocol class. @@ -119,7 +117,6 @@ class Options { public: - Options (CommandInterpreter &interpreter); virtual @@ -153,7 +150,6 @@ // Verify that the options given are in the options table and can // be used together, but there may be some required options that are // missing (used to verify options that get folded into command aliases). - bool VerifyPartialOptions (CommandReturnObject &result); @@ -359,15 +355,11 @@ class OptionGroup { public: - OptionGroup () - { - } - + OptionGroup() = default; + virtual - ~OptionGroup () - { - } - + ~OptionGroup() = default; + virtual uint32_t GetNumDefinitions () = 0; @@ -395,7 +387,6 @@ class OptionGroupOptions : public Options { public: - OptionGroupOptions (CommandInterpreter &interpreter) : Options (interpreter), m_option_defs (), @@ -404,12 +395,8 @@ { } - virtual - ~OptionGroupOptions () - { - } - - + ~OptionGroupOptions() override = default; + //---------------------------------------------------------------------- /// Append options from a OptionGroup class. /// @@ -459,18 +446,18 @@ return m_did_finalize; } - virtual Error - SetOptionValue (uint32_t option_idx, - const char *option_arg); + Error + SetOptionValue(uint32_t option_idx, + const char *option_arg) override; - virtual void - OptionParsingStarting (); + void + OptionParsingStarting() override; - virtual Error - OptionParsingFinished (); + Error + OptionParsingFinished() override; const OptionDefinition* - GetDefinitions () + GetDefinitions() override { assert (m_did_finalize); return &m_option_defs[0]; @@ -495,8 +482,7 @@ OptionInfos m_option_infos; bool m_did_finalize; }; - } // namespace lldb_private -#endif // liblldb_Options_h_ +#endif // liblldb_Options_h_ Index: include/lldb/Interpreter/CommandCompletions.h =================================================================== --- include/lldb/Interpreter/CommandCompletions.h +++ include/lldb/Interpreter/CommandCompletions.h @@ -54,7 +54,6 @@ // 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) - } CommonCompletionTypes; struct CommonCompletionElement @@ -83,6 +82,7 @@ SearchFilter *searcher, bool &word_complete, StringList &matches); + static int DiskDirectories (CommandInterpreter &interpreter, const char *partial_file_name, @@ -170,16 +170,16 @@ int max_return_elements, StringList &matches); - virtual ~Completer (); + ~Completer() override; - virtual CallbackReturn - SearchCallback (SearchFilter &filter, - SymbolContext &context, - Address *addr, - bool complete) = 0; + CallbackReturn + SearchCallback(SearchFilter &filter, + SymbolContext &context, + Address *addr, + bool complete) override = 0; - virtual Depth - GetDepth () = 0; + Depth + GetDepth() override = 0; virtual size_t DoCompletion (SearchFilter *filter) = 0; @@ -190,8 +190,9 @@ int m_match_start_point; int m_max_return_elements; StringList &m_matches; + private: - DISALLOW_COPY_AND_ASSIGN (Completer); + DISALLOW_COPY_AND_ASSIGN(Completer); }; //---------------------------------------------------------------------- @@ -200,7 +201,6 @@ class SourceFileCompleter : public Completer { public: - SourceFileCompleter (CommandInterpreter &interpreter, bool include_support_files, const char *completion_str, @@ -208,24 +208,24 @@ int max_return_elements, StringList &matches); - virtual Searcher::Depth GetDepth (); + Searcher::Depth GetDepth() override; - virtual Searcher::CallbackReturn - SearchCallback (SearchFilter &filter, - SymbolContext &context, - Address *addr, - bool complete); + Searcher::CallbackReturn + SearchCallback(SearchFilter &filter, + SymbolContext &context, + Address *addr, + bool complete) override; size_t - DoCompletion (SearchFilter *filter); + 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); + DISALLOW_COPY_AND_ASSIGN(SourceFileCompleter); }; //---------------------------------------------------------------------- @@ -234,29 +234,28 @@ class ModuleCompleter : public Completer { public: - ModuleCompleter (CommandInterpreter &interpreter, const char *completion_str, int match_start_point, int max_return_elements, StringList &matches); - virtual Searcher::Depth GetDepth (); + Searcher::Depth GetDepth() override; - virtual Searcher::CallbackReturn - SearchCallback (SearchFilter &filter, - SymbolContext &context, - Address *addr, - bool complete); + Searcher::CallbackReturn + SearchCallback(SearchFilter &filter, + SymbolContext &context, + Address *addr, + bool complete) override; size_t - DoCompletion (SearchFilter *filter); + DoCompletion(SearchFilter *filter) override; private: const char *m_file_name; const char *m_dir_name; - DISALLOW_COPY_AND_ASSIGN (ModuleCompleter); + DISALLOW_COPY_AND_ASSIGN(ModuleCompleter); }; //---------------------------------------------------------------------- @@ -265,23 +264,22 @@ class SymbolCompleter : public Completer { public: - SymbolCompleter (CommandInterpreter &interpreter, const char *completion_str, int match_start_point, int max_return_elements, StringList &matches); - virtual Searcher::Depth GetDepth (); + Searcher::Depth GetDepth() override; - virtual Searcher::CallbackReturn - SearchCallback (SearchFilter &filter, - SymbolContext &context, - Address *addr, - bool complete); + Searcher::CallbackReturn + SearchCallback(SearchFilter &filter, + SymbolContext &context, + Address *addr, + bool complete) override; size_t - DoCompletion (SearchFilter *filter); + DoCompletion(SearchFilter *filter) override; private: // struct NameCmp { @@ -294,14 +292,14 @@ RegularExpression m_regex; typedef std::set<ConstString> collection; collection m_match_set; - DISALLOW_COPY_AND_ASSIGN (SymbolCompleter); + DISALLOW_COPY_AND_ASSIGN(SymbolCompleter); }; private: static CommonCompletionElement g_common_completions[]; - }; } // namespace lldb_private -#endif // lldb_CommandCompletions_h_ + +#endif // lldb_CommandCompletions_h_ Index: include/lldb/Interpreter/OptionGroupVariable.h =================================================================== --- include/lldb/Interpreter/OptionGroupVariable.h +++ include/lldb/Interpreter/OptionGroupVariable.h @@ -26,26 +26,24 @@ class OptionGroupVariable : public OptionGroup { public: - OptionGroupVariable (bool show_frame_options); - virtual - ~OptionGroupVariable (); + ~OptionGroupVariable() override; + + uint32_t + GetNumDefinitions() override; - virtual uint32_t - GetNumDefinitions (); + const OptionDefinition* + GetDefinitions() override; - virtual const OptionDefinition* - GetDefinitions (); + Error + SetOptionValue(CommandInterpreter &interpreter, + uint32_t option_idx, + const char *option_arg) override; - virtual Error - SetOptionValue (CommandInterpreter &interpreter, - uint32_t option_idx, - const char *option_arg); + void + OptionParsingStarting(CommandInterpreter &interpreter) override; - virtual void - OptionParsingStarting (CommandInterpreter &interpreter); - bool include_frame_options:1, show_args:1, // Frame option only (include_frame_options == true) show_locals:1, // Frame option only (include_frame_options == true) @@ -62,4 +60,4 @@ } // namespace lldb_private -#endif // liblldb_OptionGroupVariable_h_ +#endif // liblldb_OptionGroupVariable_h_ Index: include/lldb/Interpreter/OptionGroupBoolean.h =================================================================== --- include/lldb/Interpreter/OptionGroupBoolean.h +++ include/lldb/Interpreter/OptionGroupBoolean.h @@ -36,29 +36,27 @@ bool default_value, bool no_argument_toggle_default); - virtual - ~OptionGroupBoolean (); - - - virtual uint32_t - GetNumDefinitions () + ~OptionGroupBoolean() override; + + uint32_t + GetNumDefinitions() override { return 1; } - virtual const OptionDefinition* - GetDefinitions () + const OptionDefinition* + GetDefinitions() override { return &m_option_definition; } - virtual Error - SetOptionValue (CommandInterpreter &interpreter, - uint32_t option_idx, - const char *option_value); + Error + SetOptionValue(CommandInterpreter &interpreter, + uint32_t option_idx, + const char *option_value) override; - virtual void - OptionParsingStarting (CommandInterpreter &interpreter); + void + OptionParsingStarting(CommandInterpreter &interpreter) override; OptionValueBoolean & GetOptionValue () @@ -75,9 +73,8 @@ protected: OptionValueBoolean m_value; OptionDefinition m_option_definition; - }; } // namespace lldb_private -#endif // liblldb_OptionGroupBoolean_h_ +#endif // liblldb_OptionGroupBoolean_h_ Index: include/lldb/Interpreter/OptionGroupFile.h =================================================================== --- include/lldb/Interpreter/OptionGroupFile.h +++ include/lldb/Interpreter/OptionGroupFile.h @@ -27,7 +27,6 @@ class OptionGroupFile : public OptionGroup { public: - OptionGroupFile (uint32_t usage_mask, bool required, const char *long_option, @@ -36,29 +35,27 @@ lldb::CommandArgumentType argument_type, const char *usage_text); - virtual - ~OptionGroupFile (); + ~OptionGroupFile() override; - - virtual uint32_t - GetNumDefinitions () + uint32_t + GetNumDefinitions() override { return 1; } - virtual const OptionDefinition* - GetDefinitions () + const OptionDefinition* + GetDefinitions() override { return &m_option_definition; } - virtual Error - SetOptionValue (CommandInterpreter &interpreter, - uint32_t option_idx, - const char *option_value); + Error + SetOptionValue(CommandInterpreter &interpreter, + uint32_t option_idx, + const char *option_value) override; - virtual void - OptionParsingStarting (CommandInterpreter &interpreter); + void + OptionParsingStarting(CommandInterpreter &interpreter) override; OptionValueFileSpec & GetOptionValue () @@ -75,7 +72,6 @@ protected: OptionValueFileSpec m_file; OptionDefinition m_option_definition; - }; //------------------------------------------------------------------------- @@ -94,30 +90,27 @@ lldb::CommandArgumentType argument_type, const char *usage_text); - virtual - ~OptionGroupFileList (); + ~OptionGroupFileList() override; - - virtual uint32_t - GetNumDefinitions () + uint32_t + GetNumDefinitions() override { return 1; } - virtual const OptionDefinition* - GetDefinitions () + const OptionDefinition* + GetDefinitions() override { return &m_option_definition; } - virtual Error - SetOptionValue (CommandInterpreter &interpreter, - uint32_t option_idx, - const char *option_value); + Error + SetOptionValue(CommandInterpreter &interpreter, + uint32_t option_idx, + const char *option_value) override; - virtual void - OptionParsingStarting (CommandInterpreter &interpreter); - + void + OptionParsingStarting(CommandInterpreter &interpreter) override; OptionValueFileSpecList & GetOptionValue () @@ -134,9 +127,8 @@ protected: OptionValueFileSpecList m_file_list; OptionDefinition m_option_definition; - }; } // namespace lldb_private -#endif // liblldb_OptionGroupFile_h_ +#endif // liblldb_OptionGroupFile_h_ Index: include/lldb/Interpreter/OptionGroupUUID.h =================================================================== --- include/lldb/Interpreter/OptionGroupUUID.h +++ include/lldb/Interpreter/OptionGroupUUID.h @@ -18,6 +18,7 @@ #include "lldb/Interpreter/OptionValueUUID.h" namespace lldb_private { + //------------------------------------------------------------------------- // OptionGroupUUID //------------------------------------------------------------------------- @@ -25,27 +26,24 @@ class OptionGroupUUID : public OptionGroup { public: - OptionGroupUUID (); - virtual - ~OptionGroupUUID (); + ~OptionGroupUUID() override; + uint32_t + GetNumDefinitions() override; - virtual uint32_t - GetNumDefinitions (); + const OptionDefinition* + GetDefinitions() override; - virtual const OptionDefinition* - GetDefinitions (); + Error + SetOptionValue(CommandInterpreter &interpreter, + uint32_t option_idx, + const char *option_value) override; - virtual Error - SetOptionValue (CommandInterpreter &interpreter, - uint32_t option_idx, - const char *option_value); + void + OptionParsingStarting(CommandInterpreter &interpreter) override; - virtual void - OptionParsingStarting (CommandInterpreter &interpreter); - const OptionValueUUID & GetOptionValue () const { @@ -58,4 +56,4 @@ } // namespace lldb_private -#endif // liblldb_OptionGroupUUID_h_ +#endif // liblldb_OptionGroupUUID_h_ Index: include/lldb/Interpreter/CommandObjectRegexCommand.h =================================================================== --- include/lldb/Interpreter/CommandObjectRegexCommand.h +++ include/lldb/Interpreter/CommandObjectRegexCommand.h @@ -28,7 +28,6 @@ class CommandObjectRegexCommand : public CommandObjectRaw { public: - CommandObjectRegexCommand (CommandInterpreter &interpreter, const char *name, const char *help, @@ -37,8 +36,7 @@ uint32_t completion_type_mask, bool is_removable); - virtual - ~CommandObjectRegexCommand (); + ~CommandObjectRegexCommand() override; bool IsRemovable () const override { return m_is_removable; } @@ -83,4 +81,4 @@ } // namespace lldb_private -#endif // liblldb_CommandObjectRegexCommand_h_ +#endif // liblldb_CommandObjectRegexCommand_h_ Index: include/lldb/Interpreter/OptionGroupValueObjectDisplay.h =================================================================== --- include/lldb/Interpreter/OptionGroupValueObjectDisplay.h +++ include/lldb/Interpreter/OptionGroupValueObjectDisplay.h @@ -26,41 +26,38 @@ class OptionGroupValueObjectDisplay : public OptionGroup { public: - OptionGroupValueObjectDisplay (); - virtual - ~OptionGroupValueObjectDisplay (); + ~OptionGroupValueObjectDisplay() override; + uint32_t + GetNumDefinitions() override; - virtual uint32_t - GetNumDefinitions (); + const OptionDefinition* + GetDefinitions() override; - virtual const OptionDefinition* - GetDefinitions (); + Error + SetOptionValue(CommandInterpreter &interpreter, + uint32_t option_idx, + const char *option_value) override; - virtual Error - SetOptionValue (CommandInterpreter &interpreter, - uint32_t option_idx, - const char *option_value); + void + OptionParsingStarting(CommandInterpreter &interpreter) override; - virtual void - OptionParsingStarting (CommandInterpreter &interpreter); - bool AnyOptionWasSet () const { - return show_types == true || - no_summary_depth != 0 || - show_location == true || - flat_output == true || - use_objc == true || + return show_types || + no_summary_depth != 0 || + show_location || + flat_output || + use_objc || max_depth != UINT32_MAX || ptr_depth != 0 || - use_synth == false || - be_raw == true || - ignore_cap == true || - run_validator == true; + !use_synth || + be_raw || + ignore_cap || + run_validator; } DumpValueObjectOptions @@ -85,4 +82,4 @@ } // namespace lldb_private -#endif // liblldb_OptionGroupValueObjectDisplay_h_ +#endif // liblldb_OptionGroupValueObjectDisplay_h_ Index: include/lldb/Interpreter/OptionGroupPlatform.h =================================================================== --- include/lldb/Interpreter/OptionGroupPlatform.h +++ include/lldb/Interpreter/OptionGroupPlatform.h @@ -27,7 +27,6 @@ class OptionGroupPlatform : public OptionGroup { public: - OptionGroupPlatform (bool include_platform_option) : OptionGroup(), m_platform_name (), @@ -39,24 +38,21 @@ { } - virtual - ~OptionGroupPlatform () - { - } + ~OptionGroupPlatform() override = default; - virtual uint32_t - GetNumDefinitions (); + uint32_t + GetNumDefinitions() override; - virtual const OptionDefinition* - GetDefinitions (); + const OptionDefinition* + GetDefinitions() override; - virtual Error - SetOptionValue (CommandInterpreter &interpreter, - uint32_t option_idx, - const char *option_value); + Error + SetOptionValue(CommandInterpreter &interpreter, + uint32_t option_idx, + const char *option_value) override; - virtual void - OptionParsingStarting (CommandInterpreter &interpreter); + void + OptionParsingStarting(CommandInterpreter &interpreter) override; lldb::PlatformSP CreatePlatformWithOptions (CommandInterpreter &interpreter, @@ -119,4 +115,4 @@ } // namespace lldb_private -#endif // liblldb_OptionGroupPlatform_h_ +#endif // liblldb_OptionGroupPlatform_h_
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits