1 //===-- RegisterNumber.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_TARGET_REGISTERNUMBER_H
11 #define LLDB_TARGET_REGISTERNUMBER_H
13 #include "lldb/lldb-private.h"
16 //--------------------------------------------------------------------
17 /// A class to represent register numbers, and able to convert between
18 /// different register numbering schemes that may be used in a single
20 //--------------------------------------------------------------------
22 class RegisterNumber {
24 RegisterNumber(lldb_private::Thread &thread, lldb::RegisterKind kind,
27 // This constructor plus the init() method below allow for the placeholder
28 // creation of an invalid object initially, possibly to be filled in. It
29 // would be more consistent to have three Set* methods to set the three
30 // data that the object needs.
33 void init(lldb_private::Thread &thread, lldb::RegisterKind kind,
36 const RegisterNumber &operator=(const RegisterNumber &rhs);
38 bool operator==(RegisterNumber &rhs);
40 bool operator!=(RegisterNumber &rhs);
44 uint32_t GetAsKind(lldb::RegisterKind kind);
46 uint32_t GetRegisterNumber() const;
48 lldb::RegisterKind GetRegisterKind() const;
50 const char *GetName();
53 typedef std::map<lldb::RegisterKind, uint32_t> Collection;
55 lldb::RegisterContextSP m_reg_ctx_sp;
57 lldb::RegisterKind m_kind;
58 Collection m_kind_regnum_map;
62 #endif // liblldb_RegisterNumber_h