1 //===-- RegisterContextDummy.h ----------------------------------------*- C++
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
8 //===----------------------------------------------------------------------===//
10 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDUMMY_H
11 #define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDUMMY_H
15 #include "lldb/Symbol/SymbolContext.h"
16 #include "lldb/Target/RegisterContext.h"
17 #include "lldb/lldb-private.h"
19 namespace lldb_private
{
21 class RegisterContextDummy
: public lldb_private::RegisterContext
{
23 typedef std::shared_ptr
<RegisterContextDummy
> SharedPtr
;
25 RegisterContextDummy(Thread
&thread
, uint32_t concrete_frame_idx
,
26 uint32_t address_byte_size
);
28 ~RegisterContextDummy() override
;
30 void InvalidateAllRegisters() override
;
32 size_t GetRegisterCount() override
;
34 const lldb_private::RegisterInfo
*GetRegisterInfoAtIndex(size_t reg
) override
;
36 size_t GetRegisterSetCount() override
;
38 const lldb_private::RegisterSet
*GetRegisterSet(size_t reg_set
) override
;
40 bool ReadRegister(const lldb_private::RegisterInfo
*reg_info
,
41 lldb_private::RegisterValue
&value
) override
;
43 bool WriteRegister(const lldb_private::RegisterInfo
*reg_info
,
44 const lldb_private::RegisterValue
&value
) override
;
46 bool ReadAllRegisterValues(lldb::WritableDataBufferSP
&data_sp
) override
;
48 bool WriteAllRegisterValues(const lldb::DataBufferSP
&data_sp
) override
;
50 uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind
,
51 uint32_t num
) override
;
54 // For RegisterContextLLDB only
56 lldb_private::RegisterSet m_reg_set0
; // register set 0 (PC only)
57 lldb_private::RegisterInfo m_pc_reg_info
;
59 RegisterContextDummy(const RegisterContextDummy
&) = delete;
60 const RegisterContextDummy
&operator=(const RegisterContextDummy
&) = delete;
63 } // namespace lldb_private
65 #endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDUMMY_H