LLDB  mainline
RegisterContextFreeBSD_mips64.cpp
Go to the documentation of this file.
1 //===-- RegisterContextFreeBSD_mips64.cpp ----------------------*- 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 
12 #include <vector>
13 
14 using namespace lldb_private;
15 using namespace lldb;
16 
17 static const uint32_t g_gpr_regnums[] = {
28 
29 // Number of register sets provided by this context.
30 constexpr size_t k_num_register_sets = 1;
31 
32 static const RegisterSet g_reg_sets_mips64[k_num_register_sets] = {
33  {"General Purpose Registers", "gpr", k_num_gpr_registers_mips64,
34  g_gpr_regnums},
35 };
36 
37 
38 // http://svnweb.freebsd.org/base/head/sys/mips/include/regnum.h
39 typedef struct _GPR {
40  uint64_t zero;
41  uint64_t r1;
42  uint64_t r2;
43  uint64_t r3;
44  uint64_t r4;
45  uint64_t r5;
46  uint64_t r6;
47  uint64_t r7;
48  uint64_t r8;
49  uint64_t r9;
50  uint64_t r10;
51  uint64_t r11;
52  uint64_t r12;
53  uint64_t r13;
54  uint64_t r14;
55  uint64_t r15;
56  uint64_t r16;
57  uint64_t r17;
58  uint64_t r18;
59  uint64_t r19;
60  uint64_t r20;
61  uint64_t r21;
62  uint64_t r22;
63  uint64_t r23;
64  uint64_t r24;
65  uint64_t r25;
66  uint64_t r26;
67  uint64_t r27;
68  uint64_t gp;
69  uint64_t sp;
70  uint64_t r30;
71  uint64_t ra;
72  uint64_t sr;
73  uint64_t mullo;
74  uint64_t mulhi;
75  uint64_t badvaddr;
76  uint64_t cause;
77  uint64_t pc;
78  uint64_t ic;
79  uint64_t dummy;
81 
82 // Include RegisterInfos_mips64 to declare our g_register_infos_mips64
83 // structure.
84 #define DECLARE_REGISTER_INFOS_MIPS64_STRUCT
85 #include "RegisterInfos_mips64.h"
86 #undef DECLARE_REGISTER_INFOS_MIPS64_STRUCT
87 
89  const ArchSpec &target_arch)
90  : RegisterInfoInterface(target_arch) {}
91 
93  return sizeof(GPR_freebsd_mips);
94 }
95 
96 const RegisterSet *
98  // Check if RegisterSet is available
99  if (set < k_num_register_sets)
100  return &g_reg_sets_mips64[set];
101  return nullptr;
102 }
103 
104 size_t
106  return k_num_register_sets;
107 }
108 
110  assert(m_target_arch.GetCore() == ArchSpec::eCore_mips64);
112 }
113 
115  return static_cast<uint32_t>(sizeof(g_register_infos_mips64) /
116  sizeof(g_register_infos_mips64[0]));
117 }
Core GetCore() const
Definition: ArchSpec.h:410
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
RegisterInfo interface to patch RegisterInfo structure for archs.
An architecture specification class.
Definition: ArchSpec.h:32
const lldb_private::RegisterInfo * GetRegisterInfo() const override
static const RegisterSet g_reg_sets_mips64[k_num_register_sets]
static const uint32_t g_gpr_regnums[]
constexpr size_t k_num_register_sets
const lldb_private::RegisterSet * GetRegisterSet(size_t set) const
Definition: SBAddress.h:15
static const RegisterInfo g_register_infos_mips64[]
struct _GPR GPR_freebsd_mips
RegisterContextFreeBSD_mips64(const lldb_private::ArchSpec &target_arch)