Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:54

0001 //===-- RegisterNumber.h ----------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_TARGET_REGISTERNUMBER_H
0010 #define LLDB_TARGET_REGISTERNUMBER_H
0011 
0012 #include "lldb/lldb-private.h"
0013 #include <map>
0014 
0015 /// A class to represent register numbers, and able to convert between
0016 /// different register numbering schemes that may be used in a single
0017 /// debug session.
0018 
0019 class RegisterNumber {
0020 public:
0021   RegisterNumber(lldb_private::Thread &thread, lldb::RegisterKind kind,
0022                  uint32_t num);
0023 
0024   // This constructor plus the init() method below allow for the placeholder
0025   // creation of an invalid object initially, possibly to be filled in.  It
0026   // would be more consistent to have three Set* methods to set the three data
0027   // that the object needs.
0028   RegisterNumber();
0029 
0030   void init(lldb_private::Thread &thread, lldb::RegisterKind kind,
0031             uint32_t num);
0032 
0033   const RegisterNumber &operator=(const RegisterNumber &rhs);
0034 
0035   bool operator==(RegisterNumber &rhs);
0036 
0037   bool operator!=(RegisterNumber &rhs);
0038 
0039   bool IsValid() const;
0040 
0041   uint32_t GetAsKind(lldb::RegisterKind kind);
0042 
0043   uint32_t GetRegisterNumber() const;
0044 
0045   lldb::RegisterKind GetRegisterKind() const;
0046 
0047   const char *GetName();
0048 
0049 private:
0050   typedef std::map<lldb::RegisterKind, uint32_t> Collection;
0051 
0052   lldb::RegisterContextSP m_reg_ctx_sp;
0053   uint32_t m_regnum = LLDB_INVALID_REGNUM;
0054   lldb::RegisterKind m_kind = lldb::kNumRegisterKinds;
0055   Collection m_kind_regnum_map;
0056   const char *m_name = nullptr;
0057 };
0058 
0059 #endif // LLDB_TARGET_REGISTERNUMBER_H