1 //===-- RegisterContextWindows.h --------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef liblldb_RegisterContextWindows_H_
11 #define liblldb_RegisterContextWindows_H_
12 
13 #include "lldb/Target/RegisterContext.h"
14 #include "lldb/lldb-forward.h"
15 
16 namespace lldb_private {
17 
18 class Thread;
19 
20 class RegisterContextWindows : public lldb_private::RegisterContext {
21 public:
22   //------------------------------------------------------------------
23   // Constructors and Destructors
24   //------------------------------------------------------------------
25   RegisterContextWindows(Thread &thread, uint32_t concrete_frame_idx);
26 
27   virtual ~RegisterContextWindows();
28 
29   //------------------------------------------------------------------
30   // Subclasses must override these functions
31   //------------------------------------------------------------------
32   void InvalidateAllRegisters() override;
33 
34   bool ReadAllRegisterValues(lldb::DataBufferSP &data_sp) override;
35 
36   bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;
37 
38   uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind,
39                                                uint32_t num) override;
40 
41   //------------------------------------------------------------------
42   // Subclasses can override these functions if desired
43   //------------------------------------------------------------------
44   uint32_t NumSupportedHardwareBreakpoints() override;
45 
46   uint32_t SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override;
47 
48   bool ClearHardwareBreakpoint(uint32_t hw_idx) override;
49 
50   uint32_t NumSupportedHardwareWatchpoints() override;
51 
52   uint32_t SetHardwareWatchpoint(lldb::addr_t addr, size_t size, bool read,
53                                  bool write) override;
54 
55   bool ClearHardwareWatchpoint(uint32_t hw_index) override;
56 
57   bool HardwareSingleStep(bool enable) override;
58 
59 protected:
60   virtual bool CacheAllRegisterValues();
61 
62   CONTEXT m_context;
63   bool m_context_stale;
64 };
65 }
66 
67 #endif // #ifndef liblldb_RegisterContextWindows_H_
68