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
20public:
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
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
41 uint32_t GetAsKind(lldb::RegisterKind kind);
42
43 uint32_t GetRegisterNumber() const;
44
46
47 const char *GetName();
48
49private:
50 typedef std::map<lldb::RegisterKind, uint32_t> Collection;
51
56 const char *m_name = nullptr;
57};
58
59#endif // LLDB_TARGET_REGISTERNUMBER_H
A class to represent register numbers, and able to convert between different register numbering schem...
lldb::RegisterContextSP m_reg_ctx_sp
bool operator==(RegisterNumber &rhs)
bool IsValid() const
uint32_t GetAsKind(lldb::RegisterKind kind)
lldb::RegisterKind GetRegisterKind() const
const RegisterNumber & operator=(const RegisterNumber &rhs)
std::map< lldb::RegisterKind, uint32_t > Collection
const char * m_name
uint32_t m_regnum
uint32_t GetRegisterNumber() const
bool operator!=(RegisterNumber &rhs)
lldb::RegisterKind m_kind
void init(lldb_private::Thread &thread, lldb::RegisterKind kind, uint32_t num)
const char * GetName()
Collection m_kind_regnum_map
#define LLDB_INVALID_REGNUM
Definition: lldb-defines.h:87
std::shared_ptr< lldb_private::RegisterContext > RegisterContextSP
Definition: lldb-forward.h:392
RegisterKind
Register numbering types.
@ kNumRegisterKinds