1 //===-- RegisterContextMemory.h ---------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef lldb_RegisterContextMemory_h_
11 #define lldb_RegisterContextMemory_h_
17 // Other libraries and framework includes
19 #include "lldb/lldb-private.h"
20 #include "lldb/Core/DataExtractor.h"
21 #include "lldb/Target/RegisterContext.h"
23 class DynamicRegisterInfo;
25 class RegisterContextMemory : public lldb_private::RegisterContext
28 //------------------------------------------------------------------
29 // Constructors and Destructors
30 //------------------------------------------------------------------
31 RegisterContextMemory (lldb_private::Thread &thread,
32 uint32_t concrete_frame_idx,
33 DynamicRegisterInfo ®_info,
34 lldb::addr_t reg_data_addr);
37 ~RegisterContextMemory ();
39 //------------------------------------------------------------------
40 // Subclasses must override these functions
41 //------------------------------------------------------------------
43 InvalidateAllRegisters ();
48 virtual const lldb_private::RegisterInfo *
49 GetRegisterInfoAtIndex (size_t reg);
52 GetRegisterSetCount ();
54 virtual const lldb_private::RegisterSet *
55 GetRegisterSet (size_t reg_set);
58 ConvertRegisterKindToRegisterNumber (uint32_t kind, uint32_t num);
61 //------------------------------------------------------------------
62 // If all of the thread register are in a contiguous buffer in
63 // memory, then the default ReadRegister/WriteRegister and
64 // ReadAllRegisterValues/WriteAllRegisterValues will work. If thread
65 // registers are not contiguous, clients will want to subclass this
66 // class and modify the read/write functions as needed.
67 //------------------------------------------------------------------
70 ReadRegister (const lldb_private::RegisterInfo *reg_info,
71 lldb_private::RegisterValue ®_value);
74 WriteRegister (const lldb_private::RegisterInfo *reg_info,
75 const lldb_private::RegisterValue ®_value);
78 ReadAllRegisterValues (lldb::DataBufferSP &data_sp);
81 WriteAllRegisterValues (const lldb::DataBufferSP &data_sp);
84 SetAllRegisterData (const lldb::DataBufferSP &data_sp);
88 SetAllRegisterValid (bool b);
90 DynamicRegisterInfo &m_reg_infos;
91 std::vector<bool> m_reg_valid;
92 lldb_private::DataExtractor m_reg_data;
93 lldb::addr_t m_reg_data_addr; // If this is valid, then we have a register context that is stored in memmory
96 //------------------------------------------------------------------
97 // For RegisterContextMemory only
98 //------------------------------------------------------------------
99 DISALLOW_COPY_AND_ASSIGN (RegisterContextMemory);
102 #endif // lldb_RegisterContextMemory_h_