1 //===-- DynamicRegisterInfo.h -----------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef lldb_DynamicRegisterInfo_h_
11 #define lldb_DynamicRegisterInfo_h_
18 // Other libraries and framework includes
20 #include "lldb/Core/ConstString.h"
21 #include "lldb/Core/StructuredData.h"
22 #include "lldb/lldb-private.h"
24 class DynamicRegisterInfo {
26 DynamicRegisterInfo();
28 DynamicRegisterInfo(const lldb_private::StructuredData::Dictionary &dict,
29 const lldb_private::ArchSpec &arch);
31 virtual ~DynamicRegisterInfo();
33 size_t SetRegisterInfo(const lldb_private::StructuredData::Dictionary &dict,
34 const lldb_private::ArchSpec &arch);
36 void AddRegister(lldb_private::RegisterInfo ®_info,
37 lldb_private::ConstString ®_name,
38 lldb_private::ConstString ®_alt_name,
39 lldb_private::ConstString &set_name);
41 void Finalize(const lldb_private::ArchSpec &arch);
43 size_t GetNumRegisters() const;
45 size_t GetNumRegisterSets() const;
47 size_t GetRegisterDataByteSize() const;
49 const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(uint32_t i) const;
51 lldb_private::RegisterInfo *GetRegisterInfoAtIndex(uint32_t i);
53 const lldb_private::RegisterSet *GetRegisterSet(uint32_t i) const;
55 uint32_t GetRegisterSetIndexByName(lldb_private::ConstString &set_name,
58 uint32_t ConvertRegisterKindToRegisterNumber(uint32_t kind,
66 //------------------------------------------------------------------
67 // Classes that inherit from DynamicRegisterInfo can see and modify these
68 //------------------------------------------------------------------
69 typedef std::vector<lldb_private::RegisterInfo> reg_collection;
70 typedef std::vector<lldb_private::RegisterSet> set_collection;
71 typedef std::vector<uint32_t> reg_num_collection;
72 typedef std::vector<reg_num_collection> set_reg_num_collection;
73 typedef std::vector<lldb_private::ConstString> name_collection;
74 typedef std::map<uint32_t, reg_num_collection> reg_to_regs_map;
75 typedef std::vector<uint8_t> dwarf_opcode;
76 typedef std::map<uint32_t, dwarf_opcode> dynamic_reg_size_map;
78 lldb_private::RegisterInfo *
79 GetRegisterInfo(const lldb_private::ConstString ®_name);
81 reg_collection m_regs;
82 set_collection m_sets;
83 set_reg_num_collection m_set_reg_nums;
84 name_collection m_set_names;
85 reg_to_regs_map m_value_regs_map;
86 reg_to_regs_map m_invalidate_regs_map;
87 dynamic_reg_size_map m_dynamic_reg_size_map;
88 size_t m_reg_data_byte_size; // The number of bytes required to store all
93 #endif // lldb_DynamicRegisterInfo_h_