1 //===-- RegisterContextKDP_arm64.cpp --------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 #include "RegisterContextKDP_arm64.h"
11 #include "ProcessKDP.h"
12 #include "ThreadKDP.h"
15 using namespace lldb_private
;
17 RegisterContextKDP_arm64::RegisterContextKDP_arm64(ThreadKDP
&thread
,
18 uint32_t concrete_frame_idx
)
19 : RegisterContextDarwin_arm64(thread
, concrete_frame_idx
),
20 m_kdp_thread(thread
) {}
22 RegisterContextKDP_arm64::~RegisterContextKDP_arm64() = default;
24 int RegisterContextKDP_arm64::DoReadGPR(lldb::tid_t tid
, int flavor
, GPR
&gpr
) {
25 ProcessSP
process_sp(CalculateProcess());
28 if (static_cast<ProcessKDP
*>(process_sp
.get())
30 .SendRequestReadRegisters(tid
, GPRRegSet
, &gpr
, sizeof(gpr
),
39 int RegisterContextKDP_arm64::DoReadFPU(lldb::tid_t tid
, int flavor
, FPU
&fpu
) {
40 ProcessSP
process_sp(CalculateProcess());
43 if (static_cast<ProcessKDP
*>(process_sp
.get())
45 .SendRequestReadRegisters(tid
, FPURegSet
, &fpu
, sizeof(fpu
),
54 int RegisterContextKDP_arm64::DoReadEXC(lldb::tid_t tid
, int flavor
, EXC
&exc
) {
55 ProcessSP
process_sp(CalculateProcess());
58 if (static_cast<ProcessKDP
*>(process_sp
.get())
60 .SendRequestReadRegisters(tid
, EXCRegSet
, &exc
, sizeof(exc
),
69 int RegisterContextKDP_arm64::DoReadDBG(lldb::tid_t tid
, int flavor
, DBG
&dbg
) {
70 ProcessSP
process_sp(CalculateProcess());
73 if (static_cast<ProcessKDP
*>(process_sp
.get())
75 .SendRequestReadRegisters(tid
, DBGRegSet
, &dbg
, sizeof(dbg
),
84 int RegisterContextKDP_arm64::DoWriteGPR(lldb::tid_t tid
, int flavor
,
86 ProcessSP
process_sp(CalculateProcess());
89 if (static_cast<ProcessKDP
*>(process_sp
.get())
91 .SendRequestWriteRegisters(tid
, GPRRegSet
, &gpr
, sizeof(gpr
),
100 int RegisterContextKDP_arm64::DoWriteFPU(lldb::tid_t tid
, int flavor
,
102 ProcessSP
process_sp(CalculateProcess());
105 if (static_cast<ProcessKDP
*>(process_sp
.get())
107 .SendRequestWriteRegisters(tid
, FPURegSet
, &fpu
, sizeof(fpu
),
116 int RegisterContextKDP_arm64::DoWriteEXC(lldb::tid_t tid
, int flavor
,
118 ProcessSP
process_sp(CalculateProcess());
121 if (static_cast<ProcessKDP
*>(process_sp
.get())
123 .SendRequestWriteRegisters(tid
, EXCRegSet
, &exc
, sizeof(exc
),
132 int RegisterContextKDP_arm64::DoWriteDBG(lldb::tid_t tid
, int flavor
,
134 ProcessSP
process_sp(CalculateProcess());
137 if (static_cast<ProcessKDP
*>(process_sp
.get())
139 .SendRequestWriteRegisters(tid
, DBGRegSet
, &dbg
, sizeof(dbg
),