1 //===-- RegisterNumber.h ----------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_TARGET_REGISTERNUMBER_H
10 #define LLDB_TARGET_REGISTERNUMBER_H
12 #include "lldb/lldb-private.h"
15 /// A class to represent register numbers, and able to convert between
16 /// different register numbering schemes that may be used in a single
19 class RegisterNumber {
21 RegisterNumber(lldb_private::Thread &thread, lldb::RegisterKind kind,
24 // This constructor plus the init() method below allow for the placeholder
25 // creation of an invalid object initially, possibly to be filled in. It
26 // would be more consistent to have three Set* methods to set the three data
27 // that the object needs.
30 void init(lldb_private::Thread &thread, lldb::RegisterKind kind,
33 const RegisterNumber &operator=(const RegisterNumber &rhs);
35 bool operator==(RegisterNumber &rhs);
37 bool operator!=(RegisterNumber &rhs);
41 uint32_t GetAsKind(lldb::RegisterKind kind);
43 uint32_t GetRegisterNumber() const;
45 lldb::RegisterKind GetRegisterKind() const;
47 const char *GetName();
50 typedef std::map<lldb::RegisterKind, uint32_t> Collection;
52 lldb::RegisterContextSP m_reg_ctx_sp;
54 lldb::RegisterKind m_kind;
55 Collection m_kind_regnum_map;
59 #endif // liblldb_RegisterNumber_h