Index: include/lldb/Target/ABI.h =================================================================== --- include/lldb/Target/ABI.h +++ include/lldb/Target/ABI.h @@ -44,8 +44,7 @@ std::unique_ptr data_ap; /* host data pointer */ }; - virtual - ~ABI(); + ~ABI() override; virtual size_t GetRedZoneSize () const = 0; @@ -148,14 +147,17 @@ FindPlugin (const ArchSpec &arch); protected: + //------------------------------------------------------------------ // Classes that inherit from ABI can see and modify these //------------------------------------------------------------------ ABI(); + private: + DISALLOW_COPY_AND_ASSIGN (ABI); }; } // namespace lldb_private -#endif // liblldb_ABI_h_ +#endif // liblldb_ABI_h_ Index: include/lldb/Target/CPPLanguageRuntime.h =================================================================== --- include/lldb/Target/CPPLanguageRuntime.h +++ include/lldb/Target/CPPLanguageRuntime.h @@ -114,11 +114,10 @@ bool m_parse_error; }; - virtual - ~CPPLanguageRuntime(); + ~CPPLanguageRuntime() override; - virtual lldb::LanguageType - GetLanguageType () const + lldb::LanguageType + GetLanguageType() const override { return lldb::eLanguageTypeC_plus_plus; } @@ -126,11 +125,11 @@ virtual bool IsVTableName (const char *name) = 0; - virtual bool - GetObjectDescription (Stream &str, ValueObject &object); + bool + GetObjectDescription(Stream &str, ValueObject &object) override; - virtual bool - GetObjectDescription (Stream &str, Value &value, ExecutionContextScope *exe_scope); + bool + GetObjectDescription(Stream &str, Value &value, ExecutionContextScope *exe_scope) override; static bool IsCPPMangledName(const char *name); @@ -157,14 +156,17 @@ GetAlternateManglings(const ConstString &mangled, std::vector &alternates) = 0; protected: + //------------------------------------------------------------------ // Classes that inherit from CPPLanguageRuntime can see and modify these //------------------------------------------------------------------ CPPLanguageRuntime(Process *process); + private: + DISALLOW_COPY_AND_ASSIGN (CPPLanguageRuntime); }; } // namespace lldb_private -#endif // liblldb_CPPLanguageRuntime_h_ +#endif // liblldb_CPPLanguageRuntime_h_ Index: include/lldb/Target/DynamicLoader.h =================================================================== --- include/lldb/Target/DynamicLoader.h +++ include/lldb/Target/DynamicLoader.h @@ -71,8 +71,7 @@ /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. //------------------------------------------------------------------ - virtual - ~DynamicLoader (); + ~DynamicLoader() override; //------------------------------------------------------------------ /// Called after attaching a process. @@ -303,11 +302,12 @@ // Member variables. //------------------------------------------------------------------ Process* m_process; ///< The process that this dynamic loader plug-in is tracking. + private: + DISALLOW_COPY_AND_ASSIGN (DynamicLoader); - }; } // namespace lldb_private -#endif // liblldb_DynamicLoader_h_ +#endif // liblldb_DynamicLoader_h_ Index: include/lldb/Target/LanguageRuntime.h =================================================================== --- include/lldb/Target/LanguageRuntime.h +++ include/lldb/Target/LanguageRuntime.h @@ -29,8 +29,8 @@ public PluginInterface { public: - virtual - ~LanguageRuntime(); + + ~LanguageRuntime() override; static LanguageRuntime* FindPlugin (Process *process, lldb::LanguageType language); @@ -142,7 +142,6 @@ virtual void ModulesDidLoad (const ModuleList &module_list) { - return; } protected: @@ -153,9 +152,10 @@ LanguageRuntime(Process *process); Process *m_process; private: + DISALLOW_COPY_AND_ASSIGN (LanguageRuntime); }; } // namespace lldb_private -#endif // liblldb_LanguageRuntime_h_ +#endif // liblldb_LanguageRuntime_h_ Index: include/lldb/Target/OperatingSystem.h =================================================================== --- include/lldb/Target/OperatingSystem.h +++ include/lldb/Target/OperatingSystem.h @@ -32,7 +32,6 @@ class OperatingSystem : public PluginInterface - { public: //------------------------------------------------------------------ @@ -58,8 +57,7 @@ //------------------------------------------------------------------ OperatingSystem (Process *process); - virtual - ~OperatingSystem(); + ~OperatingSystem() override; //------------------------------------------------------------------ // Plug-in Methods @@ -98,4 +96,4 @@ } // namespace lldb_private -#endif // #ifndef liblldb_OperatingSystem_h_ +#endif // liblldb_OperatingSystem_h_ Index: include/lldb/Target/Platform.h =================================================================== --- include/lldb/Target/Platform.h +++ include/lldb/Target/Platform.h @@ -141,8 +141,7 @@ /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. //------------------------------------------------------------------ - virtual - ~Platform(); + ~Platform() override; //------------------------------------------------------------------ /// Find a platform plugin for a given process. @@ -1220,22 +1219,21 @@ public: OptionGroupPlatformRSync (); - virtual - ~OptionGroupPlatformRSync (); + ~OptionGroupPlatformRSync() override; - virtual lldb_private::Error - SetOptionValue (CommandInterpreter &interpreter, - uint32_t option_idx, - const char *option_value); + lldb_private::Error + SetOptionValue(CommandInterpreter &interpreter, + uint32_t option_idx, + const char *option_value) override; void - OptionParsingStarting (CommandInterpreter &interpreter); + OptionParsingStarting(CommandInterpreter &interpreter) override; const lldb_private::OptionDefinition* - GetDefinitions (); + GetDefinitions() override; - virtual uint32_t - GetNumDefinitions (); + uint32_t + GetNumDefinitions() override; // Options table: Required for subclasses of Options. @@ -1256,22 +1254,21 @@ public: OptionGroupPlatformSSH (); - virtual - ~OptionGroupPlatformSSH (); + ~OptionGroupPlatformSSH() override; - virtual lldb_private::Error - SetOptionValue (CommandInterpreter &interpreter, - uint32_t option_idx, - const char *option_value); + lldb_private::Error + SetOptionValue(CommandInterpreter &interpreter, + uint32_t option_idx, + const char *option_value) override; void - OptionParsingStarting (CommandInterpreter &interpreter); + OptionParsingStarting(CommandInterpreter &interpreter) override; - virtual uint32_t - GetNumDefinitions (); + uint32_t + GetNumDefinitions() override; const lldb_private::OptionDefinition* - GetDefinitions (); + GetDefinitions() override; // Options table: Required for subclasses of Options. @@ -1292,22 +1289,21 @@ public: OptionGroupPlatformCaching (); - virtual - ~OptionGroupPlatformCaching (); + ~OptionGroupPlatformCaching() override; - virtual lldb_private::Error - SetOptionValue (CommandInterpreter &interpreter, - uint32_t option_idx, - const char *option_value); + lldb_private::Error + SetOptionValue(CommandInterpreter &interpreter, + uint32_t option_idx, + const char *option_value) override; void - OptionParsingStarting (CommandInterpreter &interpreter); + OptionParsingStarting(CommandInterpreter &interpreter) override; - virtual uint32_t - GetNumDefinitions (); + uint32_t + GetNumDefinitions() override; const lldb_private::OptionDefinition* - GetDefinitions (); + GetDefinitions() override; // Options table: Required for subclasses of Options. @@ -1322,4 +1318,4 @@ } // namespace lldb_private -#endif // liblldb_Platform_h_ +#endif // liblldb_Platform_h_ Index: include/lldb/Target/Process.h =================================================================== --- include/lldb/Target/Process.h +++ include/lldb/Target/Process.h @@ -58,8 +58,7 @@ // Pass NULL for "process" if the ProcessProperties are to be the global copy ProcessProperties (lldb_private::Process *process); - virtual - ~ProcessProperties(); + ~ProcessProperties() override; bool GetDisableMemoryCache() const; @@ -410,22 +409,22 @@ OptionParsingStarting (); } - ~ProcessLaunchCommandOptions () + ~ProcessLaunchCommandOptions() override { } Error - SetOptionValue (uint32_t option_idx, const char *option_arg); + SetOptionValue (uint32_t option_idx, const char *option_arg) override; void - OptionParsingStarting () + OptionParsingStarting() override { launch_info.Clear(); disable_aslr = eLazyBoolCalculate; } const OptionDefinition* - GetDefinitions () + GetDefinitions() override { return g_option_table; } @@ -781,7 +780,7 @@ static ConstString &GetStaticBroadcasterClass (); - virtual ConstString &GetBroadcasterClass() const + ConstString &GetBroadcasterClass() const override { return GetStaticBroadcasterClass(); } @@ -811,13 +810,13 @@ ProcessEventData (); ProcessEventData (const lldb::ProcessSP &process, lldb::StateType state); - virtual ~ProcessEventData(); + ~ProcessEventData() override; static const ConstString & GetFlavorString (); - virtual const ConstString & - GetFlavor () const; + const ConstString & + GetFlavor() const override; lldb::ProcessSP GetProcessSP() const @@ -857,11 +856,11 @@ return m_interrupted; } - virtual void - Dump (Stream *s) const; + void + Dump(Stream *s) const override; - virtual void - DoOnRemoval (Event *event_ptr); + void + DoOnRemoval(Event *event_ptr) override; static const Process::ProcessEventData * GetEventDataFromEvent (const Event *event_ptr); @@ -958,8 +957,7 @@ /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. //------------------------------------------------------------------ - virtual - ~Process(); + ~Process() override; //------------------------------------------------------------------ /// Find a Process plug-in that can debug \a module using the @@ -3024,29 +3022,29 @@ //------------------------------------------------------------------ // lldb::ExecutionContextScope pure virtual functions //------------------------------------------------------------------ - virtual lldb::TargetSP - CalculateTarget (); + lldb::TargetSP + CalculateTarget() override; - virtual lldb::ProcessSP - CalculateProcess () + lldb::ProcessSP + CalculateProcess() override { return shared_from_this(); } - virtual lldb::ThreadSP - CalculateThread () + lldb::ThreadSP + CalculateThread() override { return lldb::ThreadSP(); } - virtual lldb::StackFrameSP - CalculateStackFrame () + lldb::StackFrameSP + CalculateStackFrame() override { return lldb::StackFrameSP(); } - virtual void - CalculateExecutionContext (ExecutionContext &exe_ctx); + void + CalculateExecutionContext(ExecutionContext &exe_ctx) override; void SetSTDIOFileDescriptor (int file_descriptor); @@ -3208,14 +3206,14 @@ public: AttachCompletionHandler (Process *process, uint32_t exec_count); - virtual - ~AttachCompletionHandler() + ~AttachCompletionHandler() override { } - virtual EventActionResult PerformAction (lldb::EventSP &event_sp); - virtual EventActionResult HandleBeingInterrupted (); - virtual const char *GetExitString(); + EventActionResult PerformAction(lldb::EventSP &event_sp) override; + EventActionResult HandleBeingInterrupted() override; + const char *GetExitString() override; + private: uint32_t m_exec_count; std::string m_exit_string; @@ -3429,15 +3427,15 @@ void LoadOperatingSystemPlugin(bool flush); private: + //------------------------------------------------------------------ // For Process only //------------------------------------------------------------------ void ControlPrivateStateThread (uint32_t signal); DISALLOW_COPY_AND_ASSIGN (Process); - }; } // namespace lldb_private -#endif // liblldb_Process_h_ +#endif // liblldb_Process_h_ Index: include/lldb/Target/StackFrame.h =================================================================== --- include/lldb/Target/StackFrame.h +++ include/lldb/Target/StackFrame.h @@ -135,7 +135,7 @@ const Address& pc, const SymbolContext *sc_ptr); - virtual ~StackFrame (); + ~StackFrame() override; lldb::ThreadSP GetThread () const @@ -468,20 +468,20 @@ //------------------------------------------------------------------ // lldb::ExecutionContextScope pure virtual functions //------------------------------------------------------------------ - virtual lldb::TargetSP - CalculateTarget (); + lldb::TargetSP + CalculateTarget() override; - virtual lldb::ProcessSP - CalculateProcess (); + lldb::ProcessSP + CalculateProcess() override; - virtual lldb::ThreadSP - CalculateThread (); + lldb::ThreadSP + CalculateThread() override; - virtual lldb::StackFrameSP - CalculateStackFrame (); + lldb::StackFrameSP + CalculateStackFrame() override; void - CalculateExecutionContext (ExecutionContext &exe_ctx); + CalculateExecutionContext(ExecutionContext &exe_ctx) override; protected: friend class StackFrameList; @@ -525,4 +525,4 @@ } // namespace lldb_private -#endif // liblldb_StackFrame_h_ +#endif // liblldb_StackFrame_h_ Index: include/lldb/Target/SystemRuntime.h =================================================================== --- include/lldb/Target/SystemRuntime.h +++ include/lldb/Target/SystemRuntime.h @@ -75,8 +75,7 @@ /// The destructor is virtual since this class is designed to be /// inherited by the plug-in instance. //------------------------------------------------------------------ - virtual - ~SystemRuntime(); + ~SystemRuntime() override; //------------------------------------------------------------------ /// Called after attaching to a process. @@ -354,9 +353,10 @@ std::vector m_types; private: + DISALLOW_COPY_AND_ASSIGN (SystemRuntime); }; } // namespace lldb_private -#endif // liblldb_SystemRuntime_h_ +#endif // liblldb_SystemRuntime_h_ Index: include/lldb/Target/TargetList.h =================================================================== --- include/lldb/Target/TargetList.h +++ include/lldb/Target/TargetList.h @@ -51,12 +51,12 @@ static ConstString &GetStaticBroadcasterClass (); - virtual ConstString &GetBroadcasterClass() const + ConstString &GetBroadcasterClass() const override { return GetStaticBroadcasterClass(); } - virtual ~TargetList(); + ~TargetList() override; //------------------------------------------------------------------ /// Create a new Target. @@ -230,7 +230,9 @@ lldb::TargetSP m_dummy_target_sp; mutable Mutex m_target_list_mutex; uint32_t m_selected_target_idx; + private: + lldb::TargetSP GetDummyTarget (lldb_private::Debugger &debugger); @@ -262,4 +264,4 @@ } // namespace lldb_private -#endif // liblldb_TargetList_h_ +#endif // liblldb_TargetList_h_ Index: include/lldb/Target/Thread.h =================================================================== --- include/lldb/Target/Thread.h +++ include/lldb/Target/Thread.h @@ -30,8 +30,7 @@ public: ThreadProperties(bool is_global); - virtual - ~ThreadProperties(); + ~ThreadProperties() override; //------------------------------------------------------------------ /// The regular expression returned determines symbols that this @@ -82,7 +81,7 @@ static ConstString &GetStaticBroadcasterClass (); - virtual ConstString &GetBroadcasterClass() const + ConstString &GetBroadcasterClass() const override { return GetStaticBroadcasterClass(); } @@ -97,19 +96,19 @@ ThreadEventData(); - virtual ~ThreadEventData(); + ~ThreadEventData() override; static const ConstString & GetFlavorString (); - virtual const ConstString & - GetFlavor () const + const ConstString & + GetFlavor() const override { return ThreadEventData::GetFlavorString (); } - virtual void - Dump (Stream *s) const; + void + Dump(Stream *s) const override; static const ThreadEventData * GetEventDataFromEvent (const Event *event_ptr); @@ -179,7 +178,7 @@ //------------------------------------------------------------------ Thread (Process &process, lldb::tid_t tid, bool use_invalid_index_id = false); - virtual ~Thread(); + ~Thread() override; lldb::ProcessSP GetProcess() const @@ -1150,20 +1149,20 @@ //------------------------------------------------------------------ // lldb::ExecutionContextScope pure virtual functions //------------------------------------------------------------------ - virtual lldb::TargetSP - CalculateTarget (); + lldb::TargetSP + CalculateTarget() override; - virtual lldb::ProcessSP - CalculateProcess (); + lldb::ProcessSP + CalculateProcess() override; - virtual lldb::ThreadSP - CalculateThread (); + lldb::ThreadSP + CalculateThread() override; - virtual lldb::StackFrameSP - CalculateStackFrame (); + lldb::StackFrameSP + CalculateStackFrame() override; - virtual void - CalculateExecutionContext (ExecutionContext &exe_ctx); + void + CalculateExecutionContext(ExecutionContext &exe_ctx) override; lldb::StackFrameSP GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr); @@ -1361,9 +1360,8 @@ //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN (Thread); - }; } // namespace lldb_private -#endif // liblldb_Thread_h_ +#endif // liblldb_Thread_h_ Index: include/lldb/Target/ThreadList.h =================================================================== --- include/lldb/Target/ThreadList.h +++ include/lldb/Target/ThreadList.h @@ -32,8 +32,7 @@ ThreadList (const ThreadList &rhs); - virtual - ~ThreadList (); + ~ThreadList() override; const ThreadList& operator = (const ThreadList& rhs); @@ -128,8 +127,8 @@ void SetStopID (uint32_t stop_id); - virtual Mutex & - GetMutex (); + Mutex & + GetMutex() override; void Update (ThreadList &rhs); @@ -150,9 +149,10 @@ lldb::tid_t m_selected_tid; ///< For targets that need the notion of a current thread. private: + ThreadList (); }; } // namespace lldb_private -#endif // liblldb_ThreadList_h_ +#endif // liblldb_ThreadList_h_ Index: include/lldb/Target/UnwindAssembly.h =================================================================== --- include/lldb/Target/UnwindAssembly.h +++ include/lldb/Target/UnwindAssembly.h @@ -24,8 +24,7 @@ static lldb::UnwindAssemblySP FindPlugin (const ArchSpec &arch); - virtual - ~UnwindAssembly(); + ~UnwindAssembly() override; virtual bool GetNonCallSiteUnwindPlanFromAssembly (AddressRange& func, @@ -59,6 +58,4 @@ } // namespace lldb_private -#endif //utility_UnwindAssembly_h_ - - +#endif // utility_UnwindAssembly_h_ Index: include/lldb/Utility/JSON.h =================================================================== --- include/lldb/Utility/JSON.h +++ include/lldb/Utility/JSON.h @@ -71,8 +71,8 @@ JSONString& operator = (const JSONString& s) = delete; - virtual void - Write (Stream& s); + void + Write(Stream& s) override; typedef std::shared_ptr SP; @@ -84,8 +84,7 @@ return V->GetKind() == JSONValue::Kind::String; } - virtual - ~JSONString () = default; + ~JSONString() override = default; private: @@ -106,8 +105,8 @@ JSONNumber& operator = (const JSONNumber& s) = delete; - virtual void - Write (Stream& s); + void + Write(Stream& s) override; typedef std::shared_ptr SP; @@ -128,8 +127,7 @@ return V->GetKind() == JSONValue::Kind::Number; } - virtual - ~JSONNumber () = default; + ~JSONNumber() override = default; private: bool m_is_integer; @@ -146,8 +144,8 @@ JSONTrue& operator = (const JSONTrue& s) = delete; - virtual void - Write (Stream& s); + void + Write(Stream& s) override; typedef std::shared_ptr SP; @@ -156,8 +154,7 @@ return V->GetKind() == JSONValue::Kind::True; } - virtual - ~JSONTrue () = default; + ~JSONTrue() override = default; }; class JSONFalse : public JSONValue @@ -169,8 +166,8 @@ JSONFalse& operator = (const JSONFalse& s) = delete; - virtual void - Write (Stream& s); + void + Write(Stream& s) override; typedef std::shared_ptr SP; @@ -179,8 +176,7 @@ return V->GetKind() == JSONValue::Kind::False; } - virtual - ~JSONFalse () = default; + ~JSONFalse() override = default; }; class JSONNull : public JSONValue @@ -192,8 +188,8 @@ JSONNull& operator = (const JSONNull& s) = delete; - virtual void - Write (Stream& s); + void + Write(Stream& s) override; typedef std::shared_ptr SP; @@ -202,8 +198,7 @@ return V->GetKind() == JSONValue::Kind::Null; } - virtual - ~JSONNull () = default; + ~JSONNull() override = default; }; class JSONObject : public JSONValue @@ -215,8 +210,8 @@ JSONObject& operator = (const JSONObject& s) = delete; - virtual void - Write (Stream& s); + void + Write(Stream& s) override; typedef std::shared_ptr SP; @@ -232,8 +227,7 @@ JSONValue::SP GetObject (const std::string& key); - virtual - ~JSONObject () = default; + ~JSONObject() override = default; private: typedef std::map Map; @@ -250,8 +244,8 @@ JSONArray& operator = (const JSONArray& s) = delete; - virtual void - Write (Stream& s); + void + Write(Stream& s) override; typedef std::shared_ptr SP; @@ -280,13 +274,11 @@ Size GetNumElements (); - virtual - ~JSONArray () = default; + ~JSONArray() override = default; Vector m_elements; }; - class JSONParser : public StringExtractor { public: @@ -327,6 +319,6 @@ JSONValue::SP ParseJSONArray (); }; -} +} // namespace lldb_private -#endif // utility_ProcessStructReader_h_ +#endif // utility_JSON_h_ Index: include/lldb/Utility/SharedCluster.h =================================================================== --- include/lldb/Utility/SharedCluster.h +++ include/lldb/Utility/SharedCluster.h @@ -27,14 +27,15 @@ shared_ptr_refcount() : shared_count (0) {} - virtual ~shared_ptr_refcount () + ~shared_ptr_refcount() override { } - virtual void on_zero_shared () + void on_zero_shared() override { manager->DecrementRefCount(); } + private: T *manager; }; @@ -100,4 +101,5 @@ }; } // namespace lldb_private + #endif // utility_SharedCluster_h_ Index: include/lldb/Utility/SharingPtr.h =================================================================== --- include/lldb/Utility/SharingPtr.h +++ include/lldb/Utility/SharingPtr.h @@ -67,7 +67,7 @@ : data_(p) {} private: - virtual void on_zero_shared(); + void on_zero_shared() override; // Outlaw copy constructor and assignment operator to keep effective C++ // warnings down to a minimum @@ -113,7 +113,8 @@ : data_(a0, a1, a2, a3, a4) {} private: - virtual void on_zero_shared(); + void on_zero_shared() override; + public: T* get() {return &data_;} }; @@ -638,13 +639,11 @@ { } - virtual - ~ReferenceCountedBaseVirtual () + ~ReferenceCountedBaseVirtual() override { } - virtual void on_zero_shared (); - + void on_zero_shared() override; }; template @@ -838,4 +837,4 @@ } // namespace lldb_private -#endif // utility_SharingPtr_h_ +#endif // utility_SharingPtr_h_