1 //===-- RegisterContextKDP_i386.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_i386.h"
10 #include "ProcessKDP.h"
11 #include "ThreadKDP.h"
14 using namespace lldb_private
;
16 RegisterContextKDP_i386::RegisterContextKDP_i386(ThreadKDP
&thread
,
17 uint32_t concrete_frame_idx
)
18 : RegisterContextDarwin_i386(thread
, concrete_frame_idx
),
19 m_kdp_thread(thread
) {}
21 RegisterContextKDP_i386::~RegisterContextKDP_i386() = default;
23 int RegisterContextKDP_i386::DoReadGPR(lldb::tid_t tid
, int flavor
, GPR
&gpr
) {
24 ProcessSP
process_sp(CalculateProcess());
27 if (static_cast<ProcessKDP
*>(process_sp
.get())
29 .SendRequestReadRegisters(tid
, GPRRegSet
, &gpr
, sizeof(gpr
),
38 int RegisterContextKDP_i386::DoReadFPU(lldb::tid_t tid
, int flavor
, FPU
&fpu
) {
39 ProcessSP
process_sp(CalculateProcess());
42 if (static_cast<ProcessKDP
*>(process_sp
.get())
44 .SendRequestReadRegisters(tid
, FPURegSet
, &fpu
, sizeof(fpu
),
53 int RegisterContextKDP_i386::DoReadEXC(lldb::tid_t tid
, int flavor
, EXC
&exc
) {
54 ProcessSP
process_sp(CalculateProcess());
57 if (static_cast<ProcessKDP
*>(process_sp
.get())
59 .SendRequestReadRegisters(tid
, EXCRegSet
, &exc
, sizeof(exc
),
68 int RegisterContextKDP_i386::DoWriteGPR(lldb::tid_t tid
, int flavor
,
70 ProcessSP
process_sp(CalculateProcess());
73 if (static_cast<ProcessKDP
*>(process_sp
.get())
75 .SendRequestWriteRegisters(tid
, GPRRegSet
, &gpr
, sizeof(gpr
),
84 int RegisterContextKDP_i386::DoWriteFPU(lldb::tid_t tid
, int flavor
,
86 ProcessSP
process_sp(CalculateProcess());
89 if (static_cast<ProcessKDP
*>(process_sp
.get())
91 .SendRequestWriteRegisters(tid
, FPURegSet
, &fpu
, sizeof(fpu
),
100 int RegisterContextKDP_i386::DoWriteEXC(lldb::tid_t tid
, int flavor
,
102 ProcessSP
process_sp(CalculateProcess());
105 if (static_cast<ProcessKDP
*>(process_sp
.get())
107 .SendRequestWriteRegisters(tid
, EXCRegSet
, &exc
, sizeof(exc
),