diff options
Diffstat (limited to 'source/Plugins/Process/POSIX/RegisterContextPOSIX.h')
-rw-r--r-- | source/Plugins/Process/POSIX/RegisterContextPOSIX.h | 50 |
1 files changed, 37 insertions, 13 deletions
diff --git a/source/Plugins/Process/POSIX/RegisterContextPOSIX.h b/source/Plugins/Process/POSIX/RegisterContextPOSIX.h index 63ae01e83a90..e48c528403e3 100644 --- a/source/Plugins/Process/POSIX/RegisterContextPOSIX.h +++ b/source/Plugins/Process/POSIX/RegisterContextPOSIX.h @@ -13,20 +13,19 @@ // C Includes // C++ Includes // Other libraries and framework includes +#include "lldb/Core/ArchSpec.h" #include "lldb/Target/RegisterContext.h" //------------------------------------------------------------------------------ -/// @class RegisterContextPOSIX +/// @class POSIXBreakpointProtocol /// /// @brief Extends RegisterClass with a few virtual operations useful on POSIX. -class RegisterContextPOSIX - : public lldb_private::RegisterContext +class POSIXBreakpointProtocol { public: - RegisterContextPOSIX(lldb_private::Thread &thread, - uint32_t concrete_frame_idx) - : RegisterContext(thread, concrete_frame_idx) + POSIXBreakpointProtocol() { m_watchpoints_initialized = false; } + virtual ~POSIXBreakpointProtocol() {} /// Updates the register state of the associated thread after hitting a /// breakpoint (if that make sense for the architecture). Default @@ -35,36 +34,61 @@ public: /// /// @return /// True if the operation succeeded and false otherwise. - virtual bool UpdateAfterBreakpoint() { return true; } + virtual bool UpdateAfterBreakpoint() = 0; /// Determines the index in lldb's register file given a kernel byte offset. virtual unsigned - GetRegisterIndexFromOffset(unsigned offset) { return LLDB_INVALID_REGNUM; } + GetRegisterIndexFromOffset(unsigned offset) = 0; // Checks to see if a watchpoint specified by hw_index caused the inferior // to stop. virtual bool - IsWatchpointHit (uint32_t hw_index) { return false; } + IsWatchpointHit (uint32_t hw_index) = 0; // Resets any watchpoints that have been hit. virtual bool - ClearWatchpointHits () { return false; } + ClearWatchpointHits () = 0; // Returns the watchpoint address associated with a watchpoint hardware // index. virtual lldb::addr_t - GetWatchpointAddress (uint32_t hw_index) { return LLDB_INVALID_ADDRESS; } + GetWatchpointAddress (uint32_t hw_index) = 0; virtual bool - IsWatchpointVacant (uint32_t hw_index) { return false; } + IsWatchpointVacant (uint32_t hw_index) = 0; virtual bool SetHardwareWatchpointWithIndex (lldb::addr_t addr, size_t size, bool read, bool write, - uint32_t hw_index) { return false; } + uint32_t hw_index) = 0; + + // From lldb_private::RegisterContext + virtual uint32_t + NumSupportedHardwareWatchpoints () = 0; protected: bool m_watchpoints_initialized; }; +//------------------------------------------------------------------------------ +/// @class RegisterInfoInterface +/// +/// @brief RegisterInfo interface to patch RegisterInfo structure for archs. +class RegisterInfoInterface +{ +public: + RegisterInfoInterface(const lldb_private::ArchSpec& target_arch) : m_target_arch(target_arch) {} + virtual ~RegisterInfoInterface () {} + + virtual size_t + GetGPRSize () = 0; + + virtual const lldb_private::RegisterInfo * + GetRegisterInfo () = 0; + +public: + lldb_private::ArchSpec m_target_arch; +}; + #endif // #ifndef liblldb_RegisterContextPOSIX_H_ + |