LLDB  mainline
RegisterContextDummy.h
Go to the documentation of this file.
1 //===-- RegisterContextDummy.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_REGISTERCONTEXTDUMMY_H
11 #define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDUMMY_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<RegisterContextDummy> SharedPtr;
24 
25  RegisterContextDummy(Thread &thread, uint32_t concrete_frame_idx,
26  uint32_t address_byte_size);
27 
28  ~RegisterContextDummy() 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::WritableDataBufferSP &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  const RegisterContextDummy &operator=(const RegisterContextDummy &) = delete;
61 };
62 
63 } // namespace lldb_private
64 
65 #endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDUMMY_H
lldb_private::RegisterValue
Definition: RegisterValue.h:28
lldb_private::RegisterContextDummy::ReadRegister
bool ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value) override
Definition: RegisterContextDummy.cpp:86
lldb_private::RegisterContextDummy::WriteRegister
bool WriteRegister(const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value) override
Definition: RegisterContextDummy.cpp:99
lldb_private::RegisterContextDummy::GetRegisterSet
const lldb_private::RegisterSet * GetRegisterSet(size_t reg_set) override
Definition: RegisterContextDummy.cpp:80
lldb_private::RegisterContextDummy::RegisterContextDummy
RegisterContextDummy(Thread &thread, uint32_t concrete_frame_idx, uint32_t address_byte_size)
Definition: RegisterContextDummy.cpp:36
lldb_private::RegisterContextDummy::InvalidateAllRegisters
void InvalidateAllRegisters() override
Definition: RegisterContextDummy.cpp:66
lldb_private::RegisterContextDummy::~RegisterContextDummy
~RegisterContextDummy() override
Definition: RegisterContextDummy.cpp:60
lldb_private::RegisterContextDummy::ReadAllRegisterValues
bool ReadAllRegisterValues(lldb::WritableDataBufferSP &data_sp) override
Definition: RegisterContextDummy.cpp:105
lldb_private::Thread
Definition: Thread.h:61
lldb_private::RegisterContextDummy::GetRegisterCount
size_t GetRegisterCount() override
Definition: RegisterContextDummy.cpp:68
lldb_private::RegisterContext
Definition: RegisterContext.h:17
lldb::RegisterKind
RegisterKind
Register numbering types.
Definition: lldb-enumerations.h:227
lldb-private.h
lldb_private::RegisterContextDummy::m_pc_reg_info
lldb_private::RegisterInfo m_pc_reg_info
Definition: RegisterContextDummy.h:57
lldb_private::RegisterContextDummy::GetRegisterInfoAtIndex
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex(size_t reg) override
Definition: RegisterContextDummy.cpp:71
uint32_t
lldb_private::RegisterContextDummy::operator=
const RegisterContextDummy & operator=(const RegisterContextDummy &)=delete
lldb_private::RegisterContextDummy
Definition: RegisterContextDummy.h:21
lldb_private::RegisterContextDummy::SharedPtr
std::shared_ptr< RegisterContextDummy > SharedPtr
Definition: RegisterContextDummy.h:23
SymbolContext.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::RegisterContextDummy::WriteAllRegisterValues
bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override
Definition: RegisterContextDummy.cpp:110
lldb_private::RegisterContextDummy::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: RegisterContextDummy.cpp:115
lldb_private::RegisterContextDummy::m_reg_set0
lldb_private::RegisterSet m_reg_set0
Definition: RegisterContextDummy.h:56
RegisterContext.h
lldb_private::RegisterContextDummy::GetRegisterSetCount
size_t GetRegisterSetCount() override
Definition: RegisterContextDummy.cpp:77