LLDB  mainline
RegisterContextPOSIX.h
Go to the documentation of this file.
1 //===-- RegisterContextPOSIX.h --------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef liblldb_RegisterContextPOSIX_H_
10 #define liblldb_RegisterContextPOSIX_H_
11 
14 #include "lldb/Utility/ArchSpec.h"
15 
16 /// \class POSIXBreakpointProtocol
17 ///
18 /// Extends RegisterClass with a few virtual operations useful on POSIX.
20 public:
23 
24  /// Updates the register state of the associated thread after hitting a
25  /// breakpoint (if that make sense for the architecture). Default
26  /// implementation simply returns true for architectures which do not
27  /// require any update.
28  ///
29  /// \return
30  /// True if the operation succeeded and false otherwise.
31  virtual bool UpdateAfterBreakpoint() = 0;
32 
33  /// Determines the index in lldb's register file given a kernel byte offset.
34  virtual unsigned GetRegisterIndexFromOffset(unsigned offset) = 0;
35 
36  // Checks to see if a watchpoint specified by hw_index caused the inferior
37  // to stop.
38  virtual bool IsWatchpointHit(uint32_t hw_index) = 0;
39 
40  // Resets any watchpoints that have been hit.
41  virtual bool ClearWatchpointHits() = 0;
42 
43  // Returns the watchpoint address associated with a watchpoint hardware
44  // index.
45  virtual lldb::addr_t GetWatchpointAddress(uint32_t hw_index) = 0;
46 
47  virtual bool IsWatchpointVacant(uint32_t hw_index) = 0;
48 
49  virtual bool SetHardwareWatchpointWithIndex(lldb::addr_t addr, size_t size,
50  bool read, bool write,
51  uint32_t hw_index) = 0;
52 
53  // From lldb_private::RegisterContext
55 
56  // Force m_watchpoints_initialized to TRUE
58 
59 protected:
61 };
62 
63 #endif // #ifndef liblldb_RegisterContextPOSIX_H_
virtual bool IsWatchpointHit(uint32_t hw_index)=0
virtual bool ClearWatchpointHits()=0
virtual unsigned GetRegisterIndexFromOffset(unsigned offset)=0
Determines the index in lldb's register file given a kernel byte offset.
Extends RegisterClass with a few virtual operations useful on POSIX.
virtual lldb::addr_t GetWatchpointAddress(uint32_t hw_index)=0
virtual bool UpdateAfterBreakpoint()=0
Updates the register state of the associated thread after hitting a breakpoint (if that make sense fo...
virtual uint32_t NumSupportedHardwareWatchpoints()=0
uint64_t addr_t
Definition: lldb-types.h:83
virtual bool SetHardwareWatchpointWithIndex(lldb::addr_t addr, size_t size, bool read, bool write, uint32_t hw_index)=0
virtual bool IsWatchpointVacant(uint32_t hw_index)=0