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;
56  const char *m_name;
57 };
58 
59 #endif // LLDB_TARGET_REGISTERNUMBER_H
RegisterNumber::GetRegisterNumber
uint32_t GetRegisterNumber() const
Definition: RegisterNumber.cpp:103
RegisterNumber::operator=
const RegisterNumber & operator=(const RegisterNumber &rhs)
Definition: RegisterNumber.cpp:48
RegisterNumber::operator!=
bool operator!=(RegisterNumber &rhs)
Definition: RegisterNumber.cpp:75
RegisterNumber::init
void init(lldb_private::Thread &thread, lldb::RegisterKind kind, uint32_t num)
Definition: RegisterNumber.cpp:33
RegisterNumber
A class to represent register numbers, and able to convert between different register numbering schem...
Definition: RegisterNumber.h:19
lldb_private::Thread
Definition: Thread.h:62
RegisterNumber::operator==
bool operator==(RegisterNumber &rhs)
Definition: RegisterNumber.cpp:58
RegisterNumber::m_name
const char * m_name
Definition: RegisterNumber.h:56
RegisterNumber::m_kind
lldb::RegisterKind m_kind
Definition: RegisterNumber.h:54
RegisterNumber::Collection
std::map< lldb::RegisterKind, uint32_t > Collection
Definition: RegisterNumber.h:50
RegisterNumber::GetAsKind
uint32_t GetAsKind(lldb::RegisterKind kind)
Definition: RegisterNumber.cpp:82
RegisterNumber::GetName
const char * GetName()
Definition: RegisterNumber.cpp:107
RegisterNumber::RegisterNumber
RegisterNumber()
Definition: RegisterNumber.cpp:29
lldb::RegisterKind
RegisterKind
Register numbering types.
Definition: lldb-enumerations.h:227
lldb-private.h
uint32_t
RegisterNumber::m_regnum
uint32_t m_regnum
Definition: RegisterNumber.h:53
RegisterNumber::IsValid
bool IsValid() const
Definition: RegisterNumber.cpp:77
RegisterNumber::GetRegisterKind
lldb::RegisterKind GetRegisterKind() const
Definition: RegisterNumber.cpp:105
RegisterNumber::m_kind_regnum_map
Collection m_kind_regnum_map
Definition: RegisterNumber.h:55
RegisterNumber::m_reg_ctx_sp
lldb::RegisterContextSP m_reg_ctx_sp
Definition: RegisterNumber.h:52