]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Utility/RegisterNumber.h
Update LLDB snapshot to upstream r225923 (git 2b588ecd)
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Utility / RegisterNumber.h
1 //===-- RegisterNumber.h ----------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_RegisterNumber_h
11 #define liblldb_RegisterNumber_h
12
13 #include "lldb/lldb-private.h"
14 #include <map>
15
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
19 /// debug session.
20 //--------------------------------------------------------------------
21
22 class RegisterNumber {
23 public:
24     RegisterNumber (lldb_private::Thread &thread, lldb::RegisterKind kind, uint32_t num);
25
26     // This constructor plus the init() method below allow for the placeholder
27     // creation of an invalid object initially, possibly to be filled in.  It
28     // would be more consistent to have three Set* methods to set the three
29     // data that the object needs.
30     RegisterNumber ();
31
32     void
33     init (lldb_private::Thread &thread, lldb::RegisterKind kind, uint32_t num);
34
35     const RegisterNumber &
36     operator = (const RegisterNumber &rhs);
37
38     bool
39     operator == (RegisterNumber &rhs);
40
41     bool
42     operator != (RegisterNumber &rhs);
43
44     bool
45     IsValid () const;
46
47     uint32_t
48     GetAsKind (lldb::RegisterKind kind);
49
50     uint32_t
51     GetRegisterNumber () const;
52
53     lldb::RegisterKind
54     GetRegisterKind () const;
55
56     const char *
57     GetName ();
58
59 private:
60     typedef std::map<lldb::RegisterKind, uint32_t> Collection; 
61
62     lldb::RegisterContextSP m_reg_ctx_sp;
63     uint32_t                m_regnum;
64     lldb::RegisterKind      m_kind;
65     Collection              m_kind_regnum_map;
66     const char              *m_name;
67 };
68
69 #endif // liblldb_RegisterNumber_h