diff options
author | Eugene Zelenko <eugene.zelenko@gmail.com> | 2015-10-21 18:46:17 +0000 |
---|---|---|
committer | Eugene Zelenko <eugene.zelenko@gmail.com> | 2015-10-21 18:46:17 +0000 |
commit | ab7f6d04db50e948440e444f29366c4c570ff47c (patch) | |
tree | 4dcfa4226a396a54af1d59fb7a0880e72cb54ec2 /lldb/source/Plugins/Process/Utility | |
parent | fa0adfd3c6daca8414462085fd8bca3a7f92f82d (diff) | |
download | bcm5719-llvm-ab7f6d04db50e948440e444f29366c4c570ff47c.tar.gz bcm5719-llvm-ab7f6d04db50e948440e444f29366c4c570ff47c.zip |
Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins; other minor fixes.
Differential Revision: http://reviews.llvm.org/D13951
llvm-svn: 250925
Diffstat (limited to 'lldb/source/Plugins/Process/Utility')
5 files changed, 126 insertions, 134 deletions
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.h b/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.h index 161ef040e65..b4680de7951 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.h @@ -10,8 +10,12 @@ #ifndef lldb_RegisterContextThreadMemory_h_ #define lldb_RegisterContextThreadMemory_h_ +// C Includes +// C++ Includes #include <vector> +// Other libraries and framework includes +// Project includes #include "lldb/lldb-private.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Symbol/SymbolContext.h" @@ -24,30 +28,28 @@ public: RegisterContextThreadMemory (Thread &thread, lldb::addr_t register_data_addr); - virtual ~RegisterContextThreadMemory(); - //------------------------------------------------------------------ - // Subclasses must override these functions - //------------------------------------------------------------------ - virtual void - InvalidateAllRegisters (); + ~RegisterContextThreadMemory() override; + + void + InvalidateAllRegisters() override; - virtual size_t - GetRegisterCount (); + size_t + GetRegisterCount() override; - virtual const RegisterInfo * - GetRegisterInfoAtIndex (size_t reg); + const RegisterInfo * + GetRegisterInfoAtIndex(size_t reg) override; - virtual size_t - GetRegisterSetCount (); + size_t + GetRegisterSetCount() override; - virtual const RegisterSet * - GetRegisterSet (size_t reg_set); + const RegisterSet * + GetRegisterSet(size_t reg_set) override; - virtual bool - ReadRegister (const RegisterInfo *reg_info, RegisterValue ®_value); + bool + ReadRegister(const RegisterInfo *reg_info, RegisterValue ®_value) override; - virtual bool - WriteRegister (const RegisterInfo *reg_info, const RegisterValue ®_value); + bool + WriteRegister(const RegisterInfo *reg_info, const RegisterValue ®_value) override; // These two functions are used to implement "push" and "pop" of register states. They are used primarily // for expression evaluation, where we need to push a new state (storing the old one in data_sp) and then @@ -56,48 +58,50 @@ public: // may mean e.g. interrupting a thread that is sitting in a kernel trap. That is a somewhat disruptive operation, // so these API's should only be used when this behavior is needed. - virtual bool - ReadAllRegisterValues (lldb::DataBufferSP &data_sp); + bool + ReadAllRegisterValues(lldb::DataBufferSP &data_sp) override; - virtual bool - WriteAllRegisterValues (const lldb::DataBufferSP &data_sp); + bool + WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override; bool CopyFromRegisterContext (lldb::RegisterContextSP context); - virtual uint32_t - ConvertRegisterKindToRegisterNumber (lldb::RegisterKind kind, uint32_t num); - - //------------------------------------------------------------------ - // Subclasses can override these functions if desired - //------------------------------------------------------------------ - virtual uint32_t - NumSupportedHardwareBreakpoints (); - - virtual uint32_t - SetHardwareBreakpoint (lldb::addr_t addr, size_t size); + uint32_t + ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override; - virtual bool - ClearHardwareBreakpoint (uint32_t hw_idx); + uint32_t + NumSupportedHardwareBreakpoints() override; - virtual uint32_t - NumSupportedHardwareWatchpoints (); + uint32_t + SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override; - virtual uint32_t - SetHardwareWatchpoint (lldb::addr_t addr, size_t size, bool read, bool write); - - virtual bool - ClearHardwareWatchpoint (uint32_t hw_index); + bool + ClearHardwareBreakpoint(uint32_t hw_idx) override; - virtual bool - HardwareSingleStep (bool enable); + uint32_t + NumSupportedHardwareWatchpoints() override; - virtual Error - ReadRegisterValueFromMemory (const lldb_private::RegisterInfo *reg_info, lldb::addr_t src_addr, uint32_t src_len, RegisterValue ®_value); + uint32_t + SetHardwareWatchpoint(lldb::addr_t addr, size_t size, bool read, bool write) override; - virtual Error - WriteRegisterValueToMemory (const lldb_private::RegisterInfo *reg_info, lldb::addr_t dst_addr, uint32_t dst_len, const RegisterValue ®_value); + bool + ClearHardwareWatchpoint(uint32_t hw_index) override; + bool + HardwareSingleStep(bool enable) override; + + Error + ReadRegisterValueFromMemory(const lldb_private::RegisterInfo *reg_info, + lldb::addr_t src_addr, + uint32_t src_len, + RegisterValue ®_value) override; + + Error + WriteRegisterValueToMemory(const lldb_private::RegisterInfo *reg_info, + lldb::addr_t dst_addr, uint32_t dst_len, + const RegisterValue ®_value) override; + protected: void UpdateRegisterContext (); @@ -106,9 +110,11 @@ protected: lldb::RegisterContextSP m_reg_ctx_sp; lldb::addr_t m_register_data_addr; uint32_t m_stop_id; + private: DISALLOW_COPY_AND_ASSIGN (RegisterContextThreadMemory); }; + } // namespace lldb_private -#endif // lldb_RegisterContextThreadMemory_h_ +#endif // lldb_RegisterContextThreadMemory_h_ diff --git a/lldb/source/Plugins/Process/Utility/StopInfoMachException.h b/lldb/source/Plugins/Process/Utility/StopInfoMachException.h index 130ee0b709b..25e05ecc1ec 100644 --- a/lldb/source/Plugins/Process/Utility/StopInfoMachException.h +++ b/lldb/source/Plugins/Process/Utility/StopInfoMachException.h @@ -38,19 +38,16 @@ public: { } - virtual ~StopInfoMachException() - { - } + ~StopInfoMachException() override = default; - - virtual lldb::StopReason - GetStopReason () const + lldb::StopReason + GetStopReason() const override { return lldb::eStopReasonException; } - virtual const char * - GetDescription (); + const char * + GetDescription() override; // Since some mach exceptions will be reported as breakpoints, signals, // or trace, we use this static accessor which will translate the mach @@ -71,7 +68,6 @@ protected: uint64_t m_exc_subcode; }; - } // namespace lldb_private -#endif // liblldb_StopInfoMachException_h_ +#endif // liblldb_StopInfoMachException_h_ diff --git a/lldb/source/Plugins/Process/Utility/ThreadMemory.h b/lldb/source/Plugins/Process/Utility/ThreadMemory.h index 07eb45dcb43..15057b6c0fc 100644 --- a/lldb/source/Plugins/Process/Utility/ThreadMemory.h +++ b/lldb/source/Plugins/Process/Utility/ThreadMemory.h @@ -1,4 +1,4 @@ -//===-- ThreadMemory.h -----------------------------------------*- C++ -*-===// +//===-- ThreadMemory.h ------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -10,13 +10,16 @@ #ifndef liblldb_ThreadMemory_h_ #define liblldb_ThreadMemory_h_ +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes #include "lldb/Target/Thread.h" class ThreadMemory : public lldb_private::Thread { public: - ThreadMemory (lldb_private::Process &process, lldb::tid_t tid, const lldb::ValueObjectSP &thread_info_valobj_sp); @@ -27,31 +30,27 @@ public: const char *queue, lldb::addr_t register_data_addr); - virtual - ~ThreadMemory(); + ~ThreadMemory() override; - //------------------------------------------------------------------ - // lldb_private::Thread methods - //------------------------------------------------------------------ - virtual lldb::RegisterContextSP - GetRegisterContext (); + lldb::RegisterContextSP + GetRegisterContext() override; - virtual lldb::RegisterContextSP - CreateRegisterContextForFrame (lldb_private::StackFrame *frame); + lldb::RegisterContextSP + CreateRegisterContextForFrame(lldb_private::StackFrame *frame) override; - virtual bool - CalculateStopInfo (); + bool + CalculateStopInfo() override; - virtual const char * - GetInfo () + const char * + GetInfo() override { if (m_backing_thread_sp) m_backing_thread_sp->GetInfo(); return NULL; } - virtual const char * - GetName () + const char * + GetName() override { if (!m_name.empty()) return m_name.c_str(); @@ -60,8 +59,8 @@ public: return NULL; } - virtual const char * - GetQueueName () + const char * + GetQueueName() override { if (!m_queue.empty()) return m_queue.c_str(); @@ -70,26 +69,26 @@ public: return NULL; } - virtual void - WillResume (lldb::StateType resume_state); + void + WillResume(lldb::StateType resume_state) override; - virtual void - DidResume () + void + DidResume() override { if (m_backing_thread_sp) m_backing_thread_sp->DidResume(); } - virtual lldb::user_id_t - GetProtocolID () const + lldb::user_id_t + GetProtocolID() const override { if (m_backing_thread_sp) return m_backing_thread_sp->GetProtocolID(); return Thread::GetProtocolID(); } - virtual void - RefreshStateAfterStop(); + void + RefreshStateAfterStop() override; lldb::ValueObjectSP & GetValueObject () @@ -97,41 +96,36 @@ public: return m_thread_info_valobj_sp; } - virtual void - ClearStackFrames (); + void + ClearStackFrames() override; - virtual void - ClearBackingThread () + void + ClearBackingThread() override { m_backing_thread_sp.reset(); } - virtual bool - SetBackingThread (const lldb::ThreadSP &thread_sp) + bool + SetBackingThread(const lldb::ThreadSP &thread_sp) override { //printf ("Thread 0x%llx is being backed by thread 0x%llx\n", GetID(), thread_sp->GetID()); m_backing_thread_sp = thread_sp; return (bool)thread_sp; } - virtual lldb::ThreadSP - GetBackingThread () const + lldb::ThreadSP + GetBackingThread() const override { return m_backing_thread_sp; } protected: - - virtual bool - IsOperatingSystemPluginThread () const + bool + IsOperatingSystemPluginThread() const override { return true; } - - //------------------------------------------------------------------ - // For ThreadMemory and subclasses - //------------------------------------------------------------------ // If this memory thread is actually represented by a thread from the // lldb_private::Process subclass, then fill in the thread here and // all APIs will be routed through this thread object. If m_backing_thread_sp @@ -142,11 +136,9 @@ protected: std::string m_name; std::string m_queue; lldb::addr_t m_register_data_addr; + private: - //------------------------------------------------------------------ - // For ThreadMemory only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN (ThreadMemory); }; -#endif // liblldb_ThreadMemory_h_ +#endif // liblldb_ThreadMemory_h_ diff --git a/lldb/source/Plugins/Process/Utility/UnwindLLDB.h b/lldb/source/Plugins/Process/Utility/UnwindLLDB.h index ce897cd8242..4ad9c60b8a7 100644 --- a/lldb/source/Plugins/Process/Utility/UnwindLLDB.h +++ b/lldb/source/Plugins/Process/Utility/UnwindLLDB.h @@ -10,8 +10,12 @@ #ifndef lldb_UnwindLLDB_h_ #define lldb_UnwindLLDB_h_ +// C Includes +// C++ Includes #include <vector> +// Other libraries and framework includes +// Project includes #include "lldb/lldb-public.h" #include "lldb/Core/ConstString.h" #include "lldb/Symbol/FuncUnwinders.h" @@ -27,9 +31,8 @@ class UnwindLLDB : public lldb_private::Unwind { public: UnwindLLDB (lldb_private::Thread &thread); - - virtual - ~UnwindLLDB() { } + + ~UnwindLLDB() override = default; enum RegisterSearchResult { @@ -62,23 +65,23 @@ protected: }; void - DoClear() + DoClear() override { m_frames.clear(); m_candidate_frame.reset(); m_unwind_complete = false; } - virtual uint32_t - DoGetFrameCount(); + uint32_t + DoGetFrameCount() override; bool - DoGetFrameInfoAtIndex (uint32_t frame_idx, - lldb::addr_t& cfa, - lldb::addr_t& start_pc); + DoGetFrameInfoAtIndex(uint32_t frame_idx, + lldb::addr_t& cfa, + lldb::addr_t& start_pc) override; lldb::RegisterContextSP - DoCreateRegisterContextForFrame (lldb_private::StackFrame *frame); + DoCreateRegisterContextForFrame(lldb_private::StackFrame *frame) override; typedef std::shared_ptr<RegisterContextLLDB> RegisterContextLLDBSP; @@ -112,7 +115,6 @@ protected: } private: - struct Cursor { lldb::addr_t start_pc; // The start address of the function/symbol for this frame - current pc if unknown @@ -149,6 +151,6 @@ private: DISALLOW_COPY_AND_ASSIGN (UnwindLLDB); }; -} // namespace lldb_private +} // namespace lldb_private -#endif // lldb_UnwindLLDB_h_ +#endif // lldb_UnwindLLDB_h_ diff --git a/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h b/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h index 2695376fd6e..f195514ed1b 100644 --- a/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h +++ b/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h @@ -15,7 +15,6 @@ #include <vector> // Other libraries and framework includes - // Project includes #include "lldb/lldb-private.h" #include "lldb/Target/Unwind.h" @@ -24,29 +23,26 @@ class UnwindMacOSXFrameBackchain : public lldb_private::Unwind { public: UnwindMacOSXFrameBackchain (lldb_private::Thread &thread); - - virtual - ~UnwindMacOSXFrameBackchain() - { - } - + + ~UnwindMacOSXFrameBackchain() override = default; + protected: - virtual void - DoClear() + void + DoClear() override { m_cursors.clear(); } - virtual uint32_t - DoGetFrameCount(); + uint32_t + DoGetFrameCount() override; bool - DoGetFrameInfoAtIndex (uint32_t frame_idx, - lldb::addr_t& cfa, - lldb::addr_t& pc); + DoGetFrameInfoAtIndex(uint32_t frame_idx, + lldb::addr_t& cfa, + lldb::addr_t& pc) override; lldb::RegisterContextSP - DoCreateRegisterContextForFrame (lldb_private::StackFrame *frame); + DoCreateRegisterContextForFrame(lldb_private::StackFrame *frame) override; friend class RegisterContextMacOSXFrameBackchain; @@ -71,4 +67,4 @@ private: DISALLOW_COPY_AND_ASSIGN (UnwindMacOSXFrameBackchain); }; -#endif // lldb_UnwindMacOSXFrameBackchain_h_ +#endif // lldb_UnwindMacOSXFrameBackchain_h_ |