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_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTMEMORY_H
10#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTMEMORY_H
11
12#include <vector>
13
17#include "lldb/lldb-private.h"
18
20public:
22 uint32_t concrete_frame_idx,
24 lldb::addr_t reg_data_addr);
25
27
28 void InvalidateAllRegisters() override;
29
30 size_t GetRegisterCount() override;
31
32 const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override;
33
34 size_t GetRegisterSetCount() override;
35
36 const lldb_private::RegisterSet *GetRegisterSet(size_t reg_set) override;
37
39 uint32_t num) override;
40
41 // If all of the thread register are in a contiguous buffer in
42 // memory, then the default ReadRegister/WriteRegister and
43 // ReadAllRegisterValues/WriteAllRegisterValues will work. If thread
44 // registers are not contiguous, clients will want to subclass this
45 // class and modify the read/write functions as needed.
46
47 bool ReadRegister(const lldb_private::RegisterInfo *reg_info,
48 lldb_private::RegisterValue &reg_value) override;
49
50 bool WriteRegister(const lldb_private::RegisterInfo *reg_info,
51 const lldb_private::RegisterValue &reg_value) override;
52
54
55 bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;
56
57 void SetAllRegisterData(const lldb::DataBufferSP &data_sp);
58
59protected:
60 void SetAllRegisterValid(bool b);
61
63 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
69private:
73};
74
75#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTMEMORY_H
void SetAllRegisterData(const lldb::DataBufferSP &data_sp)
std::vector< bool > m_reg_valid
RegisterContextMemory(const RegisterContextMemory &)=delete
bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override
bool ReadAllRegisterValues(lldb::WritableDataBufferSP &data_sp) override
bool WriteRegister(const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &reg_value) override
size_t GetRegisterCount() 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
lldb_private::DataExtractor m_reg_data
void InvalidateAllRegisters() override
lldb::WritableDataBufferSP m_data
size_t GetRegisterSetCount() override
lldb_private::DynamicRegisterInfo & m_reg_infos
bool ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &reg_value) override
~RegisterContextMemory() override
const RegisterContextMemory & operator=(const RegisterContextMemory &)=delete
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex(size_t reg) override
An data extractor class.
Definition: DataExtractor.h:48
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
Definition: lldb-forward.h:328
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP
Definition: lldb-forward.h:329
uint64_t addr_t
Definition: lldb-types.h:80
RegisterKind
Register numbering types.
Every register is described in detail including its name, alternate name (optional),...
Registers are grouped into register sets.