LLDB  mainline
RegisterNumber.h
Go to the documentation of this file.
1 //===-- RegisterNumber.h ----------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_TARGET_REGISTERNUMBER_H
10 #define LLDB_TARGET_REGISTERNUMBER_H
11 
12 #include "lldb/lldb-private.h"
13 #include <map>
14 
15 /// A class to represent register numbers, and able to convert between
16 /// different register numbering schemes that may be used in a single
17 /// debug session.
18 
20 public:
22  uint32_t num);
23 
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.
29 
30  void init(lldb_private::Thread &thread, lldb::RegisterKind kind,
31  uint32_t num);
32 
33  const RegisterNumber &operator=(const RegisterNumber &rhs);
34 
35  bool operator==(RegisterNumber &rhs);
36 
37  bool operator!=(RegisterNumber &rhs);
38 
39  bool IsValid() const;
40 
42 
44 
46 
47  const char *GetName();
48 
49 private:
50  typedef std::map<lldb::RegisterKind, uint32_t> Collection;
51 
52  lldb::RegisterContextSP m_reg_ctx_sp;
53  uint32_t m_regnum;
54  lldb::RegisterKind m_kind;
55  Collection m_kind_regnum_map;
56  const char *m_name;
57 };
58 
59 #endif // liblldb_RegisterNumber_h
lldb::RegisterKind GetRegisterKind() const
uint32_t GetRegisterNumber() const
uint32_t GetAsKind(lldb::RegisterKind kind)
bool operator==(RegisterNumber &rhs)
const RegisterNumber & operator=(const RegisterNumber &rhs)
bool operator!=(RegisterNumber &rhs)
bool IsValid() const
void init(lldb_private::Thread &thread, lldb::RegisterKind kind, uint32_t num)
const char * GetName()
A class to represent register numbers, and able to convert between different register numbering schem...