LLDB  mainline
RegisterContextMemory.h
Go to the documentation of this file.
1 //===-- RegisterContextMemory.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 lldb_RegisterContextMemory_h_
10 #define lldb_RegisterContextMemory_h_
11 
12 #include <vector>
13 
16 #include "lldb/lldb-private.h"
17 
19 
21 public:
23  uint32_t concrete_frame_idx,
24  DynamicRegisterInfo &reg_info,
25  lldb::addr_t reg_data_addr);
26 
27  ~RegisterContextMemory() override;
28 
29  void InvalidateAllRegisters() override;
30 
31  size_t GetRegisterCount() override;
32 
33  const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override;
34 
35  size_t GetRegisterSetCount() override;
36 
37  const lldb_private::RegisterSet *GetRegisterSet(size_t reg_set) override;
38 
40  uint32_t num) override;
41 
42  // If all of the thread register are in a contiguous buffer in
43  // memory, then the default ReadRegister/WriteRegister and
44  // ReadAllRegisterValues/WriteAllRegisterValues will work. If thread
45  // registers are not contiguous, clients will want to subclass this
46  // class and modify the read/write functions as needed.
47 
48  bool ReadRegister(const lldb_private::RegisterInfo *reg_info,
49  lldb_private::RegisterValue &reg_value) override;
50 
51  bool WriteRegister(const lldb_private::RegisterInfo *reg_info,
52  const lldb_private::RegisterValue &reg_value) override;
53 
54  bool ReadAllRegisterValues(lldb::DataBufferSP &data_sp) override;
55 
56  bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;
57 
58  void SetAllRegisterData(const lldb::DataBufferSP &data_sp);
59 
60 protected:
61  void SetAllRegisterValid(bool b);
62 
64  std::vector<bool> m_reg_valid;
66  lldb::addr_t m_reg_data_addr; // If this is valid, then we have a register
67  // context that is stored in memmory
68 
69 private:
70  DISALLOW_COPY_AND_ASSIGN(RegisterContextMemory);
71 };
72 
73 #endif // lldb_RegisterContextMemory_h_
An data extractor class.
Definition: DataExtractor.h:47
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex(size_t reg) override
bool ReadAllRegisterValues(lldb::DataBufferSP &data_sp) override
void SetAllRegisterData(const lldb::DataBufferSP &data_sp)
bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override
bool ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &reg_value) override
size_t GetRegisterCount() override
DynamicRegisterInfo & m_reg_infos
bool WriteRegister(const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &reg_value) override
lldb_private::DataExtractor m_reg_data
uint64_t addr_t
Definition: lldb-types.h:83
RegisterContextMemory(lldb_private::Thread &thread, uint32_t concrete_frame_idx, DynamicRegisterInfo &reg_info, lldb::addr_t reg_data_addr)
std::vector< bool > m_reg_valid
size_t GetRegisterSetCount() override
void InvalidateAllRegisters() override
uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override
Convert from a given register numbering scheme to the lldb register numbering scheme.
const lldb_private::RegisterSet * GetRegisterSet(size_t reg_set) override