LLDB  mainline
RegisterContextFreeBSD_mips64.cpp
Go to the documentation of this file.
1 //===-- RegisterContextFreeBSD_mips64.cpp ---------------------------------===//
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,
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
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 }
lldb_private::RegisterInfoInterface::m_target_arch
lldb_private::ArchSpec m_target_arch
Definition: RegisterInfoInterface.h:65
lldb_private::gpr_r20_mips64
@ gpr_r20_mips64
Definition: lldb-mips-freebsd-register-enums.h:38
RegisterContextPOSIX_mips64.h
lldb_private::gpr_r19_mips64
@ gpr_r19_mips64
Definition: lldb-mips-freebsd-register-enums.h:37
lldb_private::gpr_sr_mips64
@ gpr_sr_mips64
Definition: lldb-mips-freebsd-register-enums.h:50
_GPR::ic
uint64_t ic
Definition: RegisterContextFreeBSD_mips64.cpp:78
lldb_private::gpr_r9_mips64
@ gpr_r9_mips64
Definition: lldb-mips-freebsd-register-enums.h:27
lldb_private::ArchSpec
Definition: ArchSpec.h:33
_GPR::pc
uint64_t pc
Definition: RegisterContextFreeBSD_mips64.cpp:77
lldb_private::gpr_r11_mips64
@ gpr_r11_mips64
Definition: lldb-mips-freebsd-register-enums.h:29
lldb_private::gpr_mulhi_mips64
@ gpr_mulhi_mips64
Definition: lldb-mips-freebsd-register-enums.h:52
RegisterContextFreeBSD_mips64::RegisterContextFreeBSD_mips64
RegisterContextFreeBSD_mips64(const lldb_private::ArchSpec &target_arch)
Definition: RegisterContextFreeBSD_mips64.cpp:88
_GPR::r12
uint64_t r12
Definition: RegisterContextFreeBSD_mips64.cpp:52
lldb-mips-freebsd-register-enums.h
lldb_private::gpr_r12_mips64
@ gpr_r12_mips64
Definition: lldb-mips-freebsd-register-enums.h:30
lldb_private::ArchSpec::GetCore
Core GetCore() const
Definition: ArchSpec.h:423
RegisterContextFreeBSD_mips64::GetRegisterSet
const lldb_private::RegisterSet * GetRegisterSet(size_t set) const
Definition: RegisterContextFreeBSD_mips64.cpp:97
lldb_private::RegisterInfoInterface
Definition: RegisterInfoInterface.h:21
lldb_private::gpr_r13_mips64
@ gpr_r13_mips64
Definition: lldb-mips-freebsd-register-enums.h:31
_GPR::r11
uint64_t r11
Definition: RegisterContextFreeBSD_mips64.cpp:51
lldb_private::gpr_r16_mips64
@ gpr_r16_mips64
Definition: lldb-mips-freebsd-register-enums.h:34
_GPR::r26
uint64_t r26
Definition: RegisterContextFreeBSD_mips64.cpp:66
_GPR::r5
uint64_t r5
Definition: RegisterContextFreeBSD_mips64.cpp:45
_GPR::r23
uint64_t r23
Definition: RegisterContextFreeBSD_mips64.cpp:63
lldb_private::gpr_r6_mips64
@ gpr_r6_mips64
Definition: lldb-mips-freebsd-register-enums.h:24
lldb_private::gpr_dummy_mips64
@ gpr_dummy_mips64
Definition: lldb-mips-freebsd-register-enums.h:57
lldb_private::gpr_r25_mips64
@ gpr_r25_mips64
Definition: lldb-mips-freebsd-register-enums.h:43
_GPR::r10
uint64_t r10
Definition: RegisterContextFreeBSD_mips64.cpp:50
lldb_private::gpr_r23_mips64
@ gpr_r23_mips64
Definition: lldb-mips-freebsd-register-enums.h:41
lldb_private::gpr_r24_mips64
@ gpr_r24_mips64
Definition: lldb-mips-freebsd-register-enums.h:42
_GPR::r14
uint64_t r14
Definition: RegisterContextFreeBSD_mips64.cpp:54
_GPR::r27
uint64_t r27
Definition: RegisterContextFreeBSD_mips64.cpp:67
GPR_freebsd_mips
struct _GPR GPR_freebsd_mips
lldb_private::gpr_r15_mips64
@ gpr_r15_mips64
Definition: lldb-mips-freebsd-register-enums.h:33
RegisterContextFreeBSD_mips64.h
lldb_private::gpr_r26_mips64
@ gpr_r26_mips64
Definition: lldb-mips-freebsd-register-enums.h:44
_GPR::r15
uint64_t r15
Definition: RegisterContextFreeBSD_mips64.cpp:55
lldb_private::gpr_r7_mips64
@ gpr_r7_mips64
Definition: lldb-mips-freebsd-register-enums.h:25
lldb_private::gpr_r4_mips64
@ gpr_r4_mips64
Definition: lldb-mips-freebsd-register-enums.h:22
lldb_private::k_num_gpr_registers_mips64
@ k_num_gpr_registers_mips64
Definition: lldb-mips-freebsd-register-enums.h:62
lldb_private::gpr_pc_mips64
@ gpr_pc_mips64
Definition: lldb-mips-freebsd-register-enums.h:55
RegisterContextFreeBSD_mips64::GetGPRSize
size_t GetGPRSize() const override
Definition: RegisterContextFreeBSD_mips64.cpp:92
_GPR::r1
uint64_t r1
Definition: RegisterContextFreeBSD_mips64.cpp:41
_GPR::r13
uint64_t r13
Definition: RegisterContextFreeBSD_mips64.cpp:53
lldb_private::gpr_r2_mips64
@ gpr_r2_mips64
Definition: lldb-mips-freebsd-register-enums.h:20
lldb_private::gpr_r14_mips64
@ gpr_r14_mips64
Definition: lldb-mips-freebsd-register-enums.h:32
g_register_infos_mips64
static const RegisterInfo g_register_infos_mips64[]
Definition: ABISysV_mips64.cpp:78
_GPR::zero
uint64_t zero
Definition: RegisterContextFreeBSD_mips64.cpp:40
_GPR::r9
uint64_t r9
Definition: RegisterContextFreeBSD_mips64.cpp:49
RegisterContextFreeBSD_mips64::GetRegisterCount
uint32_t GetRegisterCount() const override
Definition: RegisterContextFreeBSD_mips64.cpp:114
g_reg_sets_mips64
static const RegisterSet g_reg_sets_mips64[k_num_register_sets]
Definition: RegisterContextFreeBSD_mips64.cpp:32
RegisterContextFreeBSD_mips64::GetRegisterSetCount
size_t GetRegisterSetCount() const
Definition: RegisterContextFreeBSD_mips64.cpp:105
_GPR::sp
uint64_t sp
Definition: RegisterContextFreeBSD_mips64.cpp:69
lldb_private::gpr_badvaddr_mips64
@ gpr_badvaddr_mips64
Definition: lldb-mips-freebsd-register-enums.h:53
_GPR::dummy
uint64_t dummy
Definition: RegisterContextFreeBSD_mips64.cpp:79
_GPR::mulhi
uint64_t mulhi
Definition: RegisterContextFreeBSD_mips64.cpp:74
lldb_private::gpr_r21_mips64
@ gpr_r21_mips64
Definition: lldb-mips-freebsd-register-enums.h:39
_GPR::r16
uint64_t r16
Definition: RegisterContextFreeBSD_mips64.cpp:56
_GPR::r25
uint64_t r25
Definition: RegisterContextFreeBSD_mips64.cpp:65
k_num_register_sets
constexpr size_t k_num_register_sets
Definition: RegisterContextFreeBSD_mips64.cpp:30
_GPR::r4
uint64_t r4
Definition: RegisterContextFreeBSD_mips64.cpp:44
lldb_private::gpr_ra_mips64
@ gpr_ra_mips64
Definition: lldb-mips-freebsd-register-enums.h:49
_GPR::r19
uint64_t r19
Definition: RegisterContextFreeBSD_mips64.cpp:59
set
set(option_framework FRAMEWORK) endif() if(LLDB_ENABLE_PYTHON) get_target_property(python_bindings_dir swig_wrapper_python BINARY_DIR) set(lldb_python_wrapper $
Definition: API/CMakeLists.txt:9
lldb_private::gpr_mullo_mips64
@ gpr_mullo_mips64
Definition: lldb-mips-freebsd-register-enums.h:51
_GPR::r6
uint64_t r6
Definition: RegisterContextFreeBSD_mips64.cpp:46
_GPR::r30
uint64_t r30
Definition: RegisterContextFreeBSD_mips64.cpp:70
lldb_private::gpr_r8_mips64
@ gpr_r8_mips64
Definition: lldb-mips-freebsd-register-enums.h:26
g_gpr_regnums
static const uint32_t g_gpr_regnums[]
Definition: RegisterContextFreeBSD_mips64.cpp:17
_GPR::mullo
uint64_t mullo
Definition: RegisterContextFreeBSD_mips64.cpp:73
_GPR::cause
uint64_t cause
Definition: RegisterContextFreeBSD_mips64.cpp:76
lldb_private::gpr_sp_mips64
@ gpr_sp_mips64
Definition: lldb-mips-freebsd-register-enums.h:47
_GPR::ra
uint64_t ra
Definition: RegisterContextFreeBSD_mips64.cpp:71
_GPR::r2
uint64_t r2
Definition: RegisterContextFreeBSD_mips64.cpp:42
lldb_private::gpr_cause_mips64
@ gpr_cause_mips64
Definition: lldb-mips-freebsd-register-enums.h:54
lldb_private::gpr_gp_mips64
@ gpr_gp_mips64
Definition: lldb-mips-freebsd-register-enums.h:46
uint32_t
lldb_private::gpr_r22_mips64
@ gpr_r22_mips64
Definition: lldb-mips-freebsd-register-enums.h:40
lldb_private::gpr_r27_mips64
@ gpr_r27_mips64
Definition: lldb-mips-freebsd-register-enums.h:45
lldb_private::gpr_zero_mips64
@ gpr_zero_mips64
Definition: lldb-mips-freebsd-register-enums.h:18
_GPR::gp
uint64_t gp
Definition: RegisterContextFreeBSD_mips64.cpp:68
_GPR::r22
uint64_t r22
Definition: RegisterContextFreeBSD_mips64.cpp:62
lldb_private::gpr_r18_mips64
@ gpr_r18_mips64
Definition: lldb-mips-freebsd-register-enums.h:36
_GPR::r3
uint64_t r3
Definition: RegisterContextFreeBSD_mips64.cpp:43
lldb_private::gpr_r17_mips64
@ gpr_r17_mips64
Definition: lldb-mips-freebsd-register-enums.h:35
_GPR::badvaddr
uint64_t badvaddr
Definition: RegisterContextFreeBSD_mips64.cpp:75
RegisterContextFreeBSD_mips64::GetRegisterInfo
const lldb_private::RegisterInfo * GetRegisterInfo() const override
Definition: RegisterContextFreeBSD_mips64.cpp:109
_GPR::r20
uint64_t r20
Definition: RegisterContextFreeBSD_mips64.cpp:60
lldb_private::gpr_r10_mips64
@ gpr_r10_mips64
Definition: lldb-mips-freebsd-register-enums.h:28
_GPR::r24
uint64_t r24
Definition: RegisterContextFreeBSD_mips64.cpp:64
_GPR::r17
uint64_t r17
Definition: RegisterContextFreeBSD_mips64.cpp:57
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
RegisterInfos_mips64.h
lldb_private::gpr_r3_mips64
@ gpr_r3_mips64
Definition: lldb-mips-freebsd-register-enums.h:21
lldb_private::gpr_r5_mips64
@ gpr_r5_mips64
Definition: lldb-mips-freebsd-register-enums.h:23
lldb_private::gpr_r30_mips64
@ gpr_r30_mips64
Definition: lldb-mips-freebsd-register-enums.h:48
_GPR::r21
uint64_t r21
Definition: RegisterContextFreeBSD_mips64.cpp:61
_GPR::r18
uint64_t r18
Definition: RegisterContextFreeBSD_mips64.cpp:58
_GPR::r8
uint64_t r8
Definition: RegisterContextFreeBSD_mips64.cpp:48
lldb
Definition: SBAddress.h:15
lldb_private::gpr_r1_mips64
@ gpr_r1_mips64
Definition: lldb-mips-freebsd-register-enums.h:19
_GPR::r7
uint64_t r7
Definition: RegisterContextFreeBSD_mips64.cpp:47
_GPR::sr
uint64_t sr
Definition: RegisterContextFreeBSD_mips64.cpp:72
lldb_private::gpr_ic_mips64
@ gpr_ic_mips64
Definition: lldb-mips-freebsd-register-enums.h:56