1 //===-- RegisterContextKDP_x86_64.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_x86_64.h"
10 #include "ProcessKDP.h"
11 #include "ThreadKDP.h"
14 using namespace lldb_private
;
16 RegisterContextKDP_x86_64::RegisterContextKDP_x86_64(
17 ThreadKDP
&thread
, uint32_t concrete_frame_idx
)
18 : RegisterContextDarwin_x86_64(thread
, concrete_frame_idx
),
19 m_kdp_thread(thread
) {}
21 RegisterContextKDP_x86_64::~RegisterContextKDP_x86_64() = default;
23 int RegisterContextKDP_x86_64::DoReadGPR(lldb::tid_t tid
, int flavor
,
25 ProcessSP
process_sp(CalculateProcess());
28 if (static_cast<ProcessKDP
*>(process_sp
.get())
30 .SendRequestReadRegisters(tid
, GPRRegSet
, &gpr
, sizeof(gpr
),
39 int RegisterContextKDP_x86_64::DoReadFPU(lldb::tid_t tid
, int flavor
,
41 ProcessSP
process_sp(CalculateProcess());
44 if (static_cast<ProcessKDP
*>(process_sp
.get())
46 .SendRequestReadRegisters(tid
, FPURegSet
, &fpu
, sizeof(fpu
),
55 int RegisterContextKDP_x86_64::DoReadEXC(lldb::tid_t tid
, int flavor
,
57 ProcessSP
process_sp(CalculateProcess());
60 if (static_cast<ProcessKDP
*>(process_sp
.get())
62 .SendRequestReadRegisters(tid
, EXCRegSet
, &exc
, sizeof(exc
),
71 int RegisterContextKDP_x86_64::DoWriteGPR(lldb::tid_t tid
, int flavor
,
73 ProcessSP
process_sp(CalculateProcess());
76 if (static_cast<ProcessKDP
*>(process_sp
.get())
78 .SendRequestWriteRegisters(tid
, GPRRegSet
, &gpr
, sizeof(gpr
),
87 int RegisterContextKDP_x86_64::DoWriteFPU(lldb::tid_t tid
, int flavor
,
89 ProcessSP
process_sp(CalculateProcess());
92 if (static_cast<ProcessKDP
*>(process_sp
.get())
94 .SendRequestWriteRegisters(tid
, FPURegSet
, &fpu
, sizeof(fpu
),
103 int RegisterContextKDP_x86_64::DoWriteEXC(lldb::tid_t tid
, int flavor
,
105 ProcessSP
process_sp(CalculateProcess());
108 if (static_cast<ProcessKDP
*>(process_sp
.get())
110 .SendRequestWriteRegisters(tid
, EXCRegSet
, &exc
, sizeof(exc
),