Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / source / Plugins / Process / Utility / RegisterContextDummy.h
blob631ad30b16a8b2e06808fd16e09aae0c8be91dae
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 //===----------------------------------------------------------------------===//
10 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDUMMY_H
11 #define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDUMMY_H
13 #include <vector>
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 {
22 public:
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;
53 private:
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