Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / source / Plugins / Process / Utility / RegisterContextHistory.h
bloba1eadac5d1b73f6b222be5fdb2a6445885d6a5ed
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 //===----------------------------------------------------------------------===//
10 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTHISTORY_H
11 #define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTHISTORY_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 RegisterContextHistory : public lldb_private::RegisterContext {
22 public:
23 typedef std::shared_ptr<RegisterContextHistory> SharedPtr;
25 RegisterContextHistory(Thread &thread, uint32_t concrete_frame_idx,
26 uint32_t address_byte_size, lldb::addr_t pc_value);
28 ~RegisterContextHistory() 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 lldb::addr_t m_pc_value;
61 RegisterContextHistory(const RegisterContextHistory &) = delete;
62 const RegisterContextHistory &
63 operator=(const RegisterContextHistory &) = delete;
65 } // namespace lldb_private
67 #endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTHISTORY_H