Index: source/Plugins/JITLoader/GDB/JITLoaderGDB.h =================================================================== --- source/Plugins/JITLoader/GDB/JITLoaderGDB.h +++ source/Plugins/JITLoader/GDB/JITLoaderGDB.h @@ -13,15 +13,19 @@ // C Includes // C++ Includes #include -#include -#include +// Other libraries and framework includes +// Project includes #include "lldb/Target/JITLoader.h" #include "lldb/Target/Process.h" class JITLoaderGDB : public lldb_private::JITLoader { public: + JITLoaderGDB(lldb_private::Process *process); + + ~JITLoaderGDB() override; + //------------------------------------------------------------------ // Static Functions //------------------------------------------------------------------ @@ -40,34 +44,29 @@ static lldb::JITLoaderSP CreateInstance (lldb_private::Process *process, bool force); - JITLoaderGDB (lldb_private::Process *process); - static void DebuggerInitialize(lldb_private::Debugger &debugger); - virtual - ~JITLoaderGDB (); - //------------------------------------------------------------------ // PluginInterface protocol //------------------------------------------------------------------ - virtual lldb_private::ConstString - GetPluginName(); + lldb_private::ConstString + GetPluginName() override; - virtual uint32_t - GetPluginVersion(); + uint32_t + GetPluginVersion() override; //------------------------------------------------------------------ // JITLoader interface //------------------------------------------------------------------ - virtual void - DidAttach (); + void + DidAttach() override; - virtual void - DidLaunch (); + void + DidLaunch() override; - virtual void - ModulesDidLoad (lldb_private::ModuleList &module_list); + void + ModulesDidLoad(lldb_private::ModuleList &module_list) override; private: lldb::addr_t @@ -108,4 +107,4 @@ }; -#endif +#endif // liblldb_JITLoaderGDB_h_ Index: source/Plugins/OperatingSystem/Go/OperatingSystemGo.h =================================================================== --- source/Plugins/OperatingSystem/Go/OperatingSystemGo.h +++ source/Plugins/OperatingSystem/Go/OperatingSystemGo.h @@ -1,24 +1,30 @@ -//===-- OperatingSystemGo.h ----------------------------------*- C++ -*-===// +//===-- OperatingSystemGo.h -------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #ifndef _liblldb_OperatingSystemGo_h_ #define _liblldb_OperatingSystemGo_h_ -#include - +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes #include "lldb/Target/OperatingSystem.h" class DynamicRegisterInfo; class OperatingSystemGo : public lldb_private::OperatingSystem { - public: +public: + OperatingSystemGo(lldb_private::Process *process); + + ~OperatingSystemGo() override = default; + //------------------------------------------------------------------ // Static Functions //------------------------------------------------------------------ @@ -35,38 +41,32 @@ static const char *GetPluginDescriptionStatic(); //------------------------------------------------------------------ - // Class Methods - //------------------------------------------------------------------ - OperatingSystemGo(lldb_private::Process *process); - - virtual ~OperatingSystemGo(); - - //------------------------------------------------------------------ // lldb_private::PluginInterface Methods //------------------------------------------------------------------ - virtual lldb_private::ConstString GetPluginName(); + lldb_private::ConstString GetPluginName() override; - virtual uint32_t GetPluginVersion(); + uint32_t GetPluginVersion() override; //------------------------------------------------------------------ // lldb_private::OperatingSystem Methods //------------------------------------------------------------------ - virtual bool UpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &real_thread_list, - lldb_private::ThreadList &new_thread_list); + bool UpdateThreadList(lldb_private::ThreadList &old_thread_list, + lldb_private::ThreadList &real_thread_list, + lldb_private::ThreadList &new_thread_list) override; - virtual void ThreadWasSelected(lldb_private::Thread *thread); + void ThreadWasSelected(lldb_private::Thread *thread) override; - virtual lldb::RegisterContextSP CreateRegisterContextForThread(lldb_private::Thread *thread, - lldb::addr_t reg_data_addr); + lldb::RegisterContextSP CreateRegisterContextForThread(lldb_private::Thread *thread, + lldb::addr_t reg_data_addr) override; - virtual lldb::StopInfoSP CreateThreadStopReason(lldb_private::Thread *thread); + lldb::StopInfoSP CreateThreadStopReason(lldb_private::Thread *thread) override; //------------------------------------------------------------------ // Method for lazy creation of threads on demand //------------------------------------------------------------------ - virtual lldb::ThreadSP CreateThread(lldb::tid_t tid, lldb::addr_t context); + lldb::ThreadSP CreateThread(lldb::tid_t tid, lldb::addr_t context) override; - private: +private: struct Goroutine; static lldb::ValueObjectSP FindGlobal(lldb::TargetSP target, const char *name); @@ -82,4 +82,4 @@ lldb::ValueObjectSP m_allglen_sp; }; -#endif // #ifndef liblldb_OperatingSystemGo_h_ +#endif // liblldb_OperatingSystemGo_h_ Index: source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp =================================================================== --- source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp +++ source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp @@ -1,4 +1,4 @@ -//===-- OperatingSystemGo.cpp --------------------------------*- C++ -*-===// +//===-- OperatingSystemGo.cpp -----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -6,13 +6,15 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -#include "OperatingSystemGo.h" // C Includes // C++ Includes #include // Other libraries and framework includes +// Project includes +#include "OperatingSystemGo.h" + #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/Module.h" @@ -56,13 +58,7 @@ class PluginProperties : public Properties { - public: - static ConstString - GetSettingName() - { - return OperatingSystemGo::GetPluginNameStatic(); - } - +public: PluginProperties() : Properties() { @@ -70,8 +66,14 @@ m_collection_sp->Initialize(g_properties); } - virtual ~PluginProperties() {} + ~PluginProperties() override = default; + static ConstString + GetSettingName() + { + return OperatingSystemGo::GetPluginNameStatic(); + } + bool GetEnableGoroutines() { @@ -100,10 +102,7 @@ class RegisterContextGo : public RegisterContextMemory { - public: - //------------------------------------------------------------------ - // Constructors and Destructors - //------------------------------------------------------------------ +public: RegisterContextGo(lldb_private::Thread &thread, uint32_t concrete_frame_idx, DynamicRegisterInfo ®_info, lldb::addr_t reg_data_addr) : RegisterContextMemory(thread, concrete_frame_idx, reg_info, reg_data_addr) @@ -118,10 +117,11 @@ m_reg_data.SetData(reg_data_sp); } - virtual ~RegisterContextGo() {} + ~RegisterContextGo() override = default; - virtual bool - ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue ®_value) + bool + ReadRegister(const lldb_private::RegisterInfo *reg_info, + lldb_private::RegisterValue ®_value) override { switch (reg_info->kinds[eRegisterKindGeneric]) { @@ -134,8 +134,9 @@ } } - virtual bool - WriteRegister(const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue ®_value) + bool + WriteRegister(const lldb_private::RegisterInfo *reg_info, + const lldb_private::RegisterValue ®_value) override { switch (reg_info->kinds[eRegisterKindGeneric]) { @@ -147,11 +148,11 @@ } } - private: +private: DISALLOW_COPY_AND_ASSIGN(RegisterContextGo); }; -} // namespace +} // anonymous namespace struct OperatingSystemGo::Goroutine { @@ -219,6 +220,12 @@ return new OperatingSystemGo(process); } +OperatingSystemGo::OperatingSystemGo(lldb_private::Process *process) + : OperatingSystem(process) + , m_reginfo(new DynamicRegisterInfo) +{ +} + ConstString OperatingSystemGo::GetPluginNameStatic() { @@ -232,16 +239,6 @@ return "Operating system plug-in that reads runtime data-structures for goroutines."; } -OperatingSystemGo::OperatingSystemGo(lldb_private::Process *process) - : OperatingSystem(process) - , m_reginfo(new DynamicRegisterInfo) -{ -} - -OperatingSystemGo::~OperatingSystemGo() -{ -} - bool OperatingSystemGo::Init(ThreadList &threads) { Index: source/Plugins/OperatingSystem/Python/OperatingSystemPython.h =================================================================== --- source/Plugins/OperatingSystem/Python/OperatingSystemPython.h +++ source/Plugins/OperatingSystem/Python/OperatingSystemPython.h @@ -1,4 +1,4 @@ -//===-- OperatingSystemPython.h ---------------------------*- C++ -*-===// +//===-- OperatingSystemPython.h ---------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -6,14 +6,16 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -#ifndef LLDB_DISABLE_PYTHON #ifndef liblldb_OperatingSystemPython_h_ #define liblldb_OperatingSystemPython_h_ +#ifndef LLDB_DISABLE_PYTHON + // C Includes // C++ Includes // Other libraries and framework includes +// Project includes #include "lldb/Core/StructuredData.h" #include "lldb/Target/OperatingSystem.h" @@ -27,6 +29,11 @@ class OperatingSystemPython : public lldb_private::OperatingSystem { public: + OperatingSystemPython(lldb_private::Process *process, + const lldb_private::FileSpec &python_module_path); + + ~OperatingSystemPython() override; + //------------------------------------------------------------------ // Static Functions //------------------------------------------------------------------ @@ -46,49 +53,39 @@ GetPluginDescriptionStatic(); //------------------------------------------------------------------ - // Class Methods - //------------------------------------------------------------------ - OperatingSystemPython (lldb_private::Process *process, - const lldb_private::FileSpec &python_module_path); - - virtual - ~OperatingSystemPython (); - - //------------------------------------------------------------------ // lldb_private::PluginInterface Methods //------------------------------------------------------------------ - virtual lldb_private::ConstString - GetPluginName(); + lldb_private::ConstString + GetPluginName() override; - virtual uint32_t - GetPluginVersion(); + uint32_t + GetPluginVersion() override; //------------------------------------------------------------------ // lldb_private::OperatingSystem Methods //------------------------------------------------------------------ - virtual bool - UpdateThreadList (lldb_private::ThreadList &old_thread_list, - lldb_private::ThreadList &real_thread_list, - lldb_private::ThreadList &new_thread_list); + bool + UpdateThreadList(lldb_private::ThreadList &old_thread_list, + lldb_private::ThreadList &real_thread_list, + lldb_private::ThreadList &new_thread_list) override; - virtual void - ThreadWasSelected (lldb_private::Thread *thread); + void + ThreadWasSelected(lldb_private::Thread *thread) override; - virtual lldb::RegisterContextSP - CreateRegisterContextForThread (lldb_private::Thread *thread, - lldb::addr_t reg_data_addr); + lldb::RegisterContextSP + CreateRegisterContextForThread(lldb_private::Thread *thread, + lldb::addr_t reg_data_addr) override; - virtual lldb::StopInfoSP - CreateThreadStopReason (lldb_private::Thread *thread); + lldb::StopInfoSP + CreateThreadStopReason(lldb_private::Thread *thread) override; //------------------------------------------------------------------ // Method for lazy creation of threads on demand //------------------------------------------------------------------ - virtual lldb::ThreadSP - CreateThread (lldb::tid_t tid, lldb::addr_t context); + lldb::ThreadSP + CreateThread(lldb::tid_t tid, lldb::addr_t context) override; protected: - bool IsValid() const { return m_python_object_sp && m_python_object_sp->IsValid(); @@ -107,5 +104,6 @@ lldb_private::StructuredData::ObjectSP m_python_object_sp; }; -#endif // #ifndef liblldb_OperatingSystemPython_h_ -#endif // #ifndef LLDB_DISABLE_PYTHON +#endif // LLDB_DISABLE_PYTHON + +#endif // liblldb_OperatingSystemPython_h_ Index: source/Plugins/Process/Utility/RegisterContextThreadMemory.h =================================================================== --- source/Plugins/Process/Utility/RegisterContextThreadMemory.h +++ source/Plugins/Process/Utility/RegisterContextThreadMemory.h @@ -10,8 +10,12 @@ #ifndef lldb_RegisterContextThreadMemory_h_ #define lldb_RegisterContextThreadMemory_h_ +// C Includes +// C++ Includes #include +// 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 @@ 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 @@ // 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); + uint32_t + ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override; - //------------------------------------------------------------------ - // Subclasses can override these functions if desired - //------------------------------------------------------------------ - virtual uint32_t - NumSupportedHardwareBreakpoints (); + uint32_t + NumSupportedHardwareBreakpoints() override; - virtual uint32_t - SetHardwareBreakpoint (lldb::addr_t addr, size_t size); + uint32_t + SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override; - virtual bool - ClearHardwareBreakpoint (uint32_t hw_idx); + bool + ClearHardwareBreakpoint(uint32_t hw_idx) override; - virtual uint32_t - NumSupportedHardwareWatchpoints (); + uint32_t + NumSupportedHardwareWatchpoints() override; - virtual uint32_t - SetHardwareWatchpoint (lldb::addr_t addr, size_t size, bool read, bool write); + uint32_t + SetHardwareWatchpoint(lldb::addr_t addr, size_t size, bool read, bool write) override; - virtual bool - ClearHardwareWatchpoint (uint32_t hw_index); + bool + ClearHardwareWatchpoint(uint32_t hw_index) override; - virtual bool - HardwareSingleStep (bool enable); + bool + HardwareSingleStep(bool enable) override; - virtual Error - ReadRegisterValueFromMemory (const lldb_private::RegisterInfo *reg_info, lldb::addr_t src_addr, uint32_t src_len, RegisterValue ®_value); + Error + ReadRegisterValueFromMemory(const lldb_private::RegisterInfo *reg_info, + lldb::addr_t src_addr, + uint32_t src_len, + RegisterValue ®_value) override; - virtual Error - WriteRegisterValueToMemory (const lldb_private::RegisterInfo *reg_info, lldb::addr_t dst_addr, uint32_t dst_len, const RegisterValue ®_value); - + 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 @@ 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_ Index: source/Plugins/Process/Utility/StopInfoMachException.h =================================================================== --- source/Plugins/Process/Utility/StopInfoMachException.h +++ source/Plugins/Process/Utility/StopInfoMachException.h @@ -38,19 +38,16 @@ { } - 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 @@ uint64_t m_exc_subcode; }; - } // namespace lldb_private -#endif // liblldb_StopInfoMachException_h_ +#endif // liblldb_StopInfoMachException_h_ Index: source/Plugins/Process/Utility/ThreadMemory.h =================================================================== --- source/Plugins/Process/Utility/ThreadMemory.h +++ 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 @@ 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 @@ return NULL; } - virtual const char * - GetQueueName () + const char * + GetQueueName() override { if (!m_queue.empty()) return m_queue.c_str(); @@ -70,26 +69,26 @@ 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 @@ 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 @@ 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_ Index: source/Plugins/Process/Utility/UnwindLLDB.h =================================================================== --- source/Plugins/Process/Utility/UnwindLLDB.h +++ source/Plugins/Process/Utility/UnwindLLDB.h @@ -10,8 +10,12 @@ #ifndef lldb_UnwindLLDB_h_ #define lldb_UnwindLLDB_h_ +// C Includes +// C++ Includes #include +// Other libraries and framework includes +// Project includes #include "lldb/lldb-public.h" #include "lldb/Core/ConstString.h" #include "lldb/Symbol/FuncUnwinders.h" @@ -27,10 +31,9 @@ { public: UnwindLLDB (lldb_private::Thread &thread); - - virtual - ~UnwindLLDB() { } + ~UnwindLLDB() override = default; + enum RegisterSearchResult { eRegisterFound = 0, @@ -62,23 +65,23 @@ }; 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 RegisterContextLLDBSP; @@ -112,7 +115,6 @@ } 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 @@ DISALLOW_COPY_AND_ASSIGN (UnwindLLDB); }; -} // namespace lldb_private +} // namespace lldb_private -#endif // lldb_UnwindLLDB_h_ +#endif // lldb_UnwindLLDB_h_ Index: source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h =================================================================== --- source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h +++ source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h @@ -15,7 +15,6 @@ #include // Other libraries and framework includes - // Project includes #include "lldb/lldb-private.h" #include "lldb/Target/Unwind.h" @@ -24,29 +23,26 @@ { 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 @@ DISALLOW_COPY_AND_ASSIGN (UnwindMacOSXFrameBackchain); }; -#endif // lldb_UnwindMacOSXFrameBackchain_h_ +#endif // lldb_UnwindMacOSXFrameBackchain_h_ Index: source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h =================================================================== --- source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h +++ source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h @@ -12,12 +12,11 @@ // C Includes // C++ Includes -#include #include #include -// Other libraries and framework includes - +// Other libraries and framework include +// Project includes #include "lldb/Target/SystemRuntime.h" #include "lldb/Core/ConstString.h" #include "lldb/Core/ModuleList.h" @@ -36,6 +35,10 @@ class SystemRuntimeMacOSX : public lldb_private::SystemRuntime { public: + SystemRuntimeMacOSX(lldb_private::Process *process); + + ~SystemRuntimeMacOSX() override; + //------------------------------------------------------------------ // Static Functions //------------------------------------------------------------------ @@ -54,36 +57,31 @@ static lldb_private::SystemRuntime * CreateInstance (lldb_private::Process *process); - //------------------------------------------------------------------ // instance methods //------------------------------------------------------------------ - SystemRuntimeMacOSX (lldb_private::Process *process); - - virtual - ~SystemRuntimeMacOSX (); - void - Clear (bool clear_process); + Clear(bool clear_process); void - Detach (); + Detach() override; const std::vector & - GetExtendedBacktraceTypes (); + GetExtendedBacktraceTypes() override; lldb::ThreadSP - GetExtendedBacktraceThread (lldb::ThreadSP thread, lldb_private::ConstString type); + GetExtendedBacktraceThread(lldb::ThreadSP thread, lldb_private::ConstString type) override; lldb::ThreadSP - GetExtendedBacktraceForQueueItem (lldb::QueueItemSP queue_item_sp, lldb_private::ConstString type); + GetExtendedBacktraceForQueueItem(lldb::QueueItemSP queue_item_sp, + lldb_private::ConstString type) override; lldb::ThreadSP GetExtendedBacktraceFromItemRef (lldb::addr_t item_ref); void - PopulateQueueList (lldb_private::QueueList &queue_list); + PopulateQueueList(lldb_private::QueueList &queue_list) override; void PopulateQueuesUsingLibBTR (lldb::addr_t queues_buffer, uint64_t queues_buffer_size, uint64_t count, lldb_private::QueueList &queue_list); @@ -92,45 +90,43 @@ PopulatePendingQueuesUsingLibBTR (lldb::addr_t items_buffer, uint64_t items_buffer_size, uint64_t count, lldb_private::Queue *queue); std::string - GetQueueNameFromThreadQAddress (lldb::addr_t dispatch_qaddr); + GetQueueNameFromThreadQAddress(lldb::addr_t dispatch_qaddr) override; lldb::queue_id_t - GetQueueIDFromThreadQAddress (lldb::addr_t dispatch_qaddr); + GetQueueIDFromThreadQAddress(lldb::addr_t dispatch_qaddr) override; lldb::addr_t - GetLibdispatchQueueAddressFromThreadQAddress (lldb::addr_t dispatch_qaddr); + GetLibdispatchQueueAddressFromThreadQAddress(lldb::addr_t dispatch_qaddr) override; void - PopulatePendingItemsForQueue (lldb_private::Queue *queue); + PopulatePendingItemsForQueue(lldb_private::Queue *queue) override; void - CompleteQueueItem (lldb_private::QueueItem *queue_item, lldb::addr_t item_ref); + CompleteQueueItem(lldb_private::QueueItem *queue_item, lldb::addr_t item_ref) override; virtual lldb::QueueKind GetQueueKind (lldb::addr_t dispatch_queue_addr); - virtual void - AddThreadExtendedInfoPacketHints (lldb_private::StructuredData::ObjectSP dict); + void + AddThreadExtendedInfoPacketHints(lldb_private::StructuredData::ObjectSP dict) override; - virtual bool - SafeToCallFunctionsOnThisThread (lldb::ThreadSP thread_sp); + bool + SafeToCallFunctionsOnThisThread(lldb::ThreadSP thread_sp) override; //------------------------------------------------------------------ // PluginInterface protocol //------------------------------------------------------------------ - virtual lldb_private::ConstString - GetPluginName(); + lldb_private::ConstString + GetPluginName() override; - virtual uint32_t - GetPluginVersion(); + uint32_t + GetPluginVersion() override; - protected: lldb::user_id_t m_break_id; mutable lldb_private::Mutex m_mutex; private: - struct libBacktraceRecording_info { uint16_t queue_info_version; uint16_t queue_info_data_offset; @@ -144,7 +140,6 @@ item_info_data_offset(0) {} }; - // A structure which reflects the data recorded in the // libBacktraceRecording introspection_dispatch_item_info_s. struct ItemInfo { @@ -338,4 +333,4 @@ DISALLOW_COPY_AND_ASSIGN (SystemRuntimeMacOSX); }; -#endif // liblldb_SystemRuntimeMacOSX_h_ +#endif // liblldb_SystemRuntimeMacOSX_h_ Index: source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h =================================================================== --- source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h +++ source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h @@ -1,4 +1,4 @@ -//===-- UnwindAssemblyInstEmulation.h ----------------------------*- C++ -*-===// +//===-- UnwindAssemblyInstEmulation.h ---------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -10,6 +10,10 @@ #ifndef liblldb_UnwindAssemblyInstEmulation_h_ #define liblldb_UnwindAssemblyInstEmulation_h_ +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes #include "lldb/lldb-private.h" #include "lldb/Core/EmulateInstruction.h" #include "lldb/Core/RegisterValue.h" @@ -19,32 +23,28 @@ class UnwindAssemblyInstEmulation : public lldb_private::UnwindAssembly { public: + ~UnwindAssemblyInstEmulation() override = default; - virtual - ~UnwindAssemblyInstEmulation () - { - } + bool + GetNonCallSiteUnwindPlanFromAssembly(lldb_private::AddressRange& func, + lldb_private::Thread& thread, + lldb_private::UnwindPlan& unwind_plan) override; - virtual bool - GetNonCallSiteUnwindPlanFromAssembly (lldb_private::AddressRange& func, - lldb_private::Thread& thread, - lldb_private::UnwindPlan& unwind_plan); + bool + AugmentUnwindPlanFromCallSite(lldb_private::AddressRange& func, + lldb_private::Thread& thread, + lldb_private::UnwindPlan& unwind_plan) override; - virtual bool - AugmentUnwindPlanFromCallSite (lldb_private::AddressRange& func, - lldb_private::Thread& thread, - lldb_private::UnwindPlan& unwind_plan); + bool + GetFastUnwindPlan(lldb_private::AddressRange& func, + lldb_private::Thread& thread, + lldb_private::UnwindPlan &unwind_plan) override; - virtual bool - GetFastUnwindPlan (lldb_private::AddressRange& func, - lldb_private::Thread& thread, - lldb_private::UnwindPlan &unwind_plan); - // thread may be NULL in which case we only use the Target (e.g. if this is called pre-process-launch). - virtual bool - FirstNonPrologueInsn (lldb_private::AddressRange& func, - const lldb_private::ExecutionContext &exe_ctx, - lldb_private::Address& first_non_prologue_insn); + bool + FirstNonPrologueInsn(lldb_private::AddressRange& func, + const lldb_private::ExecutionContext &exe_ctx, + lldb_private::Address& first_non_prologue_insn) override; static lldb_private::UnwindAssembly * CreateInstance (const lldb_private::ArchSpec &arch); @@ -64,14 +64,36 @@ static const char * GetPluginDescriptionStatic(); - virtual lldb_private::ConstString - GetPluginName(); + lldb_private::ConstString + GetPluginName() override; - virtual uint32_t - GetPluginVersion(); + uint32_t + GetPluginVersion() override; private: - + // Call CreateInstance to get an instance of this class + UnwindAssemblyInstEmulation(const lldb_private::ArchSpec &arch, + lldb_private::EmulateInstruction *inst_emulator) : + UnwindAssembly (arch), + m_inst_emulator_ap (inst_emulator), + m_range_ptr (NULL), + m_thread_ptr (NULL), + m_unwind_plan_ptr (NULL), + m_curr_row (), + m_cfa_reg_info (), + m_fp_is_cfa (false), + m_register_values (), + m_pushed_regs(), + m_curr_row_modified (false), + m_forward_branch_offset (0) + { + if (m_inst_emulator_ap.get()) + { + m_inst_emulator_ap->SetBaton (this); + m_inst_emulator_ap->SetCallbacks (ReadMemory, WriteMemory, ReadRegister, WriteRegister); + } + } + static size_t ReadMemory (lldb_private::EmulateInstruction *instruction, void *baton, @@ -101,7 +123,6 @@ const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue ®_value); - // size_t // ReadMemory (lldb_private::EmulateInstruction *instruction, // const lldb_private::EmulateInstruction::Context &context, @@ -127,29 +148,6 @@ const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue ®_value); - // Call CreateInstance to get an instance of this class - UnwindAssemblyInstEmulation (const lldb_private::ArchSpec &arch, - lldb_private::EmulateInstruction *inst_emulator) : - UnwindAssembly (arch), - m_inst_emulator_ap (inst_emulator), - m_range_ptr (NULL), - m_thread_ptr (NULL), - m_unwind_plan_ptr (NULL), - m_curr_row (), - m_cfa_reg_info (), - m_fp_is_cfa (false), - m_register_values (), - m_pushed_regs(), - m_curr_row_modified (false), - m_forward_branch_offset (0) - { - if (m_inst_emulator_ap.get()) - { - m_inst_emulator_ap->SetBaton (this); - m_inst_emulator_ap->SetCallbacks (ReadMemory, WriteMemory, ReadRegister, WriteRegister); - } - } - static uint64_t MakeRegisterKindValuePair (const lldb_private::RegisterInfo ®_info); Index: source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h =================================================================== --- source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h +++ source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h @@ -1,4 +1,4 @@ -//===-- UnwindAssembly-x86.h -------------------------------------*- C++ -*-===// +//===-- UnwindAssembly-x86.h ------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -10,42 +10,44 @@ #ifndef liblldb_UnwindAssembly_x86_h_ #define liblldb_UnwindAssembly_x86_h_ +// C Includes +// C++ Includes +// Other libraries and framework includes #include "llvm-c/Disassembler.h" +// Project includes #include "lldb/lldb-private.h" #include "lldb/Target/UnwindAssembly.h" class UnwindAssembly_x86 : public lldb_private::UnwindAssembly { public: + ~UnwindAssembly_x86() override; - ~UnwindAssembly_x86 (); + bool + GetNonCallSiteUnwindPlanFromAssembly(lldb_private::AddressRange& func, + lldb_private::Thread& thread, + lldb_private::UnwindPlan& unwind_plan) override; - virtual bool - GetNonCallSiteUnwindPlanFromAssembly (lldb_private::AddressRange& func, - lldb_private::Thread& thread, - lldb_private::UnwindPlan& unwind_plan); + bool + AugmentUnwindPlanFromCallSite(lldb_private::AddressRange& func, + lldb_private::Thread& thread, + lldb_private::UnwindPlan& unwind_plan) override; - virtual bool - AugmentUnwindPlanFromCallSite (lldb_private::AddressRange& func, - lldb_private::Thread& thread, - lldb_private::UnwindPlan& unwind_plan); + bool + GetFastUnwindPlan(lldb_private::AddressRange& func, + lldb_private::Thread& thread, + lldb_private::UnwindPlan &unwind_plan) override; - virtual bool - GetFastUnwindPlan (lldb_private::AddressRange& func, - lldb_private::Thread& thread, - lldb_private::UnwindPlan &unwind_plan); - // thread may be NULL in which case we only use the Target (e.g. if this is called pre-process-launch). - virtual bool - FirstNonPrologueInsn (lldb_private::AddressRange& func, - const lldb_private::ExecutionContext &exe_ctx, - lldb_private::Address& first_non_prologue_insn); + bool + FirstNonPrologueInsn(lldb_private::AddressRange& func, + const lldb_private::ExecutionContext &exe_ctx, + lldb_private::Address& first_non_prologue_insn) override; static lldb_private::UnwindAssembly * CreateInstance (const lldb_private::ArchSpec &arch); - //------------------------------------------------------------------ // PluginInterface protocol //------------------------------------------------------------------ @@ -61,11 +63,11 @@ static const char * GetPluginDescriptionStatic(); - virtual lldb_private::ConstString - GetPluginName(); + lldb_private::ConstString + GetPluginName() override; - virtual uint32_t - GetPluginVersion(); + uint32_t + GetPluginVersion() override; private: UnwindAssembly_x86 (const lldb_private::ArchSpec &arch, int cpu); @@ -74,5 +76,4 @@ lldb_private::ArchSpec m_arch; }; - #endif // liblldb_UnwindAssembly_x86_h_