summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2015-01-10 04:20:14 +0000
committerJason Molenda <jmolenda@apple.com>2015-01-10 04:20:14 +0000
commit5c93f41a5021a4e63f6fc16baa92f8cb5620cdc1 (patch)
tree1bd128b91881fb7e9c45d220a54dc10443742457
parentb0401736fcfdaaf719b19eea861a30333a2173a6 (diff)
Forgot to include RegisterNumber.h in prev commit.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@225579 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/lldb/Utility/RegisterNumber.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/include/lldb/Utility/RegisterNumber.h b/include/lldb/Utility/RegisterNumber.h
new file mode 100644
index 000000000..46bed7cab
--- /dev/null
+++ b/include/lldb/Utility/RegisterNumber.h
@@ -0,0 +1,66 @@
+//===-- RegisterNumber.h ----------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_RegisterNumber_h
+#define liblldb_RegisterNumber_h
+
+#include "lldb/lldb-private.h"
+#include <map>
+
+//--------------------------------------------------------------------
+/// A class to represent register numbers, and able to convert between
+/// different register numbering schemes that may be used in a single
+/// debug session.
+//--------------------------------------------------------------------
+
+class RegisterNumber {
+public:
+ RegisterNumber (lldb_private::Thread &thread, lldb::RegisterKind kind, uint32_t num);
+
+ // This constructor plus the init() method below allow for the placeholder
+ // creation of an invalid object initially, possibly to be filled in. It
+ // would be more consistent to have three Set* methods to set the three
+ // data that the object needs.
+ RegisterNumber ();
+
+ void
+ init (lldb_private::Thread &thread, lldb::RegisterKind kind, uint32_t num);
+
+ const RegisterNumber &
+ operator = (const RegisterNumber &rhs);
+
+ bool
+ operator == (RegisterNumber &rhs);
+
+ bool
+ IsValid () const;
+
+ uint32_t
+ GetAsKind (lldb::RegisterKind kind);
+
+ uint32_t
+ GetRegisterNumber () const;
+
+ lldb::RegisterKind
+ GetRegisterKind () const;
+
+ const char *
+ GetName ();
+
+private:
+ typedef std::map<lldb::RegisterKind, uint32_t> Collection;
+
+ lldb::RegisterContextSP m_reg_ctx_sp;
+ uint32_t m_regnum;
+ lldb::RegisterKind m_kind;
+ Collection m_kind_regnum_map;
+ const char *m_name;
+};
+
+#endif // liblldb_RegisterNumber_h