LLDB  mainline
RegisterContextHistory.h
Go to the documentation of this file.
1 //===-- RegisterContextHistory.h ----------------------------------------*- C++
2 //-*-===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTHISTORY_H
11 #define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTHISTORY_H
12 
13 #include <vector>
14 
17 #include "lldb/lldb-private.h"
18 
19 namespace lldb_private {
20 
22 public:
23  typedef std::shared_ptr<RegisterContextHistory> SharedPtr;
24 
25  RegisterContextHistory(Thread &thread, uint32_t concrete_frame_idx,
26  uint32_t address_byte_size, lldb::addr_t pc_value);
27 
28  ~RegisterContextHistory() override;
29 
30  void InvalidateAllRegisters() override;
31 
32  size_t GetRegisterCount() override;
33 
34  const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override;
35 
36  size_t GetRegisterSetCount() override;
37 
38  const lldb_private::RegisterSet *GetRegisterSet(size_t reg_set) override;
39 
40  bool ReadRegister(const lldb_private::RegisterInfo *reg_info,
41  lldb_private::RegisterValue &value) override;
42 
43  bool WriteRegister(const lldb_private::RegisterInfo *reg_info,
44  const lldb_private::RegisterValue &value) override;
45 
46  bool ReadAllRegisterValues(lldb::DataBufferSP &data_sp) override;
47 
48  bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;
49 
51  uint32_t num) override;
52 
53 private:
54  // For RegisterContextLLDB only
55 
56  lldb_private::RegisterSet m_reg_set0; // register set 0 (PC only)
57  lldb_private::RegisterInfo m_pc_reg_info;
58 
60 
63  operator=(const RegisterContextHistory &) = delete;
64 };
65 } // namespace lldb_private
66 
67 #endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTHISTORY_H
lldb_private::RegisterContextHistory::SharedPtr
std::shared_ptr< RegisterContextHistory > SharedPtr
Definition: RegisterContextHistory.h:23
lldb_private::RegisterContextHistory::WriteAllRegisterValues
bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override
Definition: RegisterContextHistory.cpp:111
lldb_private::RegisterContextHistory::GetRegisterCount
size_t GetRegisterCount() override
Definition: RegisterContextHistory.cpp:69
lldb_private::RegisterContextHistory::ConvertRegisterKindToRegisterNumber
uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override
Convert from a given register numbering scheme to the lldb register numbering scheme.
Definition: RegisterContextHistory.cpp:116
lldb_private::RegisterContextHistory::~RegisterContextHistory
~RegisterContextHistory() override
Definition: RegisterContextHistory.cpp:61
lldb_private::RegisterValue
Definition: RegisterValue.h:28
lldb_private::RegisterContextHistory::GetRegisterInfoAtIndex
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex(size_t reg) override
Definition: RegisterContextHistory.cpp:72
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::RegisterContextHistory::RegisterContextHistory
RegisterContextHistory(Thread &thread, uint32_t concrete_frame_idx, uint32_t address_byte_size, lldb::addr_t pc_value)
Definition: RegisterContextHistory.cpp:36
lldb_private::RegisterContextHistory::m_pc_reg_info
lldb_private::RegisterInfo m_pc_reg_info
Definition: RegisterContextHistory.h:57
lldb_private::RegisterContextHistory::WriteRegister
bool WriteRegister(const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value) override
Definition: RegisterContextHistory.cpp:100
lldb_private::RegisterContextHistory::GetRegisterSetCount
size_t GetRegisterSetCount() override
Definition: RegisterContextHistory.cpp:78
lldb_private::Thread
Definition: Thread.h:60
lldb_private::RegisterContextHistory
Definition: RegisterContextHistory.h:21
lldb_private::RegisterContextHistory::InvalidateAllRegisters
void InvalidateAllRegisters() override
Definition: RegisterContextHistory.cpp:67
lldb_private::RegisterContextHistory::m_reg_set0
lldb_private::RegisterSet m_reg_set0
Definition: RegisterContextHistory.h:56
lldb_private::RegisterContext
Definition: RegisterContext.h:17
lldb::RegisterKind
RegisterKind
Register numbering types.
Definition: lldb-enumerations.h:227
lldb-private.h
lldb_private::RegisterContextHistory::operator=
const RegisterContextHistory & operator=(const RegisterContextHistory &)=delete
uint32_t
SymbolContext.h
lldb_private::RegisterContextHistory::m_pc_value
lldb::addr_t m_pc_value
Definition: RegisterContextHistory.h:59
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::RegisterContextHistory::GetRegisterSet
const lldb_private::RegisterSet * GetRegisterSet(size_t reg_set) override
Definition: RegisterContextHistory.cpp:81
RegisterContext.h
lldb_private::RegisterContextHistory::ReadRegister
bool ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value) override
Definition: RegisterContextHistory.cpp:87
lldb_private::RegisterContextHistory::ReadAllRegisterValues
bool ReadAllRegisterValues(lldb::DataBufferSP &data_sp) override
Definition: RegisterContextHistory.cpp:106