1 //===-- RegisterInfoInterface.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 lldb_RegisterInfoInterface_h
11 #define lldb_RegisterInfoInterface_h
12 
13 #include "lldb/Core/ArchSpec.h"
14 
15 namespace lldb_private
16 {
17 
18     ///------------------------------------------------------------------------------
19     /// @class RegisterInfoInterface
20     ///
21     /// @brief RegisterInfo interface to patch RegisterInfo structure for archs.
22     ///------------------------------------------------------------------------------
23     class RegisterInfoInterface
24     {
25     public:
26         RegisterInfoInterface(const lldb_private::ArchSpec& target_arch) : m_target_arch(target_arch) {}
27         virtual ~RegisterInfoInterface () {}
28 
29         virtual size_t
30         GetGPRSize () const = 0;
31 
32         virtual const lldb_private::RegisterInfo *
33         GetRegisterInfo () const = 0;
34 
35         // Returns the number of registers including the user registers and the
36         // lldb internal registers also
37         virtual uint32_t
38         GetRegisterCount () const = 0;
39 
40         // Returns the number of the user registers (excluding the registers
41         // kept for lldb internal use only). Subclasses should override it if
42         // they belongs to an architecture with lldb internal registers.
43         virtual uint32_t
44         GetUserRegisterCount () const
45         {
46             return GetRegisterCount();
47         }
48 
49         const lldb_private::ArchSpec&
50         GetTargetArchitecture() const
51             { return m_target_arch; }
52 
53     public:
54         // FIXME make private.
55         lldb_private::ArchSpec m_target_arch;
56     };
57 
58 }
59 
60 #endif
61